License
MIT License
This asset is forked from an upstream project at https://github.com/sensu-plugins/sensu-plugins-chrony that does not yet exist as a Bonsai asset.
forked from https://github.com/sensu-plugins/sensu-plugins-chrony
v4.0.0-alpha · public · Published about 5 years ago
A sensu plugin to monitor Chrony NTP. There is also a metrics plugin for collecting things like offset, delay etc.
The plugin generates multiple OK/WARN/CRIT/UNKNOWN check events via the sensu client socket (https://sensuapp.org/docs/latest/clients#client-socket-input) so that you do not miss state changes when monitoring offset, stratum and status.
The plugin accepts the following command line options:
Usage: check-chrony.rb (options)
-c, --chronyc-cmd <PATH> Path to chronyc executable (default: /usr/bin/chronyc)
--crit-offset <OFFSET> Critical if OFFSET exceeds current offset (ms)
--crit-stratum <STRATUM> Critical if STRATUM exceeds current stratum
--dryrun Do not send events to sensu client socket
--handlers <HANDLERS> Comma separated list of handlers
--warn-offset <OFFSET> Warn if OFFSET exceeds current offset (ms)
--warn-stratum <STRATUM> Warn if STRATUM exceeds current stratum
Use the --handlers command line option to specify which handlers you want to use for the generated events.
The Sensu assets packaged from this repository are built against the Sensu ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator or handler), make sure you include the corresponding Sensu ruby runtime asset in the list of assets needed by the resource. The current ruby-runtime assets can be found here in the Bonsai Asset Index.
sensuctl asset add jBRNDnl/sensu-plugins-chrony --rename jbrndnl/sensu-plugins-chrony
Assets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:
sensuctl asset add jBRNDnl/sensu-plugins-chrony --renamd jbrndnl/sensu-plugins-chrony
If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai asset index page.
---
type: CheckConfig
api_version: core/v2
metadata:
name: check-chrony
namespace: default
labels: null
annotations: null
spec:
check_hooks: null
command: check-chrony.rb
env_vars: null
handlers: []
interval: 60
publish: true
round_robin: false
runtime_assets:
- jbrndnl/sensu-plugins-chrony
- sensu/sensu-ruby-runtime
subscriptions:
- linux
System-wide installation:
$ gem install sensu-plugins-chrony
Embedded sensu installation:
$ /opt/sensu/embedded/bin/gem install sensu-plugins-chrony
{
"checks": {
"check-chrony": {
"command": "check-chrony.rb",
"subscribers": ["ALL"],
"interval": 60,
"refresh": 60
}
}
}
Matteo Cerutti - matteo.cerutti@hotmail.co.uk
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×