[Nagiosplug-devel] [ nagiosplug-Bugs-656237 ] check_ntp: dispersion error

noreply at sourceforge.net noreply at sourceforge.net
Sun Dec 22 18:36:02 CET 2002


Bugs item #656237, was opened at 2002-12-19 03:08
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=656237&group_id=29880

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ntp: dispersion error

Initial Comment:
I got a lot of dispersion errors with check_ntp. When
starting check_ntp with the option "-v" (verbose) I
discovered somtimes lines with a dispersion of 16.0000:

1.
If the last line has this value, check_ntp reports a
dispersion error. If the dispersion value of the last
line is low, then no dispersion error is reported. I
think this behaviour is wrong. A dispersion error
should be reported if any of the lines (not only the
last) has a dispersion value which is to high.

2.
I don't know the NTP-Protokoll very well. But I think
it would make sense, to take only output lines from
"ntpdc -s" into account, which start with * or +. From
the xntpdc man-page:

           Characters only appear  beside  peers
           which  were  included  in the final stage of
the clock
           selection algorithm. A . indicates that this
peer  was
           cast off in the falseticker detection, while
a + indi-
           cates that the peer made it through. A * 
denotes  the
           peer with which the server is currently
synchronizing.

Here is a patch of check_ntp that works for me:

diff -Naur plugins-scripts/check_ntp.pl
plugins-scripts-new/check_ntp.pl
--- plugins-scripts/check_ntp.pl        Mon Oct 28
14:05:07 2002
+++ plugins-scripts-new/check_ntp.pl    Thu Dec 19
11:05:38 2002
@@ -189,15 +189,19 @@
        if ( open(NTPDC,"$utils::PATH_TO_NTPDC -s $host
2>&1 |") ) {
                while (<NTPDC>) {
                        print $_ if ($verbose);
-                       if
(/([^\s]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)/)
{
+                       if
(/([+*][^\s]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)/)
{
                                if ($8 gt $critical) {
                                        print
"Dispersion_crit = $8 :$critical\n" if ($verbose);
                                       
$dispersion_error = $ERRORS{'CRITICAL'};
                                } elsif ($8 gt $warning ) {
                                        print
"Dispersion_warn = $8 :$warning \n" if ($verbose);
-                                      
$dispersion_error = $ERRORS{'WARNING'};
+                                       if
($dispersion_error != $ERRORS{'CRITICAL'}) {
+                                              
$dispersion_error = $ERRORS{'WARNING'};
+                                       }
                                } else {
-                                      
$dispersion_error = $ERRORS{'OK'};
+                                       if
($dispersion_error != $ERRORS{'CRITICAL'} and
$dispersion_error != $ERRORS{'WARNING'}) {
+                                              
$dispersion_error = $ERRORS{'OK'};
+                                       }
                                }
                        }
                }


--

Ingo Rogalsky
rogalsky<at>iis.fhg.de

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

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




More information about the Devel mailing list