[Nagiosplug-devel] progress with check_ntp.c

sean finney seanius at seanius.net
Tue Apr 11 23:41:01 CEST 2006


good morning!

in the wee hours of the morning i committed an updated version of
check_ntp.c, which now has the ability to do jitter checks as well
as offset checks.  i'd like to thank bill moran for doing the legwork
on the details.

at this point check_ntp is nearing a state where i think it would be
useful for general testing and availability.  there are only three
items left on my todo list:

- improve the error checking on the protocol level for the both
  jitter and offset checks.
- make sure the offset checks are in fact calculating the
  right number (i think they're still off a bit)
- further changes to offset calculation to make behaviour/performance
  like that of ntpdate.

to explain the last item... a large part of the debugging process in
making this plugin is to compare the network traffic created by
this plugin vs that of ntpdate+ntpq in check_ntp.pl.  

for the jitter calculation, the data being sent across the wire is packet
for packet identical, with the exception that bill has found a way to
reduce the amount of needed response traffic by instructing the remote
peer to only provide the jitter information (instead of all information,
which ntpq does, which doubles the number of response packets).

for the offset calculation, there's still a pretty clear difference.
currently, the offset check in check_ntp.c does something like the
following:

for i = 1...4
	my_udp_connect(server)
	avg_offset+=do_offset_check
	close(connection)
done
avg_offset/=4

but ntpdate's behaviour (and thus that of check_ntp) is to resolve a
hostname via getaddrinfo to a list of struct addrinfo's, and then do the
above for *each* address.  it also uses an optimized routine involving
poll(), and only uses the "top 5" servers from the above list in the
final calculation.

i suppose we should do something similar to this to ensure
feature/behaviour compatibility.  just now i've committed a
yet newer version of check_ntp.c which has a very primative
attempt at doing some of this, though you'll have to
modify the code to use this new function (offset_request_ntpdate)
instead of the standard one (offset_request).  there's no
use of poll(), and no selection of the "top 5", but it will
probably still work if you have a decent connection.

so at this point, further offers of help/opinion are
appreciated.  i'll be travelling to the north of sweden on
thursday for a week, so don't expect much to get done by me
between now and then.

anyway, sorry for the long-winded email...
	sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://nagios-plugins.org/archive/devel/attachments/20060411/c19154fd/attachment.sig>


More information about the Devel mailing list