aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-02-04 11:06:39 -0500
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-02-04 11:06:39 -0500
commit74f84ed897950289a99f0c11a35220a55590a9a0 (patch)
treed4444779ee6cee35b0bcc0f9e904afc9639af40c
parent3c213bcf5ce6b203716ffe864a8bcda09f4fd2bf (diff)
downloadselfhosted-74f84ed897950289a99f0c11a35220a55590a9a0.tar.gz
selfhosted-74f84ed897950289a99f0c11a35220a55590a9a0.zip
don't perform nagios checks during reboot window
Intially, I configured nagios to suspend notifications during the reboot window, to avoid alert noise while hosts were doing automated reboots. Since our nagios only sends a single notification for state changes, this results in lost alerts when a "real" problem occurs during the window. This commit switches the default host template to suspend the checks themselves, rather than the notifications, during the daily reboot window. If the problem still exists once the reboot window passes, we'll get the notification.
-rw-r--r--roles/nagios_server/templates/etc/nagios/objects/hosts.cfg.j22
-rw-r--r--roles/nagios_server/templates/etc/nagios/objects/templates.cfg.j24
2 files changed, 3 insertions, 3 deletions
diff --git a/roles/nagios_server/templates/etc/nagios/objects/hosts.cfg.j2 b/roles/nagios_server/templates/etc/nagios/objects/hosts.cfg.j2
index 3e8d72f..cacf032 100644
--- a/roles/nagios_server/templates/etc/nagios/objects/hosts.cfg.j2
+++ b/roles/nagios_server/templates/etc/nagios/objects/hosts.cfg.j2
@@ -4,7 +4,7 @@ define host {
address 127.0.0.1
use generic-host
check_command check_dummy
- notification_period 24x7
+ check_period 24x7
_fqdn {{ ansible_fqdn }}
_snmp_user {{ hostvars[inventory_hostname].nagios_snmp_user }}
_snmp_priv_pass {{ hostvars[inventory_hostname].nagios_snmp_priv_pass }}
diff --git a/roles/nagios_server/templates/etc/nagios/objects/templates.cfg.j2 b/roles/nagios_server/templates/etc/nagios/objects/templates.cfg.j2
index 4f9d306..42a7fed 100644
--- a/roles/nagios_server/templates/etc/nagios/objects/templates.cfg.j2
+++ b/roles/nagios_server/templates/etc/nagios/objects/templates.cfg.j2
@@ -17,11 +17,11 @@ define host {
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
- notification_period 24x7-except-reboot-window
+ notification_period 24x7
notification_interval 0
notification_options d,u,r,f
first_notification_delay 0
- check_period 24x7
+ check_period 24x7-except-reboot-window
check_interval 5
retry_interval 1
max_check_attempts 3