Page 1 of 1

Timeperiod exclusion not working

Posted: Thu Jun 20, 2013 9:36 pm
by Fred Kroeger
Hi all
I am having problems with a timeperiod exclusion not working as expected.
I have setup a 24x7 timeperiod and another timeperiod with the times to be excluded.

Code: Select all

define timeperiod {
        timeperiod_name                         Non-Backup Periods
        alias                                   24x7 except during backups
        exclude                                 Backup Periods
        tuesday                                 00:00-24:00
        wednesday                               00:00-24:00
        thursday                                00:00-24:00
        friday                                  00:00-24:00
        saturday                                00:00-24:00
        sunday                                  00:00-24:00
        monday                                  00:00-24:00
        }


define timeperiod {
        timeperiod_name                         Backup Periods
        alias                                   Backup Periods
        wednesday                               18:00-24:00
        wednesday                               00:00-02:00
        tuesday                                 18:00-24:00
        tuesday                                 00:00-02:00
        monday                                  18:00-24:00
        monday                                  00:00-02:00
        thursday                                00:00-02:00
        thursday                                18:00-24:00
        friday                                  00:00-02:00
        friday                                  18:00-24:00
        saturday                                00:00-02:00
        saturday                                18:00-24:00
        sunday                                  00:00-02:00
        sunday                                  18:00-24:00
        }
I set my Service Notifications timeperiod with 'Non Backup Timeperiod" expecting that the exclude will stop any notifications during the "Backup Periods" - however it doesn't, I'm still getting notifications during the Backup Period times.
Researching this through my good friend google, I found another person with the same issue who posted the following in June last year:
Eventually I found my way into the Nagios Core bug database and found this entry. The resolution, added by user egalstad was:

Known issue. Exclude statement don’t work they way they were originally intended. No idea if a patch will be available. :-(
I'm running Nagios XI 2012R2.0 and this is definitely still an issue for me.

Regards... Fred

Re: Timeperiod exclusion not working

Posted: Fri Jun 21, 2013 10:13 am
by lmiltchev
You are correct - timeperiod exclusions don't work as they are supposed to, but this happens only if timeperiods have the same precedence. You can use exclusions if you are using "specific" periods (not in the "monday 00:00-02:00" format).

We are looking into this issue, but it's rather complicated, so I am not sure how soon this can (or if) be fixed.

Meanwhile, I would recommend not using exclusions in this particular case at all. You could simply modify your "Non-Backup Periods" timeperiod to be:

Code: Select all

monday     02:00-18:00
tuesday    02:00-18:00
wednesday  02:00-18:00
thursday   02:00-18:00
friday     02:00-18:00
saturday   02:00-18:00
sunday     02:00-24:00
Hope this helps.

Re: Timeperiod exclusion not working

Posted: Sun Jun 23, 2013 8:55 pm
by Fred Kroeger
Thanks - I had implemented your proposed solution as a work-around.
I guess it has just become a permanent solution.

Fred

Re: Timeperiod exclusion not working

Posted: Mon Jun 24, 2013 10:16 am
by lmiltchev
:)