Page 1 of 1

Timepreiod question

Posted: Wed Sep 22, 2010 8:13 am
by sjordi
Hi,
I tried to implement a timeperiod section in order to introduce holiday dates into our Nagios monitoring, hoping it would avoid sending notifications during the specified days.
Unfortunatelly, it doesn't monitor anything at all anymore.

I can't figure out why, so I guess it's a matter of precedence?
Here is what I have

Code: Select all

define timeperiod{
        name            normalhours
        timeperiod_name normal hours
        alias           normalhours
        monday          06:00-19:00
        tuesday         06:00-19:00
        wednesday       06:00-19:00
        thursday        06:00-19:00
        friday          06:00-19:00
        }

define timeperiod {
        name                    holidays
        timeperiod_name         holidays
        alias                   holidays

        january 1               00:00-24:00    
        april 2                 00:00-24:00     
        april 5                 00:00-24:00     
        may 13                  00:00-24:00   
        may 24                  00:00-24:00   
        august 1                00:00-24:00   
        august 2                00:00-24:00   
       september 9              00:00-24:00 
        december 24             00:00-24:00 
        december 25             00:00-24:00 
        }


define timeperiod{
        timeperiod_name hours_sans_holidays
        alias           Hours without the holidays

        use             normalhours
         exclude        holidays          ; Get holiday exceptions from other timeperiod
        }
Nagios fully stalled on September 9, the first time it hit one of the holiday time period.
In hours_sans_holidays, I tried several things, like use and exclude, but still, I have to comment the holidays line in order to have Nagios monitor again.

I thought normalhours would be time periods when to check, and holidays when to suspend checking.
Any idea why?

Re: Timepreiod question

Posted: Wed Sep 22, 2010 10:00 am
by mguthrie
Did you get any error messages when you ran your configuration verification? It's probably a syntax issue, although I' m not able to spot it at the moment.

Have you tried "use" holidays, and setting the times for those days as 00:00-00:00 ?

Re: Timepreiod question

Posted: Wed Sep 22, 2010 10:41 am
by sjordi
Hi,
no syntax error.
Yes, I have also put "use" instead of "exclude", and everything ran smoothly until it hit Sept 9 and then got stuck there.
Until I removed the holiday timeperiod, it didn't check anything but everything was green.
I removed the line about the holiday and it started to work back.

Re: Timepreiod question

Posted: Thu Sep 23, 2010 5:54 am
by sjordi
Ok I tried use and set all time periods for those days at 00:00-00:00 and again, Nagios doesn't check anything at all anymore.
This is weird.
I don't udnerstand why. I checked the documentation, they talk about precedence of instructions but finally no real examples are given.
Oh well, I guess I will remove those holidays.

Re: Timepreiod question

Posted: Thu Sep 23, 2010 6:11 am
by sjordi
Well,
it looks like it's back to monitoring.

Used

Code: Select all

        use             swiss-holidays          ; Get holiday exceptions from other timeperiod
        use             vdghours
with

Code: Select all

        00:00-00:00  
and everything is fine.
I'll just try adding today as a holiday to see whether it stops monitoring or not. :D

Re: Timepreiod question

Posted: Thu Sep 23, 2010 6:17 am
by sjordi
Ok doesn't work.
Now it fully ignores holidays no matter what, including 00:00-24:00
Ouch. this is just nonsense.