[Nagiosplug-devel] check_ntp Bug

Michael Klöffer mkloeffer at tycoint.com
Wed Nov 27 04:16:02 CET 2002


Hi,

I just discovered a bug in check_ntp (not mainly, but...).

check_ntp uses ntpdc to detect time differences on a host.
When using ntpdc from a linux host against a OpenBSD timeserver you get
the error message:

nagios at nagioshost:/opt/nagios/libexec >check_ntp -H XX.XX.XX.XX

server XX.XX.XX.XX, stratum 2, offset -0.027646, delay 0.02621
ntperr = 0
27 Nov 13:06:05 ntpdate[16598]: adjust time server XX.XX.XX.XX offset
-0.027646 sec
ntperr = 0
***Server reports a format error in the received packet (shouldn't
happen)
UNKNOWN: Dispersion too high

So I tried this manually, et voila:

nagios at nagioshost:/opt/nagios/libexec >ntpdc -s XX.XX.XX.XX
***Server reports a format error in the received packet (shouldn't
happen)

But if you use ntpq :

nagios at nagioshost:/opt/nagios/libexec >ntpq -c pe XX.XX.XX.XX
     remote           refid      st t when poll reach   delay   offset
jitter
========================================================================
======
+128.4.1.2       .GPS.            1 u  643 1024  377  104.428   17.515
36.599
+131.188.3.220   192.53.103.103   2 u  610 1024  377   16.268   16.840
3.375
+131.188.3.221   .DCFp.           1 u  630 1024  377   15.468   14.051
4.126
+130.149.17.21   .PPS.            1 u  472 1024  167   18.038   16.909
31.578
*192.53.103.103  .PTB.            1 u  190 1024  377   15.691   16.180
4.176
+129.69.1.153    .DCFp.           1 u  190 1024  377    9.221   13.958
3.472
+192.53.103.104  .PTB.            1 u  615 1024  377   16.242   17.285
2.929
 LOCAL(0)        LOCAL(0)        10 l   50   64  377    0.000    0.000
0.004


I fixed this by hacking check_ntp to check_ntp2. If interested, diffs
are in the attachment.


Bye,

Michael.

__________________________
Michael Klöffer
Teamleiter Service Süd

CKS SYSTEME GmbH & Co. KG
tyco fire & security
Brauerstr. 50
76135 Karlsruhe

Telefon (0721) 2032-217
Telefax (0721) 2032-219
Mail mkloeffer at tycoint.com
WWW  www.cks-systeme.de
__________________________

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ntp.diff
Type: application/octet-stream
Size: 4357 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20021127/e25ad17c/attachment.obj>


More information about the Devel mailing list