Friday, December 16, 2011

Nagios Email Notification Frequency or Interval

SkyHi @ Friday, December 16, 2011
How do I configure how often Nagios emails notifications about problems.
The notification interval setting for service and hosts allows you to configure when email notifications get sent by Nagios

Nagios Notifications

Before Nagios sends out a notification the program runs a series of filters.
1. Are notifications enabled ?
2. Scheduled Downtime for Host/Service ?
3. Is service Flapping ?
4. Notification Period (Is Nagios allowed to send notifications at this time ?)
Some techs dont want their cellphone pinging at 4 am with a new email alert :)
5. Notification Interval ( check and make sure the time that has passed since the last notification went out either meets or exceeds )

Nagios Notification Interval

The notification interval filter requires two previous check to be met first.
1. A notification was already sent out about the problem
2. the host/service has remained in an not OK state since the last notification went out
Configure Nagios Notification Interval Setting
The setting for notification interval can be defined within the host definition section of the configuration files.
The easiest way to modify this setting is to modify the main generic-host template “template.cfg” found in
# cd /user/local/nagios/etc/objects/
Edit the file “template.cfg”
# vi /user/local/nagios/etc/objects/template.cfg
Find the line (** The below line will show for each type of host defined in the template **)
define host {

notification_interval     120       ; Resend notification every 2 hours

Change “120″ to match how minutes you want to wait before receiving additional notifications
Save your changes
Next, verify your Nagios configuration files and restart Nagios.
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

# service nagios restart