[Nagiosplug-devel] [ nagiosplug-Feature Requests-1159317 ] Patch for check_ntp to work with zero offsets

SourceForge.net noreply at sourceforge.net
Tue Mar 8 11:56:07 CET 2005


Feature Requests item #1159317, was opened at 2005-03-08 11:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397600&aid=1159317&group_id=29880

Category: None
Group: None
Status: Open
Priority: 5
Submitted By: W Sanders (wsanders1)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for check_ntp to work with zero offsets

Initial Comment:
In some (mine) LANS with "perfectly" synchronized
clocks the offset can be zero even though the ntp
daemon is all synced up. "Check_ntp" assumes a zero
offset is an unsynchronized ntpd. The way I got it to
work was to also check for stratum 16, which is also a
sign of zero offset. No need to be paranoid unless you
are sure they are out to get you! Diff -c below:

$ diff -c ../../libexec/check_ntp.0 ../../libexec/check_ntp
*** ../../libexec/check_ntp.0   2005-02-04
13:59:50.000000000 -0800
--- ../../libexec/check_ntp     2005-02-04
14:18:24.000000000 -0800
***************
*** 194,200 ****

                # An offset of 0.000000 with an error
is probably bogus. Actually,
                # it's probably always bogus, but let's
be paranoid here.
!               if ($offset == 0) { undef $offset;}

                $ntpdate_error = defined ($offset) ?
$ERRORS{"OK"} : $ERRORS{"CRITICAL"};
                print "ntperr = $ntpdate_error \n" if
$verbose;
--- 194,200 ----

                # An offset of 0.000000 with an error
is probably bogus. Actually,
                # it's probably always bogus, but let's
be paranoid here.
!               if ($offset == 0 and $stratum == 16) {
undef $offset;}

                $ntpdate_error = defined ($offset) ?
$ERRORS{"OK"} : $ERRORS{"CRITICAL"};
                print "ntperr = $ntpdate_error \n" if
$verbose;


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397600&aid=1159317&group_id=29880




More information about the Devel mailing list