Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
`check_chrony_primary.sh` verifies that Chrony has selected a primary NTP source (`^*`) and checks Chrony\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s system tracking offset against administrator-defined warning and critical thresholds. Optional jitter thresholds can also be applied.
The plugin identifies the selected primary using `chronyc sources -n`. Offset and RMS offset are obtained from `chronyc tracking`; RMS offset is reported as jitter. These are system-level tracking metrics, not per-peer measurements. The offset threshold is applied to the absolute value, so positive and negative offsets of the same magnitude produce the same status.
This plugin is useful when monitoring must confirm that a primary source is selected as well as check synchronization metrics.
– Verifies a primary Chrony source is selected (`^*`) – Checks the absolute clock offset against warning and critical thresholds – Optionally checks RMS offset, reported as jitter – Supports local and remote Chrony queries – Returns standard Nagios plugin status codes – Provides offset and jitter performance data for graphing – Lightweight Bash implementation
– Bash – Chrony (`chronyc`) – `bc`
`check_chrony_primary.sh [-H host] -w offset[,jitter] -c offset[,jitter]`
Offset warning and critical thresholds are required. Jitter thresholds are optional. All threshold values are nonnegative and specified in seconds.
– `check_chrony_primary.sh -w 0.001 -c 0.002` – `check_chrony_primary.sh -w 0.001,0.010 -c 0.002,0.050` – `check_chrony_primary.sh -H ntpserver.example.com -w 0.001 -c 0.002`
– `OK` (0): Primary source selected; configured thresholds are not exceeded – `WARNING` (1): Warning threshold exceeded – `CRITICAL` (2): Critical threshold exceeded, or no primary source is selected – `UNKNOWN` (3): Invalid thresholds, missing data, or a Chrony query/evaluation error
Current Version
1.1.1
Last Release Date
2026-09-21
Owner
John Shorey
Website
https://github.com/shoreypu/nagios-plugins/tree/main/check_chrony_primary
Download URL
https://github.com/shoreypu/nagios-plugins/blob/main/check_chrony_primary/check_chrony_primary.sh
License
GPL
Compatible With
You must be logged in to submit a review.
To:
From: