From 74f84ed897950289a99f0c11a35220a55590a9a0 Mon Sep 17 00:00:00 2001 From: Stonewall Jackson Date: Sat, 4 Feb 2023 11:06:39 -0500 Subject: 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. --- roles/nagios_server/templates/etc/nagios/objects/hosts.cfg.j2 | 2 +- roles/nagios_server/templates/etc/nagios/objects/templates.cfg.j2 | 4 ++-- 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 -- cgit