NTP jitter (not parsed) breaks check_ntp?

Charles Bueche charles at bueche.ch
Wed Sep 28 15:47:36 CEST 2005


Hi,

[speaking about check_ntp of plugins V 1.4.2]

My servers are Sun/Solaris 9/stock ntpd.

I have seen the same problem here, and I suspect that there is a bug
around lines 296-313. If the "ntpq -pn" command return 

+server_line_1
*server_line_2

(synced on the last server) all is OK. If the result is the opposite :

*server_line_1
+server_line_2

it means that we are syncing OK, but on the 1st server. Even if the
candidate 1 match and would mean a sync is possible, we come in the
"else" situation in line 296, as the big regex would fail (last line
begin with +, so no match, so we come to the "$jitter = '(not parsed)';"
situation.

I'm not sure how to fix it in the correct way. I have enhanced the regex
to 

	if (/^(\+|\*|o)(.........

bit it is probably not what the author wanted at the first place. Would
it not make more sense to stop parsing and break the loop when we have a
"*" match ?

Charles

On mer, 2005-09-21 at 07:37 -0700, John Christian wrote:
> Hello,
> 
> My, ummm, friend's data center lost power this
> weekend. All servers came back up, but now it seems
> that check_ntp is not working properly. The NTP
> service detail for some hosts is fine (green) but most
> NTP services are state pending (grey). They have
> remained state pending for 3+ days.
> 
> Running check_ntp manually reveals:
> 
> foo:/usr/local/nagios/libexec # ./check_ntp -H
> hostgreen NTP OK: Offset -0.000513 secs, jitter 1.74
> msec, peer is stratum 3|offset=-0.000513,
> jitter=0.00174,peer_stratum=3
> 
> foo:/usr/local/nagios/libexec # ./check_ntp -H
> hostgrey
> Argument "(not parsed)" isn't numeric in abs at
> ./check_ntp line 401.
> NTP OK: Offset -0.000141 secs, jitter (not parsed)
> msec, peer is stratum 2|offset=-0.000141,
> jitter=0,peer_stratum=2
> 
> check_ntp (nagios-plugins 1.4.1) 1.29
> Nagios 2.0b4
> Solaris 9
> 
> The NTP daemons are running on all hosts and are in
> sync. I suspect the problem is related to the
> check_ntp script not handling the "jitter (not
> parsed)" feedback properly.
> 
> I've tried restarting the ntp daemons and restarting
> nagios, but it didn't help.
> 
> BTW: For the NTP services that are in the grey pending
> state, it appears they become ignored because the next
> scheduled service check never changes. I can force a
> manual check -which updates the next scheduled check-
> but it stays grey and no additional checks are
> auto-scheduled.
> 
> How do I get my NTP clients to parse some jitter? Or,
> how else should I fix this problem? TIA!
> -John
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> 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
-- 
Charles Bueche <charles at bueche.ch>
sand, snow, wave, wind and net -surfer



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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