check_ntp_peer reports stratum off-by-one?

Holger Weiß holger at CIS.FU-Berlin.DE
Thu Jul 19 14:51:31 CEST 2012


* 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.¹

> 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}.
The (arguably somewhat confusing²) syntax for specifying thresholds is
documented here:

  http://nagiosplug.sf.net/developer-guidelines.html#THRESHOLDFORMAT

So, you want to specify --twarn=6: --tcrit=5: or --twarn=@5 --tcrit=@4.

Holger

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

² In his talks, Ton used to quiz the audience about the results of
  various threshold specifications in order to demonstrate the need for
  a new threshold syntax, as proposed here:

  http://nagiosplugins.org/rfc/new_threshold_syntax

------------------------------------------------------------------------------
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