Random Project
Plugins

check_chrony_primary

0 (0)
212
0
0

Thank you for your review!

Your review has been submitted and is pending approval.

Description

###### Overview

`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.

###### Features

– 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

###### Requirements

– Bash
– Chrony (`chronyc`)
– `bc`

###### Usage

`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.

###### Example Commands

– `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`

###### Nagios Status

– `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


Project Details

Recommend

To:


From: