Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin options #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-chrony.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-chrony)
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-chrony.svg)](https://badge.fury.io/rb/sensu-plugins-chrony)
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chrony/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chrony)
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chrony/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-chrony)
[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-chrony.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-chrony)
[![Community Slack](https://slack.sensu.io/badge.svg)](https://slack.sensu.io/badge)

A sensu plugin to monitor Chrony NTP. There is also a metrics plugin for collecting things like offset, delay etc.
Expand Down Expand Up @@ -33,12 +30,12 @@ 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)
-C, --chronyc-cmd <PATH> Path to chronyc executable (default: /usr/bin/chronyc)
-c, --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)
--handlers <HANDLER> Comma separated list of handlers
-w, --warn-offset <OFFSET> Warn if OFFSET exceeds current offset (ms)
--warn-stratum <STRATUM> Warn if STRATUM exceeds current stratum
```

Expand Down
4 changes: 3 additions & 1 deletion bin/check-chrony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
class CheckChrony < Sensu::Plugin::Check::CLI
option :chronyc_cmd,
description: 'Path to chronyc executable (default: /usr/bin/chronyc)',
short: '-c <PATH>',
short: '-C <PATH>',
long: '--chronyc-cmd <PATH>',
default: '/usr/bin/chronyc'

option :warn_offset,
description: 'Warn if OFFSET exceeds current offset (ms)',
short: '-w <OFFSET>',
long: '--warn-offset <OFFSET>',
proc: proc(&:to_f),
default: 50

option :crit_offset,
description: 'Critical if OFFSET exceeds current offset (ms)',
short: '-c <OFFSET>',
long: '--crit-offset <OFFSET>',
proc: proc(&:to_f),
default: 100
Expand Down