Nagios Email Notification Frequency or Interval

Question:

How do I configure how often Nagios emails notifications about problems.

Solution:

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
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Fabio Milano has written 79 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.

4 Comments so far

  1. marcus on April 10th, 2011

    check if you have is_volatile set to 0
    if not then set it to zero and your notification interval will kick in and start working.

  2. Hahnefeld on May 20th, 2011

    I have Ubuntu 10.04 LTS and modified the command.cfg because of postfix. But I did not receive any notify. What goes wrong?

  3. dp on November 5th, 2011

    The
    define host {
    notification_interval 120

    Does this notification get voided if the host comes back online? Meaning if the host goes down and you get notified, do you have to wait another 120 minutes to get another notification if the host comes back up before then?

  4. Brazen on December 29th, 2011

    @dp: when the host comes back online, you are notified as soon as the next status check detects it is back online. State change notifications are sent out immediately, the notification_interval is only for repeat notifications.

Leave a reply