NTP CRITICAL: Offset unknown

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: NTP CRITICAL: Offset unknown

Post by jbennett »

Code: Select all

 # ntpdc -p
     remote           local      st poll reach  delay   offset    disp
=======================================================================
=LOCAL(0)        127.0.0.1       10   64  377 0.00000  0.000000 0.03067
*timeserver1     xxx.xxx.xxx.xxx    2   64  377 0.00096 13.652414 0.00580
The below output doesn't quite make sense to me?

Code: Select all

# /usr/local/nagios/libexec/check_ntp_time -v -H localhost
sending request to peer 0
response from peer 0: offset -2.777669579e-07
sending request to peer 0
response from peer 0: offset -2.161832526e-07
sending request to peer 0
response from peer 0: offset -4.009343684e-07
sending request to peer 0
response from peer 0: offset -1.987209544e-07
discarding peer 0: stratum=0
overall average offset: 0
NTP CRITICAL: Offset unknown|
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NTP CRITICAL: Offset unknown

Post by lmiltchev »

It seems like the problem is caused by "stratum=0". You can read more on the issue here:

http://serverfault.com/questions/269701 ... rding-peer

Try running the check against a remote NTP server (not localhost), and see if the plugin would work fine:

Code: Select all

[root@testbox libexec]# ./check_ntp_time -v -H pool.ntp.org
sending request to peer 0
response from peer 0: offset 0.004180928168
sending request to peer 0
response from peer 0: offset 0.00260892103
sending request to peer 0
response from peer 0: offset 0.002613890916
sending request to peer 0
response from peer 0: offset 0.008024519484
sending request to peer 1
response from peer 1: offset -0.00406507263
sending request to peer 1
response from peer 1: offset -0.001290791028
sending request to peer 1
response from peer 1: offset -0.000941132661
sending request to peer 1
response from peer 1: offset 0.001547022199
sending request to peer 2
response from peer 2: offset -0.002509119629
sending request to peer 2
response from peer 2: offset -0.003943699296
sending request to peer 2
response from peer 2: offset -0.00142720103
sending request to peer 2
response from peer 2: offset -0.00291433325
sending request to peer 3
response from peer 3: offset -0.003663558164
sending request to peer 3
response from peer 3: offset -0.003243627492
sending request to peer 3
response from peer 3: offset -0.004003834503
sending request to peer 3
response from peer 3: offset -0.003916329471
overall average offset: 0.004180928168
NTP OK: Offset 0.004180928168 secs|offset=0.004181s;60.000000;120.000000;
The check works fine for me, even if I run it against localhost:

Code: Select all

[root@testbox libexec]# ./check_ntp_time -v -H localhost
sending request to peer 0
response from peer 0: offset -3.900611773e-06
sending request to peer 0
response from peer 0: offset -4.698173143e-06
sending request to peer 0
response from peer 0: offset -4.380010068e-06
sending request to peer 0
response from peer 0: offset -4.218425602e-06
sending request to peer 1
response from peer 1: offset -2.949498594e-06
sending request to peer 1
response from peer 1: offset -4.584901035e-06
sending request to peer 1
response from peer 1: offset -4.504807293e-06
sending request to peer 1
response from peer 1: offset -4.11097426e-06
overall average offset: -3.900611773e-06
NTP OK: Offset -3.900611773e-06 secs|offset=-0.000004s;60.000000;120.000000;
...but I don't get "stratum=0" in the output.

For more info, you can probably email [email protected].

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: NTP CRITICAL: Offset unknown

Post by jbennett »

Unfortunately, the boxes I am checking are not able to communicate to the outside world, by design. So I cannot check against a remote NTP server.

The issue appears to clear up after a period of time, but then will return later.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NTP CRITICAL: Offset unknown

Post by abrist »

jbennett wrote:Unfortunately, the boxes I am checking are not able to communicate to the outside world, by design. So I cannot check against a remote NTP server.
Do you have an internal time server?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: NTP CRITICAL: Offset unknown

Post by jbennett »

Yes. That is timeserver1 in the output.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NTP CRITICAL: Offset unknown

Post by abrist »

This bug was *supposedly* resolved in 1.4.13. Though after some googling, it looks like it may have still been a limited issue for some users. Where did you download the nagios plugins package that you built? The latest check_ntp_time version is:

Code: Select all

[root@nagiosxi libexec]# ./check_ntp_time -V
check_ntp_time v1.4.16 (nagios-plugins 1.4.16)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: NTP CRITICAL: Offset unknown

Post by jbennett »

Directly from the Nagios site. (http://www.nagios.org/download/plugins)

I'm showing .16 as well on my box now too:

Code: Select all

# /usr/local/nagios/libexec/check_ntp_time -V
check_ntp_time v1.4.16 (nagios-plugins 1.4.16)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NTP CRITICAL: Offset unknown

Post by scottwilkerson »

I'm a bit confused at what command you are running on what server. In a previous post you wrote:
jbennett wrote:Looks like it didn't resolve the issue:

When run on the host that's reporting Offset unknown in Nagios:

Code: Select all

# /usr/local/nagios/libexec/check_ntp_time -H localhost -w 0.5 -c 1
NTP OK: Offset -1.147855073e-07 secs|offset=-0.000000s;0.500000;1.000000;
But then later wrote:
jbennett wrote: The below output doesn't quite make sense to me?

Code: Select all

# /usr/local/nagios/libexec/check_ntp_time -v -H localhost
sending request to peer 0
response from peer 0: offset -2.777669579e-07
sending request to peer 0
response from peer 0: offset -2.161832526e-07
sending request to peer 0
response from peer 0: offset -4.009343684e-07
sending request to peer 0
response from peer 0: offset -1.987209544e-07
discarding peer 0: stratum=0
overall average offset: 0
NTP CRITICAL: Offset unknown|
Also, you mentioned you have this in a nrds config, is this the exact command you are using in the nrds config?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: NTP CRITICAL: Offset unknown

Post by jbennett »

The check per the NRDS config that is being run that is throwing the errors is as follows:

Code: Select all

command[Check NTP Sync]=/usr/local/nagios/libexec/check_ntp_time -H localhost -q -w 0.5 -c 1
I ran the -v switch as part of troubleshooting since it gives a bit more information.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NTP CRITICAL: Offset unknown

Post by abrist »

It looks like the ntp server you are connecting to is reporting "stratum=0". This declaration is reserved for atomic clocks, not network clocks. Is your time server truly an atomic clock?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked