~vultaire/charm-nagios:lp1906321-email-limit

Last commit made on 2022-01-25
Get this branch:
git clone -b lp1906321-email-limit 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-email-limit
Repository:
lp:~vultaire/charm-nagios

Recent commits

81b0ffe... by Paul Goins

More black/lint fixes

de233bd... by Paul Goins

Allow for limiting email notifications

By setting email_max_notifications to a positive value, email
notifications will be sent only up to N times per alert, after which
no more mails will be sent.

This is intended to be used in conjunction with a non-zero
notification_interval, allowing for alerts to re-notify but without
sending emails on each re-notification.

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.