Page 1 of 1

Elegant way to define day overlapping time periods

Posted: Wed Jun 18, 2014 3:46 am
by mmaedler
Hi there,

we are running a couple of linux servers that have a fixed time period where a maintenance task is performed that causes a high cpu load and triggers nagios to send out alerts. We now want to exclude this time period from the notifications so we defined an exclusion time period for this. Unfortunately the time period overlaps two days (it starts from mon-fri on 23:50 and runs until ~ 00:15). Is there an elegant way to define this, or do we have to do something like this:

Code: Select all

define timeperiod {
  name maintain
  timeperiod_name maintain
  monday 23:50-23:59
  tuesday 00:00-00:15,23:50-23:59
  wednesday 00:00-00:15,23:50-23:59
  thursday 00:00-00:15,23:50-23:59
  friday 00:00-00:15,23:50-23:59
  saturday 00:00-00:15
}


Thanks a lot!

Re: Elegant way to define day overlapping time periods

Posted: Wed Jun 18, 2014 11:50 am
by tmcdonald
That is the way it should be done. However, please note that according to the Timeperiod definition doc you might want to use 24:00 instead of 23:59. I am not familiar with how Nagios processes this internally, but sticking to the documented method is usually a good idea.