check_ntp -- need a little bit help

Jonathan Rozes jrozes at vinton.com
Wed Nov 6 17:51:20 CET 2002


Yeah, I did the same thing, plus a little extra. My changes:

Search for ntpq/xntpq instead of ntpdc/xntpdc in configure
Added options -j and -k to specify the thresholds for issuing warning and
critical states for jitter.
Change all time references from seconds to milliseconds since that's what
we're dealing with.
Invoke ntpq with the -n flag to avoid DNS lookups (the call to ntpdc did not
do this).
Kill child processes in sigalarm handler (a problem I've noticed with other
plugins).

I can't generate a clean patch at this moment though, as my source tree is
filled with other changes I made in order to make things work to my
satisfaction under OpenBSD. If there's enough interest, I'll try to put a
patch together later this week.

As to the question of how to deal with jitter from multiple time sources,
you want to check all of them, or at least the ones prefixed with '+', '#',
'*' or 'o'. Time offset simply tells you how close your clock is to real
time as determined by the clock discipline algorithm. Jitter tells you how
much your clock is deviating from the source clock. If jitter is high, it is
difficult to keep the clock synchronized and the time source may not be
reliable. Whether you want to issue a critical condition with just one or
all sources having high jitter is a matter of preference and/or local policy
though.

jonathan

+++ Jonathan Rozes, Manager, Information Technology, Will Vinton Studios


> -----Original Message-----
> From: Schimpke, Dr. Thomas / bhn [mailto:Schimpke at Lenze.de]
> Sent: Wednesday, November 06, 2002 4:46 AM
> To: 'nagios-users at lists.sourceforge.net'
> Subject: [Nagios-users] check_ntp -- need a little bit help
> 
> 
> Hi all,
> 
> I've a couple of ntp servers/clients running. I wanted to 
> check them with
> check_ntp, but got (almost always) the message "UNKNOWN: 
> Dispersion too
> high". The dispersion is hard coded in the plugin to 15 (ms), 
> the actual
> dispersion was much below. I was a little bit curios about 
> this issue, so I
> looked at the source code and found, that check_ntp basically 
> parses the
> output of the command xntpdc/ntpdc -s. Running "xntpdc -s 
> hostname" resulted
> in an error message: "*** Server reports a format error in 
> the received
> packet (shouldn't happen)". 
> 
> According to Dave Mills (see google...) there is *no 
> gurantee* that xntpdc
> is interoperable between two releases of the ntp package. He 
> recommands
> useing ntpq instead (xntpdc seems to exist mainly for 
> debugging purposes). 
> 
> I've patched the plugin to use ntpq (basically I run ntpq -p, 
> the dispersion
> is reported in the 10th field). This seems to work fine (if someone is
> intrested in a patch, drop me a note). The problem is, which 
> peer to take
> from the output (you normally have several peers on a 
> server/client running
> the ntp process). This  is not a ntpq issue -- you have the 
> same problem, if
> you use xntpdc: you get a list of peers. If you do nothing 
> about it, you get
> the dispersion of the last peer reported in the list (not 
> good), in my case
> it's the LOCAL peer, which is unintresting. Instead the list should be
> processed according to the tally codes (the value in the 
> first column of the
> list). But even then: do I take the sys.peer/pps.peer or the 
> mean value of
> all peers used in the combine algorithm...
> 
> I'm not even sure, if the dispersion is a good measure of the 
> ntp "state"
> for ntp configured as a client on a local network. The 
> "offset" of the clock
> sems to be more appropriate, but I'm not a ntp specialist.
> 
> Any comments ?
> 
> Greetings,
> 
> Thomas
>  
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: See the NEW Palm 
> Tungsten T handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en




More information about the Users mailing list