How to delay alerts using the check_ping command?
Posted: Wed Feb 27, 2019 4:20 pm
I'm a Nagios newbie looking for some help. I've inherited the management of a relatively old install of Nagios Core 3.4.4, and a collection of nodes that use the check_ping command for alert notifications. Ultimately, it would be great if these alerts would only fire if the condition has been true for 3 minutes. I'm having a hard time figuring out how use parameters such as the first_notification_delay to accomplish this, or if that's the best approach.
Each node's .cfg file has a "define host" and "define service" stanza set up like this:
I'm unsure if the values for the host and service are first inherited from /etc/nagios/objects/templates.cfg, and then are then overridden with the values given in each host's .cfg file. Either way, I've tinkered around with changing the values on max_check_attempts, retry_check_interval, etc, but I'm failing to understand the best way to make the ping alerts only fire if the condition has been true for 3 minutes.
I'd also like to preserve the email format that the alerts currently come through in, which has a nice "State Duration" field and other information.

If I change the values on the service notifications, such as setting "max_check_attempts" 3, the format instead changes to this:

I'm less concerned with this part, and would still be glad to get the notifications to delay to 3 minutes even if the email format changed. Thanks in advance for any guidance, especially on such an older version.
Each node's .cfg file has a "define host" and "define service" stanza set up like this:
Code: Select all
define host{
use generic-switch-comm
host_name Test
alias Test
address 192.168.40.155
hostgroups Test_Group
contact_groups Test_Contact
}
define service{
use generic-service
host_name Test
service_description PING
check_command check_ping!200.0,20%!600.0,60%
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
contact_groups Test_Contact
}I'd also like to preserve the email format that the alerts currently come through in, which has a nice "State Duration" field and other information.

If I change the values on the service notifications, such as setting "max_check_attempts" 3, the format instead changes to this:

I'm less concerned with this part, and would still be glad to get the notifications to delay to 3 minutes even if the email format changed. Thanks in advance for any guidance, especially on such an older version.
