check_ntp_peer reports stratum off-by-one?

Marc Haber mh+nagios-users at zugschlus.de
Sun Jul 22 16:28:40 CEST 2012


Hi,

On Thu, Jul 19, 2012 at 02:51:31PM +0200, Holger Weiß wrote:
> * Marc Haber <mh+nagios-users at zugschlus.de> [2012-07-14 21:02]:
> > $ ntpq -c pe torres.zugschlus.de
> >      remote           refid      st t when poll reach   delay   offset  jitter
> > ==============================================================================
> > *ptbtime1.ptb.de .PTB.            1 u 1044 1024  377   18.521   -1.513   0.258
> > +ptbtime2.ptb.de .PTB.            1 u  903 1024  377   18.132   -1.277   0.373
> > -node01.mserverz 85.10.240.253    3 u  651 1024  377   18.721   -7.067   6.829
> >  zefiris.semidef 192.53.103.108   2 u  490 1024  377   16.496    4.906   0.680
> > -evie.fra1.as411 78.47.148.174    3 u  974 1024  377   18.879    4.630   0.616
> > +geiger-online.c 81.94.123.17     2 u  556 1024  377   18.200    4.669   0.694
> > $  /usr/lib/nagios/plugins/check_ntp_peer -H torres.zugschlus.de --warning=3 --critical=5 --jwarn=1 --jcrit=2 --twarn=5 --tcrit=5 --swarn=2 --scrit=2
> > NTP OK: Offset -0,001 secs, jitter=0,000000, stratum=1, truechimers=5|offset=-0,001000s;3,000000;5,000000; jitter=0,000000;1,000000;2,000000;0,000000 stratum=1;2;2;0;16 truechimers=5;5;5;0
> > $
> > 
> > Does this mean that the --swarn und --twarn options actually check the
> > stratum of the "best" peer of the queried server, not the queried
> > server itself?
> 
> The --swarn and --scrit options (not --twarn), yes.¹

> ¹ http://permalink.gmane.org/gmane.network.nagios.plugins/4333

I would be in favour of sending a second query to get the results
right. Correcting the documentation to reflect what the software
really does is only the second best solution.

The current combination of documentation and software behavior is
confusing at best.

> > And, while we're at it, why is this:
> > 
> > $  /usr/lib/nagios/plugins/check_ntp_peer -H torres.zugschlus.de --twarn=5 --tcrit=4 -v
> > 3 candidate peers available
> > synchronization source found
> > Getting offset, jitter and stratum for peer 20cf
> > parsing offset from peer 20cf: -0,001
> > NTP CRITICAL: Offset -0,001 secs, truechimers=5|offset=-0,001000s;60,000000;120,000000; truechimers=5;5;4;0
> > $
> > 
> > critical?
> 
> --tcrit=4 is equivalent to --tcrit=0:4 and tells the plugin to raise a
> critical alert if the number of truechimers is outside the range {0..4}.

Now that you mention it, things are clear. And it is also mentioned in
the --help. But, is the example, "-m :5 -n :3" not the other way round?

Thanks for helping.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 31958061
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 31958062

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list