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: [EMAIL PROTECTED] [mailto:nagios-users- > [EMAIL PROTECTED] On Behalf Of Ben Beuchler > Sent: Tuesday, December 20, 2005 2:09 PM > To: nagios-users@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 [EMAIL PROTECTED] > pager ben > } > > define contact{ > use emailOnly > contact_name benEmail > alias Ben Beuchler > email [EMAIL PROTECTED] > } > > 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@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@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