Timepreiod question

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
sjordi
Posts: 10
Joined: Tue Jun 29, 2010 7:22 am
Location: Prangins, Switzerland
Contact:

Timepreiod question

Post 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?
Steve JORDI
Prangins, Switzerland
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Timepreiod question

Post 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 ?
sjordi
Posts: 10
Joined: Tue Jun 29, 2010 7:22 am
Location: Prangins, Switzerland
Contact:

Re: Timepreiod question

Post 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.
Steve JORDI
Prangins, Switzerland
sjordi
Posts: 10
Joined: Tue Jun 29, 2010 7:22 am
Location: Prangins, Switzerland
Contact:

Re: Timepreiod question

Post 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.
Steve JORDI
Prangins, Switzerland
sjordi
Posts: 10
Joined: Tue Jun 29, 2010 7:22 am
Location: Prangins, Switzerland
Contact:

Re: Timepreiod question

Post 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
Steve JORDI
Prangins, Switzerland
sjordi
Posts: 10
Joined: Tue Jun 29, 2010 7:22 am
Location: Prangins, Switzerland
Contact:

Re: Timepreiod question

Post by sjordi »

Ok doesn't work.
Now it fully ignores holidays no matter what, including 00:00-24:00
Ouch. this is just nonsense.
Steve JORDI
Prangins, Switzerland
Locked