Page 1 of 1

NTP offset unknown

Posted: Fri Feb 22, 2019 5:25 am
by junkertf
Hello,

I had read many post wroted long time ago in the subject case, but i had an issue with check_ntp_time

[root@NAGIOSCLIENTHOST ~]# /usr/local/nagios/libexec/check_ntp_time -H localhost -4 -w -5:5 -c -50:50 -vv
Found 2 peers to check
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.322694
rxts = 1550830666.322701
txts = 1550830666.322741
offset -1.120567322e-05
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.322873
rxts = 1550830666.322876
txts = 1550830666.32291
offset -9.536743164e-06
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.322974
rxts = 1550830666.322976
txts = 1550830666.323
offset -7.033348083e-06
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.323064
rxts = 1550830666.323067
txts = 1550830666.323091
offset -6.437301636e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.323147
rxts = 1550830666.323148
txts = 1550830666.323171
offset -6.437301636e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.323225
rxts = 1550830666.323228
txts = 1550830666.32325
offset -5.602836609e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.323308
rxts = 1550830666.323309
txts = 1550830666.323332
offset -7.748603821e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 2
poll = 16
precision = 5.96046e-08
rtdelay = 0.02008056640625
rtdisp = 0.3985748291015625
refid = 8fcc103
refts = 1550830660.622654
origts = 1550830666.323393
rxts = 1550830666.323395
txts = 1550830666.323418
offset -6.318092346e-06
discarding peer 0: flags=3
discarding peer 1: flags=3
no peers meeting synchronization criteria :(
overall average offset: 0
NTP CRITICAL: Offset unknown|

also checked right after:
[root@NAGIOSCLIENTHOST ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*time.bbrt.hu .GPS. 1 u 7 64 3 20.093 -186.72 148.100
+time2.bbrt.hu 193.79.237.14 2 u - 64 7 0.101 -196.68 18.429


our client side ntp.conf looks like:

driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
server time.ourserver.hu prefer iburst
server time2.ourserver.hu iburst
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor

## tecting directives - seems like not helping:
discard minimum 1
discarding peer 0: stratum=0

the plugin comes with the following nrpe version:

/usr/local/nagios/libexec/check_nrpe -V
NRPE Plugin for Nagios
Version: 3.2.1

OS version (but seems all of our OEL 6-7 and RHEL 6-7 clients are affected):
Oracle Linux Server release 7.6

An event handler to restart the ntpd service is tried, but seems not solve the problem in long term, because its come up again and again on various servers. Can you help us solve these problem?

Best regards,

Ferenc

Re: NTP offset unknown

Posted: Fri Feb 22, 2019 3:51 pm
by ssax
Mine outputs that too, what is the output of this command?

Code: Select all

/usr/local/nagios/libexec/check_ntp_time -H localhost -4 -w -5:5 -c -50:50

Re: NTP offset unknown

Posted: Wed Feb 27, 2019 6:40 am
by junkertf
Hello,

Sorry for the late-late answer.
Currently cannot reproduce the issue.
It comes in waves in huge ammount... so more than 5-10 same check failure.
Even client side ntpd restart not help the issue...

The output was in the report time as it was described in the open topic:

NTP CRITICAL: Offset unknown|

Thanks, best regards,

Ferenc

Re: NTP offset unknown

Posted: Thu Feb 28, 2019 5:53 pm
by ssax
Were you running it with the -vv then when you were able to reproduce it or without the -vv?

Re: NTP offset unknown

Posted: Fri Apr 12, 2019 1:22 am
by junkertf
Hello,

I had successfully reproduced it now.
Currently i have 7 host with the issue.

[root@HOST ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
xtime.bbrt.hu .GPS. 1 u 37 64 37 526.542 412.832 230.267
*time2.bbrt.hu 192.53.103.108 2 u 40 64 377 3.057 149.794 83.723

[root@HOST ~]# /usr/local/nagios/libexec/check_ntp_time -vv -H localhost -4 -w -5:5 -c -50:50
Found 2 peers to check
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.289545
rxts = 1555049978.289553
txts = 1555049978.289605
offset -1.132488251e-05
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.289729
rxts = 1555049978.289733
txts = 1555049978.289771
offset -9.417533875e-06
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.289832
rxts = 1555049978.289835
txts = 1555049978.28986
offset -8.702278137e-06
sending request to peer 0
response from peer 0: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.289916
rxts = 1555049978.289918
txts = 1555049978.289942
offset -7.748603821e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.289996
rxts = 1555049978.289998
txts = 1555049978.290022
offset -8.225440979e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.290075
rxts = 1555049978.290077
txts = 1555049978.290101
offset -7.9870224e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.290153
rxts = 1555049978.290156
txts = 1555049978.290172
offset -8.106231689e-06
sending request to peer 1
response from peer 1: packet contents:
flags: 0xe4
li=3 (0xc0)
vn=4 (0x20)
mode=4 (0x04)
stratum = 3
poll = 16
precision = 5.96046e-08
rtdelay = 0.029541015625
rtdisp = 0.16961669921875
refid = 63fdc103
refts = 1555049933.735348
origts = 1555049978.290225
rxts = 1555049978.290228
txts = 1555049978.290299
offset -1.215934753e-05
discarding peer 0: flags=3
discarding peer 1: flags=3
no peers meeting synchronization criteria :(
overall average offset: 0
NTP CRITICAL: Offset unknown|

[root@HOST~]# /usr/local/nagios/libexec/check_ntp_time -H localhost -4 -w -5:5 -c -50:50
NTP CRITICAL: Offset unknown|

[root@HOST ~]# cat /etc/ntp.conf | grep -vE "^$|^#"
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
server time.bbrt.hu iburst
server time2.bbrt.hu
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
discard minimum 1

Best regards,

Ferenc

Re: NTP offset unknown

Posted: Fri Apr 12, 2019 2:56 pm
by ssax
The discard minimum 1 is meant to be enabled on time.bbrt.hu and time2.bbrt.hu.
Ah, the problem is the check_ntp_time plugin queries the NTP server several times and snags on the NTP server's rate limit.
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.
Taken from here:

Code: Select all

https://github.com/monitoring-plugins/monitoring-plugins/issues/1142
Do you control the NTP servers time.bbrt.hu and time2.bbrt.hu?