[chrony-users] Getting time synchronization offset from chronyd

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Hallo chrony users!

I'm developping an "IoT" device that sends events to a remote server. We
need to make sure that the timestamp is not too much away from the
actual time, that is why we use chrony to synchronize the time with our
servers and correct events that drifted too much after the first time
correction. The configuration looks like this:

```
pool <our_server> iburst minpoll 12 maxpoll 13

makestep 1.0 3
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
rtcdevice /dev/rtc
rtconutc
rtcsync
```

In another thread, I'm checking if the time was synchronized and how
much it was corrected by polling the chrony daemon with:

```
$ chronyc -n tracking
Reference ID    : 9DE666BD (157.230.102.189)
Stratum         : 3
Ref time (UTC)  : Wed Jul 15 10:51:02 2020
System time     : 0.000009834 seconds slow of NTP time
Last offset     : +0.692694306 seconds
RMS offset      : 0.692694306 seconds
Frequency       : 166.138 ppm fast
Residual freq   : +0.000 ppm
Skew            : 12.204 ppm
Root delay      : 0.028277593 seconds
Root dispersion : 0.036599152 seconds
Update interval : 4161.7 seconds
Leap status     : Normal
```

I use *Leap status* to make sure that the time is in sync and *Last
offset* to read the time correction.

However, after changing the system time to few hours ago and rebooting,
I got a time correction of few milliseconds. My assumption is due to the
"iburst" parameter, the time got corrected more than once and missed the
biggest correction that was of few hours. Is that plausible?

* Am I reading the right field?
* Is there a way to get events directly from the chrony daemon when a
  time correction was done (UNIX socket) to not misse any time
  correction?
* Is there a better approach to achieve this?

Thanks for the pointers!

Best regards,

Guy Morand

-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/