Limit the number of Nagios alarms with escalations
After the integration of the fetion, if the problem can not be solved, then the consequences will be very "cup", every five minutes you will receive an alarm message, your mailbox will be filled with alarm mail. Nagios official also thought of this problem, so they gave the solution, http://nagios.sourceforge.net/docs/3_0/escalations.html, here is the official note, the following is my approach.
First edit the Contact.cfg, copy the original configuration in the following, into:
Define Contact{
Contact_Name Nagiosadmin
Use Generic-contact
Alias Nagios Admin
email [email protected];
Service_notification_commands notify-service-by-email,service-notify-by-fetion
Host_notification_commands notify-host-by-email,host-notify-by-fetion
Pager 13691515****
}
Define Contactgroup{
Contactgroup_name Admins
Alias Nagios Administrators
Members Nagiosadmin
}
Define Contact{
Contact_Name SCOMD
Use Generic-contact
Alias Nagios Admin
email [email protected]
Service_notification_commands Notify-service-by-email
Host_notification_commands Notify-host-by-email
Pager 13691515****
}
Define Contactgroup{
Contactgroup_name sysadmin
Alias sysadmin
Members SCOMD
}
Then create a configuration file: Escalations.cfg
#vi/usr/local/nagios/etc/objects/escalations.cfg
Add the following content:
Define Serviceescalation{
host_name scomd.com; Monitored host names, multiple separated by commas
First_notification 4; 4th message, change the frequency interval
Last_notification 0; From the nth information, the recovery frequency interval
Notification_interval 30; Notification interval (units: minutes)
Contact_groups sysadmin
}
Define Serviceescalation{
host_name scomd.com; Monitored host name
service_description PING; Monitored service name, multiple separated by commas
First_notification 4
Last_notification 0
Notification_interval 30
Contact_groups sysadmin
}
Finally, edit the Nagios.cfg file
#vi/usr/local/nagios/etc/nagios.cfg
Add to:
Cfg_file=/usr/local/nagios/etc/objects/escalations.cfg
Check that the Nagios configuration file is correct
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
Restart the Nagios service if you have no problem.
Service Nagios Restart
Limit the number of Nagios alarms