We are moving from CentOS 7 to CentOS 8 for our monitoring servers (Zabbix) and we use ntpdate to query for time to detect if our local time provider for all devices (Cisco device) hasn’t started drifting.
Basically query pool server, query local device and do math to determine if difference is greater than X.
ntpdate -p 1 -q 0.centos.pool.ntp.org | grep -oP ‘(?<=offset ).*?(?= sec)’
Is there a way to query time (without setting server as source) using chrony or other tool in CentOS 8 that would work in similar fashion?
To adapt your existing command, try something like:
[[email protected] ~]# chronyc ntpdata 2001:418:3ff::53 | grep -oP '(?<=Offset : ).*?(?= sec)' +0.000654742
The address given must be one of your configured NTP servers.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.