Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


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.

v4.0.1-alpha · public · Published 24 days ago

README
Asset Definition
Release Notes
Release Assets

Sensu plugin for monitoring Chrony NTP

Sensu Bonsai Asset
Build Status
Gem Version
Code Climate
Test Coverage
Dependency Status
Community Slack

Sensu Chrony Checks Plugin

Overiew

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.

Files

  • bin/check-chrony.rb
  • bin/metrics-chrony.rb

Usage

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.

Sensu Asset

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.

Installation

sensuctl asset add jBRNDnl/sensu-plugins-chrony --rename jbrndnl/sensu-plugins-chrony

Sensu Go

Asset registration

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.

Check definition

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

Sensu Core

System-wide installation:

$ gem install sensu-plugins-chrony

Embedded sensu installation:

$ /opt/sensu/embedded/bin/gem install sensu-plugins-chrony

Check definition

{
  "checks": {
    "check-chrony": {
      "command": "check-chrony.rb",
      "subscribers": ["ALL"],
      "interval": 60,
      "refresh": 60
    }
  }
}

Author

Matteo Cerutti - matteo.cerutti@hotmail.co.uk

Are you sure you want to report this asset?

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.

×

You must be signed in to report this asset.

Sign In with Github

Download

×

Either download the source code:

Download Source

Or download the asset definition: