charm-nagios:candidate/21.10

Last commit made on 2021-10-08
Get this branch:
git clone -b candidate/21.10 https://git.launchpad.net/charm-nagios
Members of Llama (LMA) Charmers can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
candidate/21.10
Repository:
lp:charm-nagios

Recent commits

1b72935... by Linda Guo

Return empty string if JUJU_CHARM_DIR is not set because None+"/icon.svg" would raise exception

Reviewed-on: https://code.launchpad.net/~lihuiguo/charm-nagios/+git/charm-nagios/+merge/409880
Reviewed-by: James Troup <email address hidden>

07c917c... by Linda Guo

Return empty string if JUJU_CHARM_DIR is not set

None+"/icon.svg" would raise exception

9ad5dc8... by Linda Guo

add registration relation to register nagios to Homer dashboard[1]

[1] https://launchpad.net/charm-homer-dashboard

Reviewed-on: https://code.launchpad.net/~lihuiguo/charm-nagios/+git/charm-nagios/+merge/409472
Reviewed-by: James Troup <email address hidden>
Reviewed-by: 🤖 prod-jenkaas-bootstack <email address hidden>

d316714... by Linda Guo

Add application-dashboard relation

Add application-dashboard relation to register nagios to
Homer dashboard[1]

[1] https://launchpad.net/charm-homer-dashboard

LP#1945723

31a0a4d... by Paul Goins

Centralized and reworked nagios reloads

* Moved reload code to common.py.

* Implemented more robust reload methodology which basically does the
  following:

  * Sends a reload signal to nagios.

  * Check nagios log file to confirm that it recognized the SIGHUP
    signal from the reload request.

  * Retry reload if the log file doesn't mention receipt of the
    SIGHUP.

  * Worst case: after 30 attempts, and probably a little over 1 second
    per attempt, proceed anyway (but with a warning)

While in theory there could be a very small window between Nagios
receiving the SIGHUP and writing the related message to its log file,
this should be very small and unlikely to be hit.

Reviewed-on: https://code.launchpad.net/~vultaire/charm-nagios/+git/charm-nagios/+merge/408842
Reviewed-by: James Troup <email address hidden>
Reviewed-by: 🤖 prod-jenkaas-bootstack <email address hidden>
Reviewed-by: Xav Paice <email address hidden>

21103eb... by Paul Goins

Minor fixes/tweaks

* Replaced nested definition of "i" with "_", to avoid colliding and
  since the inner loop's variable isn't actually used.
* Updated the subprocess check in _get_last_reload_message to use
  shell=True.

58a06c6... by Paul Goins

Centralized and reworked nagios reloads

* Moved reload code to common.py.

* Implemented more robust reload methodology which basically does the
  following:

  * Sends a reload signal to nagios.

  * Check nagios log file to confirm that it recognized the SIGHUP
    signal from the reload request.

  * Retry reload if the log file doesn't mention receipt of the
    SIGHUP.

  * Worst case: after 30 attempts, and probably a little over 1 second
    per attempt, proceed anyway (but with a warning)

While in theory there could be a very small window between Nagios
receiving the SIGHUP and writing the related message to its log file,
this should be very small and unlikely to be hit.

0543944... by Paul Goins

Keep writing config for newly-created config files

With the new logic, we try to write only the files we need to.
However, there may legitimately be cases where there's multiple sets
of data associated with the same host name (e.g. multiple nrpe units),
and at present, only the first set of such data will actually be
written.

This change tracks files which are being newly created, and will allow
multiple sets of relation data to be written to the same file, if
necessary.

Reviewed-on: https://code.launchpad.net/~vultaire/charm-nagios/+git/charm-nagios/+merge/407788
Reviewed-by: James Troup <email address hidden>
Reviewed-by: 🤖 prod-jenkaas-bootstack <email address hidden>
Reviewed-by: Xav Paice <email address hidden>
Reviewed-by: Garrett Thompson <email address hidden>

1425e19... by Paul Goins

Fixed deduping to skip the prefix if not needed

Deduplication is only performed if there are 2 or more related units
with the same target hostname from different models. If there are
"duplicates" but they are from the same model (e.g. multiple nrpe units
associated with different principal apps on the same host), it is
probably preferable to have those "coalesce" into a single host, rather
than having distinct records with redundant checks.

Reviewed-on: https://code.launchpad.net/~vultaire/charm-nagios/+git/charm-nagios/+merge/407757
Reviewed-by: Garrett Thompson <email address hidden>
Reviewed-by: 🤖 prod-jenkaas-bootstack <email address hidden>
Reviewed-by: Xav Paice <email address hidden>

525739b... by Paul Goins

Keep writing config for newly-created config files

With the new logic, we try to write only the files we need to.
However, there may legitimately be cases where there's multiple sets
of data associated with the same host name (e.g. multiple nrpe units),
and at present, only the first set of such data will actually be
written.

This change tracks files which are being newly created, and will allow
multiple sets of relation data to be written to the same file, if
necessary.