Check becomes unplanned
Bernd Arnold
bernd_a at gmx.de
Tue Sep 9 20:08:35 CEST 2008
Hi everyone,
I don't know whether this is a bug or not. And maybe you'll never be affected by this. I believe this only happens when you are using time periods for service (or host) checks and an external program corrects the time backwards. The service check will no longer be executed. This happened in our environment three times already. The bad thing: you never realize that there is an unplanned service. The service state resides at the last check result.
We're having service checks only occurring nightly. During the day, the time was corrected by ntp. Nagios realized the time change (see message below). The next check time is corrected for these services, but in the evening, when the check should occur, the service becomes unplanned. The service check stays unplanned until the nagios configuration is reloaded or the service is re-scheduled manually.
Did anyone experience this behavior already? Please let me know if you need further information.
Regards
Bernd
These are the steps how you can re-create it:
Edit localhost.cfg and add a service entry:
define service{
use local-service
host_name localhost
service_description Testping
check_command check_ping!100.0,20%!500.0,60%
}
Reload the nagios configuration (/etc/init.d/nagios reload).
Re-schedule the next check of this service, so we get the result immediately.
I've got these values:
Last Check Time: 09-09-2008 19:29:54
Next Scheduled Check: 09-09-2008 19:34:54
Add a timeperiod. The important line is the line with the current weekday (tuesday). Set the start of the next period to a time in the future (I've added about eight minutes, so I've got 19:40):
define timeperiod {
timeperiod_name test_timeperiod
alias Test Timeperiod
sunday 00:00-06:00,18:00-24:00
monday 00:00-06:00,18:00-24:00
tuesday 00:00-06:00,19:40-24:00
wednesday 00:00-06:00,21:00-24:00
thursday 00:00-06:00,22:00-24:00
friday 00:00-06:00,18:00-24:00
saturday 00:00-06:00,18:00-24:00
}
Modify the service "Testping" and add
check_period test_timeperiod
Reload the nagios configuration (/etc/init.d/nagios reload).
The webinterface tells me the same next check time:
Next Scheduled Check: 09-09-2008 19:34:54
Passing 19:34:54, the next check time is updated to the time I've set in the time period:
Next Scheduled Check: 09-09-2008 19:40:00
Now I "correct" the current time (this could also happen when ntdp is running):
root at u02:~# date
Di 9. Sep 19:37:31 CEST 2008
root at u02:~# date -s 19:36
Di 9. Sep 19:36:00 CEST 2008
The Nagios event log tells me:
[09-09-2008 19:36:04] Warning: A system time change of 0d 0h 1m 37s (backwards in time) has been detected. Compensating...
The next check time is then:
Next Scheduled Check: 09-09-2008 19:38:23
Passing 19:38:23, the check is set to unplanned:
Next Scheduled Check: N/A
--
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
More information about the Developers
mailing list