[Nagiosplug-devel] [ nagiosplug-Bugs-1267741 ] 1.4.1: check_ntp logic incorrect with >1 peers

SourceForge.net noreply at sourceforge.net
Tue Dec 20 09:20:22 CET 2005


Bugs item #1267741, was opened at 2005-08-24 08:42
Message generated for change (Comment added) made by lausser
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1267741&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: Parsing problem
Group: Release (specify)
Status: Open
Resolution: None
Priority: 5
Submitted By: ozburgess (ozburgess)
Assigned to: Nobody/Anonymous (nobody)
Summary: 1.4.1: check_ntp logic incorrect with >1 peers

Initial Comment:
After finding a matching entry and recording the
jitter, the loop parsing the ntpq output (below) should
exit.  Otherwise, it will read the next line, that line
will not match the regex (since it is not the sys.peer
or pps.peer), and $jitter will always be set to '(not
parsed)' (which is what we see with every test).

                        # match sys.peer or pps.peer
                        if
(/^(\*|o)([-0-9.\s]+)\s+([-0-9A-Za-z_().]+)\s+([-0-9.]+)\s+([lumb-]+)\s+([-0-9hm.]+)\s+([-0-9
.mh]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)/)
{
                                $syspeer = $2;
                                $stratum = $4;
                                $jitter = $11;
                                print "match $_ \n" if
$verbose;
                                if ($jitter > $jcrit) {
                                        print
"Jitter_crit = $11 :$jcrit\n" if ($verbose);
                                        $jitter_error =
$ERRORS{'CRITICAL'};
                                } elsif ($jitter >
$jwarn ) {
                                        print
"Jitter_warn = $11 :$jwarn\n" if ($verbose);
                                        $jitter_error =
$ERRORS{'WARNING'};
                                } else {
                                        $jitter_error =
$ERRORS{'OK'};
                                }
########################
# I think we need a loop break here.
########################
                        } else {
                                print "No match!\n" if
$verbose;
                                $jitter = '(not parsed)';
                        }


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

Comment By: gerhard lausser (lausser)
Date: 2005-12-20 18:19

Message:
Logged In: YES 
user_id=613416

1381801 does not solve the problem.
The expression
(/^(\*|o)([-0-9.\s]+)\s+([-0-9A-Za-z_().]+)........
needs to be extended to 
(/^(\+|\*|o)([-0-9.\s]+)\s+([-0-9A-Za-z_().]+)........
so that output like
     remote           refid      st t when poll reach   
delay   offset  jitter
===========================================================
===================
*160.50.94.70    .PPS.            1 u  250 1024  377    
0.958   -0.360   0.013
+160.50.7.12     160.50.94.70     2 u  303 1024  373    
0.334   -0.129   0.111
+160.50.7.203    160.50.94.70     2 u  362 1024  376    
0.137   -0.237   0.134
will be parsed correctly.


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

Comment By: Bufalooo (zjuran)
Date: 2005-12-20 11:23

Message:
Logged In: YES 
user_id=1405801

see reqid 1381801 perhaps it helps

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

Comment By: Bufalooo (zjuran)
Date: 2005-12-20 11:20

Message:
Logged In: YES 
user_id=1405801

see reqid 1381801 perhaps it helps

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

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




More information about the Devel mailing list