[Nagiosplug-help] check_ntp

Thomas Guyot-Sionnest dermoth at aei.ca
Sat Nov 10 06:10:31 CET 2007


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

adding -devel to make sure it gets attention...

On 06/11/07 10:38 AM, Andreas Ericsson wrote:
> Richard Mohr wrote:
>> On Mon, 2007-11-05 at 14:13 -0500, jmacaranas at fxdd.com wrote:
>>
>>> Where does check_ntp gets the offset? How does it compute the value?  
>> I suppose the first question to ask is if you are using the C or perl
>> version of check_ntp?
>>
>> Looking at the perl plugin, it seems that check_ntp gets the offset by
>> running "ntpdate -q host1".  I looked at the C version, and it seems
>> that it might be doing something similar (although it computes the
>> offset itself rather than calling ntpdate).
>>
>>> Doing an check_ntp –H host1 shows an offset which is different to the
>>> offset result of ntpdc –p host1
>> That would make sense.  If I remember correctly, ntpdc will tell you how
>> much the remote server is offset from the peers it syncs with.  Running
>> ntpdate shows the offset between the remote host and host you run the
>> ntpdate command from.
>>
>> Hmmm.  If my explanation is correct, then in my mind check_ntp is
>> measuring the wrong offset.  I only care about how much the remote
>> server differs from its peers, not how much it differs from my Nagios
>> server.  Or maybe the plugin is measuring exactly what it intended, and
>> it simply failed to explain what it meant by "offset".
>>
> 
> Both would be useful values, imo. I imagine the peer offset is harder to
> both obtain and display though, so it would be no great wonder if the
> implementation started off with the "host vs server" offset.

check_ntp gets the offset between the local clock the the peer, which is
good to check if the local server is sync with the remote server, but
not to check if the remote server is sync with its peers.

This can easily be changed; the question is do we actually want that?
(I'm personally all for it...)

People that want a simpler time check can run check_time to any time
server that support the simple Time protocol (The NIST runs some).
However it lacks precision:

$ plugins/check_time -H solaris.beaubien.net
TIME OK - 0 second time difference|time=0s;;;0 offset=0s;;;0

I guess I can easily fix that :)

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNT1H6dZ+Kt5BchYRAr/hAKCvxOeFBrVrCX1YcqVFjJn7tNCFqACeNvSh
S+Y1xHHNPcF3iQeJ8/nv7aI=
=ow+I
-----END PGP SIGNATURE-----




More information about the Help mailing list