Page 1 of 1

Nagios stays dormant when timeperiod starts!

Posted: Wed Jun 12, 2013 9:42 am
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.

Re: Nagios stays dormant when timeperiod starts!

Posted: Wed Jun 12, 2013 12:51 pm
by lmiltchev
Do you see the "Grid Load check" as scheduled in the Scheduling Queue?

Re: Nagios stays dormant when timeperiod starts!

Posted: Thu Jun 13, 2013 4:22 am
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.

Re: Nagios stays dormant when timeperiod starts!

Posted: Thu Jun 13, 2013 4:29 pm
by abrist
Is your XI server's time, date and timezone correct?
http://assets.nagios.com/downloads/nagi ... m_Time.pdf

Re: Nagios stays dormant when timeperiod starts!

Posted: Fri Jun 14, 2013 7:44 am
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.

Re: Nagios stays dormant when timeperiod starts!

Posted: Fri Jun 14, 2013 12:42 pm
by abrist
Great! locked.