[Nagiosplug-devel] [ nagiosplug-Bugs-1464321 ] check_ntp error: Use of uninitialized value in division

SourceForge.net noreply at sourceforge.net
Tue Apr 4 08:49:09 CEST 2006


Bugs item #1464321, was opened at 2006-04-04 17:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1464321&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Herbert Straub (hstraub)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ntp error: Use of uninitialized value in division 

Initial Comment:
Version: 1.4.2

Situation: retrieving ntp information of "ntp clients".
This is done with ntpdate. I get this error message:

/usr/lib/nagios/plugins/check_ntp -v -H myntpclient -w
3 -c 10
ntperr = 0
ntperr = 0
myntpclient: timed out, nothing received
Use of uninitialized value in division (/) at
/usr/lib/nagios/plugins/check_ntp line 423.
NTP CRITICAL: Offset -37.599848 sec > +/- 10
sec|offset=-37.599848, jitter=0,peer_stratum=14

It seems, that ntpdate cannot get the jitter
information, but the output calculate with $jitter. I
think, this patch fix this bug:

 diff  -u /usr/lib/nagios/plugins/check_ntp.SAVE2
/usr/lib/nagios/plugins/check_ntp
--- /usr/lib/nagios/plugins/check_ntp.SAVE2    
2006-04-04 17:31:04.000000000 +0200
+++ /usr/lib/nagios/plugins/check_ntp   2006-04-04
17:33:12.000000000 +0200
@@ -420,7 +420,7 @@
 foreach my $key (keys %ERRORS) {
        if ($state==$ERRORS{$key}) {
 #              print ("NTP $key: $answer");
-               print ("NTP $key:
$answer|offset=$offset, jitter=" . $jitter/1000 .    
",peer_stratum=$stratum\n");
+               print ("NTP $key:
$answer|offset=$offset, jitter=" . (defined($jitter) ?
$jitter/1000 :  "not available") .      
",peer_stratum=$stratum\n");
                last;
        }
 }


Output:
/usr/lib/nagios/plugins/check_ntp -v -H myntpclient -w
3 -c 10
ntperr = 0
ntperr = 0
myntpclient: timed out, nothing received
NTP CRITICAL: Offset -37.622197 sec > +/- 10
sec|offset=-37.622197, jitter=not available,peer_stratum=14



Best regards
Herbert Straub


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

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




More information about the Devel mailing list