[Nagios-users] Set notification periods for services from host entry?

chris burgess xurizaemon at gmail.com
Wed Dec 8 20:41:26 UTC 2010


Using Nagios3 on Debian 5.0.7, hoping to disable notifications for a couple
of hosts which experience downtime (or, poor response times from my
monitoring host) during morning backups.

Have created a timeperiod to black out the backup period, and set the
notification_period on the relevant host entries. But still receiving
service alerts on the host's services.

Is there a way to override the service notification period by setting it in
the hosts entries? (this is what I expected to do, but it seems the service
takes precedence)
Is it required to configure a separate service (eg: http,
http-except-backups; smtp, smtp-except-backups) for the services?
Should this service extend the existing http service with "use"?

Suggestions on better ways to handle this welcome too - permitting slower
response times during the backup periods would be a good solution, as we'd
still get notified if the server *actually* fell over.

Hopefully these excerpts give all the relevant details of what I'm trying -
have left out anything which is stock (eg generic-host config which is
unchanged from OS default, 24x7 definitions etc). Aim is to receive
notifications for bar 24x7 and foo only during silent_backups.

Thanks!

# /etc/nagios3/conf.d/timeperiods_nagios2.cfg contains this
define timeperiod {
timeperiod_name silent_backups
alias 24x7 with exclusion for daily backups
        sunday          00:00-05:30,07:00-24:00
        monday          00:00-05:30,07:00-24:00
        tuesday         00:00-05:30,07:00-24:00
        wednesday       00:00-05:30,07:00-24:00
        thursday        00:00-05:30,07:00-24:00
        friday          00:00-05:30,07:00-24:00
saturday 00:00-05:30,07:00-24:00
}

# /etc/nagios3/conf.d/hosts.cfg contains this
define host {
  use generic-host;
  host_name foo;
  address foo.example.org;
  check_period silent_backups;
}
define host {
  use generic-host;
  host_name bar;
  address bar.example.org;
  check_period 24x7;
}

# /etc/nagios3/conf.d/services_nagios2.cfg
define service {
        hostgroup_name                  smtp-servers
        service_description             SMTP
  check_command                   check_smtp
        use                             generic-service
notification_interval           0 ; set > 0 if you want to be renotified
}
define service {
        hostgroup_name                  http-servers
        service_description             HTTP
  check_command                   check_http
        use                             generic-service
notification_interval           0 ; set > 0 if you want to be renotified
}

# /etc/nagios3/conf.d/hostgroups_nagios2.cfg
# A list of your web servers
define hostgroup {
        hostgroup_name  http-servers
        alias           HTTP servers
        members         foo, bar
}
define hostgroup {
        hostgroup_name  smtp-servers
        alias           SMTP servers
        members         foo, bar
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nagios.com/pipermail/nagios-users/attachments/20101209/6ec78af5/attachment.html>


More information about the Nagios-users mailing list