Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTP monitor: implement diagnostic to check if synchronized to the correct source #353

Open
tonynajjar opened this issue Jun 4, 2024 · 0 comments

Comments

@tonynajjar
Copy link
Contributor

What do you think of adding to the NTP monitor an optional check for which source we are currently synchronized with? I have the case that although my chrony configuration is set to prefer a computer connected via ethernet, it sometimes switches to another source. I would like to detect this in the diagnostics.

Implementation details

I only researched how to do it for chrony. Unfortunately there is no python library for chrony so the method uses subprocess.run. We would run chronyc tracking and parse the server name (in this case nuc) and check whether it matches the user-configured wished server

chronyc tracking
Reference ID    : C0A80032 (nuc)
Stratum         : 4
Ref time (UTC)  : Tue Jun 04 14:10:00 2024
System time     : 0.000340873 seconds fast of NTP time
Last offset     : +0.000357083 seconds
RMS offset      : 0.000497816 seconds
Frequency       : 10.381 ppm slow
Residual freq   : +3.072 ppm
Skew            : 1.499 ppm
Root delay      : 0.037382413 seconds
Root dispersion : 0.001741173 seconds
Update interval : 32.5 seconds
Leap status     : Normal

What do you think @ct2034?

@tonynajjar tonynajjar changed the title NTP monitor: implement diagnostic to check if connected to the correct source NTP monitor: implement diagnostic to check if synchronized to the correct source Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant