2

On older systems, where ntpdate is still available, I'm able to query an NTP-Server without setting

ntpdate -q pool.ntp.org

and got e.g.:

server 213.239.239.164, stratum 2, offset -0.001191, delay 0.06012
server 185.220.101.76, stratum 3, offset 0.001658, delay 0.06416
server 185.220.101.31, stratum 3, offset -0.002385, delay 0.06377
server 159.69.144.253, stratum 2, offset -0.000134, delay 0.05711

So I see the NTP-Server is working fine and could be used.

On newer systems, where ntpd is running and ntpq is available, I tried.

ntpq -p pool.ntp.org

but it responds timed out, nothing received What am I doing wrong, what are the right parameters for ntpq command to see the NTP-Server is working and offer a good time-base useable for my systems?

1

some new systemd systems use timesyncd and have no client, but you can use timedatectl $ timedatectl Local time: Mon 2020-02-03 18:56:37 CET Universal time: Mon 2020-02-03 17:56:37 UTC RTC time: Mon 2020-02-03 17:56:37 Time zone: Europe/Amsterdam (CET, +0100) System clock synchronized: yes NTP service: active RTC in local TZ: no

Others have chronyc and you can use

chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* schnitzel.team                2   8   377   107   +989us[+1030us] +/-   12ms
^+ dns02.wsrs.net                2   8   377   109   -877us[ -836us] +/-   29ms
^+ mon2.hostin.cc                2   7   377   108  +1541us[+1583us] +/-   44ms
^- 51-15-20-83.rev.poneytel>     2   8   377   110  -8564us[-8522us] +/-  176ms
0

Meanwhile I found an answer to my own question:

sntp -t 1 pool.ntp.org

is working without ntpdate and is available in ntp-packages. It is very fast and allows checking external NTP-server. On drawback it always change the systemtime, so it is not only display the date/time.

1
  • 1
    will sntp -t work if you arent root, it should not change time if you are a normal user. Feb 4 '20 at 13:12
0

ntpdate -q pool.ntp.org

For me only tells how pool.ntp.org (a group in reality) is, ie what shape they are in and if they are reachable.

For the local host itself i would use ntpq -p, so for my own machine:

stefan@asus:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+gbg1.ntp.se     .PPS.            1 u  451 1024  377   10.221   -0.323   0.149
*gbg2.ntp.se     .PPS.            1 u  500 1024  377   10.250   -0.298   0.133
-sth2.ntp.se     .PPS.            1 u  352 1024  377   22.984    1.020  10.616
+mmo1.ntp.se     .PPS.            1 u  193 1024  377   15.313    0.225   0.135

This tells me that the machine (asus) just now prefers gbg2.ntp.se but gbg1 and mmo1 is alternatives.

sth2.ntp.se is unpreferred due to the jitter. Yes, my machine is stratum 2 itself (gbg1, gbg2 and mmo1 is stratum 1.)

ntpq -p tells who is the peers for the named computer, ie in your case the pool computers which maybe won't tell you that. ntpq -p alone will tell who is the peer(s) for the local computer, much more interesting.

And, no I would NOT think that timesyncd is good enough for a server !! You are hosed if the one machine which sync is done to is hosed !

1
  • For "ntpq -p" I need a working ntpd configuration, but that's what I want to check. So the old-fashioned ntpdate command was working independent from ntpd and if ntpdate succeeded I could use the same tested server for ntpd config.
    – Achim
    Feb 5 '20 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.