[Nagiosplug-devel] Patch to check_ntp.pl

Jason Martin jhmartin at toger.us
Thu Sep 2 16:02:01 CEST 2004


The attached patch against the cvs head of
plugins_scripts/check_ntp.pl modifies the text of the message to
be consistent in the unit of $offset. The current version labels
it in seconds in some locations and msecs in another. This patch
normalizes it to the correct 'secs'.

Thanks,
-Jason Martin
-- 
Profanity is the one language all programmers know best.
This message is PGP/MIME signed.
-------------- next part --------------
Index: check_ntp.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_ntp.pl,v
retrieving revision 1.19
diff -u -w -r1.19 check_ntp.pl
--- check_ntp.pl	14 Oct 2003 02:40:31 -0000	1.19
+++ check_ntp.pl	2 Sep 2004 22:59:21 -0000
@@ -358,13 +358,13 @@
 } elsif( !$have_ntpq ) { # no errors from ntpdate and no ntpq or ntpq timed out
 	if (abs($offset) > $ocrit) {
 		$state = $ERRORS{'CRITICAL'};
-		$answer = "Offset $offset msec > +/- $ocrit sec\n";
+		$answer = "Offset $offset sec > +/- $ocrit sec\n";
 	} elsif (abs($offset) > $owarn) {
 		$state = $ERRORS{'WARNING'};
-		$answer = "Offset $offset msec > +/- $owarn sec\n";
+		$answer = "Offset $offset sec > +/- $owarn sec\n";
 	} elsif (( abs($offset) > $owarn) && $def_jitter ) {
 		$state = $ERRORS{'WARNING'};
-		$answer = "Offset $offset msec > +/- $owarn sec, ntpq timed out\n";
+		$answer = "Offset $offset sec > +/- $owarn sec, ntpq timed out\n";
 	} elsif ( $def_jitter ) {
 		$state = $ERRORS{'WARNING'};
 		$answer = "Offset $offset secs, ntpq timed out\n";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 211 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20040902/19865d04/attachment.sig>


More information about the Devel mailing list