[chrony-users] Getting time synchronization offset from chronyd |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-users] Getting time synchronization offset from chronyd
- From: Guy Morand <g.morand@xxxxxxxx>
- Date: Wed, 15 Jul 2020 13:53:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scewo-ch.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=tVuL0noCsqyCMuLZpxOIgx3aCxwaYJFF/tdwb1LX3qA=; b=zXeb+t0wTnRr9DMeEZCE9un+rxIIuTYOVruyy0CVN2UO+1PPreDAL9PIg1nye7DFIK e/9RfOKoNlIVICnV3v7fesP8dPuxwrRaBLykT9FhqaSGBgeGDYcampjkq8TYUIt3+6++ /OX4qAmBijqqF6D6aahKI0irfXdXQU+5umgXNJba+AuL3q8Ng07xAIEoMul5JHwivVnU 5rqcRbQq36MmgKX7yfQK1+JOidvuNxjhzYOgRdjRuMAxWF/Fmfpl/yekqly6s/gZZ4jx k5ezkUKXh4Fw8hQPar72iTBoGiBhjjV4Rhrm2cKYdA/yATcQN1WvuFG1w++Xutp8ZZBe R5Og==
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.