sources¶
Live samples from the local time daemon (no log files needed).
- chrony:
chronyc -c tracking(CSV). Field order from chrony'sclient.c: RefID, name, stratum, ref time, System time (current correction; positive = system clock slow, i.e. the ntpd sign convention), last offset (positive = local fast), RMS offset, frequency, residual freq, skew, root delay, root dispersion, update interval, leap status.chronyc -c sourcestatsadds per-source estimated offsets (same quantity as statistics.log "Est offset", positive = local fast, negated here). -
ntpd / NTPsec:
ntpq -c rvsystem variables (offsetin ms, ntpd convention;frequencyppm;sys_jitter/clk_jitterms). -
linuxptp:
pmc -u -b 0 'GET CURRENT_DATA_SET' 'GET TIME_STATUS_NP'(offsetFromMasterandmaster_offsetin ns, local - master, negated here;meanPathDelayns;gmPresent). - facebook/time:
ptpcheck statsJSON (ptp.offset_ns, local - master as reported by ptp4l, negated here;ptp.mean_path_delay_ns).
Only a subprocess is used; nothing is installed or configured. The command
can be overridden (e.g. ["ssh", "host", "chronyc"]) to watch a remote host.
LocalWatch
¶
Poll the local daemon periodically (same interface as :class:ntpstats.monitor.Monitor).
parse_pmc(text)
¶
Parse pmc CURRENT_DATA_SET / TIME_STATUS_NP responses.
parse_ptpcheck_stats(text)
¶
Parse ptpcheck stats JSON (facebook/time).
prometheus_query_range(url, query, start, end, step='60', timeout=30.0)
¶
Run a Prometheus /api/v1/query_range request and return the JSON document.