Elegant way to define day overlapping time periods

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mmaedler
Posts: 1
Joined: Wed Jun 18, 2014 3:23 am

Elegant way to define day overlapping time periods

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Elegant way to define day overlapping time periods

Post 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.
Former Nagios employee
Locked