CMK version: 2.2
OS version: Ubuntu 18, 20, 22
Hi!
Been investigating the check for NTP Time since it from time to time on any server reports that the time has not been synchronized, which has not been true in any case so far.
We have Chrony, and chrony is configured with multiple NTP servers.
I have read up on some forums threads searching for Chrony and some mentions that the time between syncs should be lowered, update interval, the Chrony cache and other things but I can’t really find a root cause for this issue or maybe I am misreading something.
The NTP Time check uses chrony tracking
.
This returns the time for when the primary source (usually the first server) was last synced, but not when Chrony was actually last synced. So it could go any amount of time before chrony syncs against the first configured source again.
The command also returns information for how well chrony is in sync since the last sync, which can be calculated provided the system time, offset and root delay/dispersion. The value here will increase if chrony stays out of sync.
Comparing the time that the check returns, it seems to be the reference time from chrony tracking
from what I understand has no relevance in checking how much time has gone by since the last sync or how well the time is in sync.
Going through the docs from Chrony, this does not really seem to be used for this purpose either, so not sure how well the implementation of the check has been performed in this sense?
chronyc ntpdata
returns tracking for all sources and when they were last updated, which could be later than the check describes it for the primary source.
chronyc sources
returns a short list of the same with a few details.
From what I am seeing looking at chronyc tracking
this way does not really help much, using ntpdata
or sources
would
Is there another way to implement this or to make the NTP Time check look at this in a better way?
Or should I approach this in another way entirely?
Thank you!