Antwort: Re: Check becomes unplanned

Thomas Guyot-Sionnest thomas at zango.com
Thu Sep 11 20:53:18 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sascha.Runschke at gfkl.com wrote:
> 
> Hi Bernd,
> hi Andreas,
> 
> What happens:
> 
> 1. it's 11pm, nagios schedules freaky_check for 7am according to its
> check_period
> 2. Every X minutes timeshift -1 sec (jittering timesource)
> 3. nagios tries to compensate it and adjusts _all_ checks to the
> timeshift (next_check = next_check - timeshift)
> 4. time goes by from 11pm to 6am, shifting time for - let's say - 8
> minutes back
> 5. freaky_check is now scheduled for 6:52am because of the timeshifts
> 6. it's 6:52am and nagios tries to run the freaky_check according to the
> schedule
> 7. sanity check says: ERROR: check outside check_period
> 8. nagios tries to compensate with a strange logic: next_check =
> next_check + check_interval and just hopes it will fit
> 9. nagios reruns the sanity check: FATAL ERROR: check still outside
> check_period - I have no clue what to do: rescheduling freaky_check:
> next_check = next_check + 1year
> 10. user puzzled and nagios thinks it's all cool

So although this is a bug, I wouldn't expect Nagios to work very well
with time shifts and there's many other applications/daemons out there
that could fail as well. You shouldn't have to constantly re-adjust the
clock - if you do then there might me a bigger problem...

Have you tried running an ntp daemon? It should try keeping the clock
sync without causing time shifts (as Andreas explained, it slows down or
speed up the clock instead). What OS is it on? under a VM? custom
compiled kernel? There might be something broken or unsupported in your
setup that causes this. If you don't fix it you shouldn't expect your
system to work very well anyway.

One thing that might help is setting this to 1 in your nagios.cfg. This
will make Nagios periodically check for services that aren't scheduled:

check_for_orphaned_services=1

Besides, to fix this I would make the sanity check reschedule the check
for the end of the check period (possibly only if it's not scheduled
already), as it wouldn't have to check for this condition for every
service on every time shift.

I might have a deeper look of no one beats me at it :)

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIyWke6dZ+Kt5BchYRAhs8AKC1PW1Qj7pa/lzkN4f0zUTpl9hnvgCgoQu7
wAXsXNNCW8VnzGUsZVGdLB4=
=1hIV
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
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