Different notification methods in different timeperiods

Lori Adams ladams at cloudmark.com
Wed Dec 21 05:20:18 CET 2005


I don't think you'll be able to do this within the configs.  What you
could do though is write a little wrapper script. Based on the time of
day, a different $CONTACTGROUP$ would be notified.  

This will keep your config cleaner, but add a level of complexity.  

-Lori


> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Ben Beuchler
> Sent: Tuesday, December 20, 2005 2:09 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Different notification methods in different
> timeperiods
> 
> I am trying to work out a clean way to use different techniques during
> different notification_periods (one notification technique during
> "workhours" and another during "nonworkhours") for the same service.
> 
> I already created duplicates of each contact with the new contact
method:
> 
> define contact{
>         use                             tapPager
>         contact_name          ben
>         alias                           Ben Beuchler
>         email                          ben_beuchler at mcad.edu
>         pager                         ben
>         }
> 
> define contact{
>         use                             emailOnly
>         contact_name          benEmail
>         alias                           Ben Beuchler
>         email                          ben_beuchler at mcad.edu
>         }
> 
> For each contact_group, I also created a second contact group that
> just contains the "emailOnly" versions of the contacts.
> 
> The confusing part is how to assign these contact_groups to services.
> I tried sub-classing the service, changing only the
> notification_period and contact_groups:
> 
> define service{
>         use                               generic-service
>         name                           ntpSvc
>         service_description  NTP
>         check_command      check_ntp
>         notification_period   workhours
>         host_name                 swizzle,swozzle
>         }
> 
> define service{
>        use                                ntpSvc
>        notification_period     nonworkhours
>        contact_groups           networkAdminEmail
>        }
> 
> But that, of course, results in this error:
> 
> Error: Service 'NTP' on host 'swizzle' has already been defined
> 
> Clearly, I could include a second service_description, but that would
> really clutter up Nagios.  Not to mention testing each service twice
> as often.
> 
> Is there a better way to do this?
> 
> Thanks!
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=ick
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list