Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_ntp_time and check_ntp_peers cannot find offset [sf#3314686] #1142

Open
monitoring-user opened this issue Sep 24, 2013 · 17 comments
Open

Comments

@monitoring-user
Copy link

Submitted by silfreed on 2011-06-10 14:56:22

I'm having a similar problem with the "offset unknown" that others have had in the past, although I'm running 1.4.14 of the plugins using check_ntp_time and check_ntp_peer. Below is the output of some of the commands. For some reason check_ntp_peer doesn't even seem to be able to find the peers, although check_ntp_time seems fine, but doesn't get the correct offset.

# ntpdc -n -s localhost
     remote           local      st poll reach  delay   offset    disp
=======================================================================
 208.53.158.34   10.128.0.45      2   64    3 0.02493 -0.088040 1.98438
 204.9.54.119    10.128.0.45      1   64    3 0.00943 -0.035220 1.98444
 199.4.29.166    10.128.0.45      2   64    3 0.02950 -0.021567 1.98444
 216.129.110.22  10.128.0.45      2   64    3 0.01813 -0.027695 1.98444

# /usr/lib/nagios/plugins/check_ntp_peer -H 127.0.0.1 -w 5 -c 10 -v
0 candiate peers available
warning: no synchronization source found
warning: LI_ALARM bit is set
NTP CRITICAL: Server not synchronized, Offset unknown|

# /usr/lib/nagios/plugins/check_ntp_time -H 127.0.0.1 -w 5 -c 10 -v
sending request to peer 0
response from peer 0: offset 2.74181366e-06
sending request to peer 0
response from peer 0: offset -4.291534424e-06
sending request to peer 0
response from peer 0: offset -3.457069397e-06
sending request to peer 0
response from peer 0: offset -3.576278687e-06
discarding peer 0: stratum=0
overall average offset: 0
NTP CRITICAL: Offset unknown|
@monitoring-user
Copy link
Author

Submitted by silfreed on 2011-06-27 19:57:42

Confirmed this also exists w/ 1.4.15.

@monitoring-user
Copy link
Author

Submitted by None on 2012-05-22 07:32:59

Any progress on this one? I have the latest plugin, yet the problem is still there.

@monitoring-user
Copy link
Author

Submitted by hweiss on 2013-06-19 10:23:40

Sorry for the late response, Could you please run "ntpq -c rv" when this happens and post the output?

@dooblem
Copy link

dooblem commented Sep 9, 2014

Hi,
We also have the problem on several servers, using monitoring-plugins v2:

$ /usr/lib/nagios/plugins/check_ntp_time -V           
check_ntp_time v2.0 (monitoring-plugins 2.0)
$ /usr/lib/nagios/plugins/check_ntp_time -v -H XXXXX
sending request to peer 0
response from peer 0: offset -0.04430556297
sending request to peer 0
response from peer 0: offset -0.04425096512
sending request to peer 0
response from peer 0: offset -0.0442429781
sending request to peer 0
response from peer 0: offset -0.04425191879
discarding peer 0: stratum=0
overall average offset: 0
NTP CRITICAL: Offset unknown|

@dmsimard
Copy link

Cross referencing a bug I posted about this on the Ubuntu launchpad:
https://bugs.launchpad.net/ubuntu/+source/nagios-plugins/+bug/1367791

@fmikker
Copy link

fmikker commented May 6, 2015

Also adding a cross-ref to a external issue, the information it contains might be useful: https://jira.op5.com/browse/MON-8045

@geor-g
Copy link

geor-g commented Feb 15, 2017

Is there any fix insight?

@Fnux
Copy link

Fnux commented Jul 13, 2017

anyone ?

@riskersen
Copy link
Collaborator

Could you please provide some more information?

What OS are you using?
Could you please provide verbose output?

BR
Oliver

@Fnux
Copy link

Fnux commented Jul 13, 2017

OS : Debian 9 stretch.

tfloure@orwell:~ » uname -a                                                       
Linux orwell 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux
tfloure@orwell:~ » ntptrace -r srv1.lan.inipop.ch                                 
srv1.inipop.ch: stratum 2, offset 0.000437, synch distance 0.010838
46-243-26-34.tangos.nl: stratum 1, offset 0.000001, synch distance 0.000001, refid 'GPS'
tfloure@orwell:~ » /usr/lib/nagios/plugins/check_ntp_time -H srv1.lan.inipop.ch -v
sending request to peer 0
response from peer 0: offset 0.001212477684
sending request to peer 0
response from peer 0: offset -8.058547974e-05
sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
discarding peer 0: stratum=0
overall average offset: 0
NTP CRITICAL: Offset unknown|
tfloure@orwell:~ » aptitude show monitoring-plugins                                                                                                            (2)
Package: monitoring-plugins              
Version: 2.2-3
State: installed
Automatically installed: no
Priority: extra
Section: net
Maintainer: Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>
Architecture: all
Uncompressed Size: 52.2 k
Depends: monitoring-plugins-basic, monitoring-plugins-standard
Suggests: icinga | icinga2, nagios-plugins-contrib
Breaks: nagios-plugins (< 1.5-4~)
Replaces: nagios-plugins (< 1.5-4~)
Description: Plugins for nagios compatible monitoring systems (metapackage)
 Plugins for nagios compatible monitoring systems like Naemon and Icinga. 
 
 This metapackage will install the entire suite of plugins for nagios compatible monitoring systems. If you are installing monitoring plugins on a remote
 "satellite" server (using nagios-nrpe-server or nsca), you may be interested in the monitoring-plugins-basic package.
Homepage: https://www.monitoring-plugins.org
Tags: admin::monitoring, role::metapackage

Thank you !

@riskersen
Copy link
Collaborator

riskersen commented Jul 13, 2017 via email

@Fnux
Copy link

Fnux commented Jul 13, 2017

tfloure@orwell:~ » /usr/lib/nagios/plugins/check_ntp_time -H srv1.lan.inipop.ch -vv                                                                          (130)
Found 1 peers to check
sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
response from peer 0: packet contents:
	flags: 0xe4
	  li=3 (0xc0)
	  vn=4 (0x20)
	  mode=4 (0x04)
	stratum = 0
	poll = 16
	precision = 0.015625
	rtdelay = 1
	rtdisp = 1
	refid = 45544152
	refts = 0
	origts = 1499971888.046682
	rxts = 1499971888.046682
	txts = 1499971888.046682
offset -0.0003514289856
sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
re-sending request to peer 0
discarding peer 0: stratum=0
no peers meeting synchronization criteria :(
overall average offset: 0
NTP CRITICAL: Offset unknown|

@Fnux
Copy link

Fnux commented Jul 13, 2017

As posted above, ntptrace gives stratum 2.

@helmo
Copy link

helmo commented Apr 20, 2018

I found a debian bug report which mentions that the 'limited' keyword in the ntp.conf on the server being checked can cause this.

Adding the line 'discard minimum 1' to ntp.conf on the server being checked resolves it.

@hathawsh
Copy link

hathawsh commented Aug 15, 2018

Ah, the problem is the check_ntp_time plugin queries the NTP server several times and snags on the NTP server's rate limit. Thanks @helmo!

@mrimann
Copy link

mrimann commented Jan 12, 2021

I'm running into exactly this situation on a VM at a customer's internal network, where I have no ability to modify the config of the time-server. So adding the discard minimum 1 trick or similar on the timeserver does not work for us.

I've seen that in the nagios-plugins repo, the check_ntp_time script was extended and now has a -d flag to set some delay between the requests (see nagios-plugins/nagios-plugins#329) - this sounds like the solution to this issue, but I don't know if and when this change will also flow into a release of the monitoring-plugins...?

@riskersen
Copy link
Collaborator

May I ask you to create a pull request for that feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants