check_ntp

Karl DeBisschop karl at debisschop.net
Tue Jun 15 13:19:30 CEST 2004


Leif Nixon wrote:
> "Paul L. Allen" <pla at softflare.com> writes:
> 
> 
>>Yes, I know that 0 is
>>leass than 60, but you would get OK for 0.1s, 0.01s, 0.001s,
>>0.0001s... 0s is special-cased.  The code assumes that an offset of 0s
>>is bogus
>>because it assumes that nobody is running a stratum 0 server.
> 
> 
> I have stared at that line of code several times without understanding
> it. Why would an offset of 0 be bogus? It just means that ntpd
> estimates that the local clock currently is off by less than 0.0005
> milliseconds (or something like that), which is not an infrequent
> occurence on my systems. The estimated offset varies continuously, and
> sometimes just happens to hit 0.000 ms.
> 
> I'm using a replacement plugin which simply checks the output from
> "ntpq -c peers <HOST>" and returns CRITICAL on connection refused and
> WARNING if ntpd isn't currently synced somewhere.
> 
> Basically, we trust ntpd to do its job. If it says it is synced we
> believe it keeps the local system time from drifting. The logic here
> is that if we *don't* trust ntpd, there is little point in trusting it
> to report correct offset and jitter values either.
> 

Two short points:

1) the original concept goes back some, but if memory serves I put it in 
and I put it in to trap a real error, not just because I didn't like 0. 
Again, only by memory, it might be that if localhost was listed as a 
stratum 10 server, and the higher strata servers failed, you would 
eventually get a 0 offset because uor were checking you local clock 
against your local clock - in other words, 0 indicated a loss of 
connection to higher strata servers.

2) A lot has chnged since then - we use different utilities to connect 
to NTP that are more informative than when that code was written and NTP 
itself is more mature. We clearly should go back and revist that section 
of code.

-- 
Karl


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list