~vultaire/charm-nagios:lp1906321-notification-interval

Last commit made on 2022-01-25
Get this branch:
git clone -b lp1906321-notification-interval https://git.launchpad.net/~vultaire/charm-nagios
Only Paul Goins can upload to this branch. If you are Paul Goins please log in for upload directions.

Branch merges

Branch information

Name:
lp1906321-notification-interval
Repository:
lp:~vultaire/charm-nagios

Recent commits

50d518f... by Paul Goins

Lint fix

4056750... by Paul Goins

Allow for tuning of notification interval

Notification interval is handled at the level of the base
generic-service and generic-host objects. generic-service and
generic-host are not defined by the charm, but rather by the installed
nagios3 package. This patch uses PyNag to tweak those values, similar
to how the update_localhost function works for tweaking the localhost
host object.

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>