Nagios stays dormant when timeperiod starts!

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
rvisalm
Posts: 3
Joined: Wed Jun 12, 2013 9:20 am

Nagios stays dormant when timeperiod starts!

Post by rvisalm »

Hello, Internet! Maybe you can give me a hand with an issue I keep getting on Nagios.

I have recently defined a custom time period for a certain service. It goes like this:

Code: Select all

define timeperiod{
        timeperiod_name GridLoad
        alias           grid is running
        sunday -1 march - sunday -1 october          12:59-18:20 ;BST
        sunday -1 october - sunday -1 march          11:59-17:20 ;Non-BST
}
and the service itself (together with its template) is:

Code: Select all

define service{
 use                     generic-service
 name                    SelfCheckServiceGridLoad
 servicegroups           SelfCheckServiceGrp
 hostgroup_name          NagiosServerGrp
 check_period            GridLoad  ; The service can only be checked when we expect the grid to start
 max_check_attempts      5         ; Re-check the service up to 5 times in order to determine its final (hard) state
 normal_check_interval   1         ; Check the service every minute under normal conditions
 retry_check_interval    1         ; Re-check the service every minute until a hard state can be determined
 contact_groups          admins    ; Notifications get sent out to everyone in the 'admins' group
 notification_options    w,u,c,r   ; Send notifications about warning, unknown, critical, and recovery events
 notification_interval   60        ; Re-notify about service problems every hour
 notification_period     GridLoad      ; Notifications can be sent out only during the period
 notifications_enabled   1         ; Service notifications are enabled
 register                0         ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Code: Select all

define service{
 use                     SelfCheckServiceGridLoad
 service_description     Grid Load check
 check_command           check_grid_load
}
My problem is, if I "start" the notifications manually (namely, if I perform a manual check and we're in the right time period), Nagios "wakes up" and starts re-checking correctly on time until it is time for blackout.

When the next day comes in and we enter the period again, however, it doesn't restart checking again as it should. It seems to be "over-sleeping", if you excuse my dream metaphors :mrgreen:

Is this behaviour expected? Have i overlooked anything? All help will be much appreciated.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios stays dormant when timeperiod starts!

Post by lmiltchev »

Do you see the "Grid Load check" as scheduled in the Scheduling Queue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
rvisalm
Posts: 3
Joined: Wed Jun 12, 2013 9:20 am

Re: Nagios stays dormant when timeperiod starts!

Post by rvisalm »

Hello and thanks for your help.
lmiltchev wrote:Do you see the "Grid Load check" as scheduled in the Scheduling Queue?
It does, but it shows a crazy time for the next check.

ie. 10-27-2013 10:59:00 (after checking Scheduling Queue today, 13-06-2013 10:20:00)

Needless to say, it appears in the last position of the queue.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios stays dormant when timeperiod starts!

Post by abrist »

Is your XI server's time, date and timezone correct?
http://assets.nagios.com/downloads/nagi ... m_Time.pdf
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rvisalm
Posts: 3
Joined: Wed Jun 12, 2013 9:20 am

Re: Nagios stays dormant when timeperiod starts!

Post by rvisalm »

It's solved now!

What I did was, I manually forced a check on the service, and then, the next scheduled checks work like a dream!

My theory is that Nagios only re-schedules future checks for a service at the moment of a current check of that service. So it doesn't automatically re-schedule as I expected. Hence, you have to force check it once manually for Nagios to "notice" that something's changed in the timeperiods.cfg file. A bit of a rookie mistake, Isn't it?

Anyway, thank you very much for your help guys, and I hope this post can be useful for anyone.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios stays dormant when timeperiod starts!

Post by abrist »

Great! locked.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked