zabbix-tooling / zabbix-agent-extensions

zabbix-agent-extensions
GNU General Public License v2.0
111 stars 45 forks source link

Add support for systemd/chrony timedatectl monitoring #39

Closed scoopex closed 4 months ago

scoopex commented 11 months ago

NTP monitoring currently depends on the installation of ntpd.

Enhance the current implementation to automatically discover the type of the ntp-synchonization and provide suitable measures.

Systemd-timesyncd implements SNTP, not NTP, hence multi-server support is out of focus. If you want a full NTP implementation, please use ntpd or chrony. (https://github.com/systemd/systemd/issues/2893)

$ timedatectl show-timesync
FallbackNTPServers=ntp.ubuntu.com
ServerName=ntp.ubuntu.com
ServerAddress=2620:2d:4000:1::3f
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=17min 4s
NTPMessage={ Leap=0, Version=4, Mode=4, Stratum=2, Precision=-25, RootDelay=8.926ms, RootDispersion=1.770ms, Reference=91EECB0E, OriginateTimestamp=Fri 2023-09-15 10:05:40 CEST, ReceiveTimestamp=Fri 2023-09-15 10:05:40 CEST, TransmitTimestamp=Fri 2023-09-15 10:05:40 CEST, DestinationTimestamp=Fri 2023-09-15 10:05:40 CEST, Ignored=no PacketCount=25, Jitter=279.841ms }
Frequency=446926
chronyc tracking
Reference ID    : 1.2.3.4 (a.b.c)
Stratum         : 3
Ref time (UTC)  : Fri Feb  3 15:00:29 2012
System time     : 0.000001501 seconds slow of NTP time
Last offset     : -0.000001632 seconds
RMS offset      : 0.000002360 seconds
Frequency       : 331.898 ppm fast
Residual freq   : 0.004 ppm
Skew            : 0.154 ppm
Root delay      : 0.373169 seconds
Root dispersion : 0.024780 seconds
Update interval : 64.2 seconds
Leap status     : Normal