Skip to content

Commit

Permalink
Bump to version 4.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jBRNDnl committed Jan 13, 2020
1 parent b28b2e4 commit 0f4cc51
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 20 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ deploy:
on:
tags: true
all_branches: true
rvm: 2.3.0
rvm: 2.4.1
rvm: 2.4.1
- provider: rubygems
api_key:
secure: Belk8rDqJbAISGNyULiLYf6IVRBNvQ4BxYI3dT5pzeWL3DIUTdUVnXRGRAonhhxAQhZ38ldfarZanTeYL4j51aWSK31IMV8hxpj0ZfNDs9eWeJ7xT7/Lq8uPB4Xpby+wHxV3MbBk3amE2CF5xrDxYrK4vek4h8lr+gbY9PuM73RQ9WmmOGeX131DDnFDjwqDiWQCzjmkIJq0lHAuj2Lts95SvuRx1dMDCD+2hyAaWWnZdpOutxDlIRKyZ/JxIyuLMGgFbgXVxOOiIwNfqMI1hFf8ZPVg5TuYAJfbnDwfBR2MzvFu560sFesIUmJM+QQjNYGhdHVdrlY1XFkIk98ekZetrAYgsbioz85DkCGHBPOFdtImUhlIVcSzvr8Gj9t2f2iQJSTPlgfUDtqJ+rra58or2pxZIiMwLHcntnOKMEn7h7l7AhNCD+UD5rg2kb06pkH+FmYozJzoa07DW+PnKYPM9TptHnsAcRTLVkr5/hJG/mw4rE+IMZa71dvdeq2yeuNBka2uL/95DjIQyia7xDwxu7P5LnBPxShF33dRpNXEn8maaVcivPC3yvtskbY5BfiLuAMHd/aBZS/SqX8fxoU2gZpWtYlAS261giNU16RNnaU6pQNj/zahnvZxJU7k67POm3UPVstDZ6xMDHYafE3bUmxmXfBOvRdev6xQzvc=
gem: sensu-plugins-chrony
on:
tags: true
all_branches: true
rvm: 2.4.1
repo: sensu-plugins/sensu-plugins-chrony
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)

## [Unreleased]
## [1.0.2] - 2020-01-09


## [4.0.0] - 2020-01-13
### Fixed
- Added sensu bonsai.
- Bumped bundler to 2.1
- Upgraded versions to make it build again.

### Breaking Changes
- Update minimum required ruby version to 2.3. Drop unsupported ruby versions.
- Bump `sensu-plugin` dependency from `~> 1.2` to `~> 4.0` you can read the changelog entries for [4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#400---2018-02-17), [3.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#300---2018-12-04), and [2.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29)

### Added
- Travis build automation to generate Sensu Asset tarballs that can be used n conjunction with Sensu provided ruby runtime assets and the Bonsai Asset Index
- Require latest sensu-plugin for [Sensu Go support](https://github.com/sensu-plugins/sensu-plugin#sensu-go-enablement)

## [1.0.1] - 2018-05-03
### Fixed
- Fixes "undefined method `empty?"` (@jwatroba)
Expand Down
96 changes: 84 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
# Sensu plugin for monitoring Chrony NTP


[![Sensu Bonsai Asset](https://img.shields.io/badge/Bonsai-Download%20Me-brightgreen.svg?colorB=89C967&logo=sensu)](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-chrony)
[![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.

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.
## Sensu Chrony Checks Plugin

## Installation

System-wide installation:
- [Overview](#overview)
- [Files](#files)
- [Usage](#usage)
- [Sensu Asset](#sensu-asset)
- [Installation](#installation)
- [Sensu Go](#sensu-go)
- [Asset registration](#asset-registration)
- [Check definition](#check-definition)
- [Sensu Core](#sensu-core)
- [Check definition](#check-definition)
- [Author](#author)

$ gem install sensu-plugins-chrony
### Overiew

Embedded sensu installation:
A sensu plugin to monitor Chrony NTP. There is also a metrics plugin for collecting things like offset, delay etc.

$ /opt/sensu/embedded/bin/gem install sensu-plugins-chrony
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
### Files

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

## Usage
### Usage

The plugin accepts the following command line options:

Expand All @@ -44,5 +50,71 @@ Usage: check-chrony.rb (options)

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](https://bonsai.sensu.io/assets/sensu/sensu-ruby-runtime) in the [Bonsai Asset Index](bonsai.sensu.io).

## 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](https://bonsai.sensu.io/assets/jBRNDnl/sensu-plugins-chrony).

#### Check definition

```yaml
---
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
```json
{
"checks": {
"check-chrony": {
"command": "check-chrony.rb",
"subscribers": ["ALL"],
"interval": 60,
"refresh": 60
}
}
}
```

## Author
Matteo Cerutti - <[email protected]>
4 changes: 2 additions & 2 deletions bin/check-chrony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def run
send_critical(check_name, msg)
elsif stratum >= config[:warn_stratum]
msg += ", expected < #{config[:warn_stratum]}"
send_critical(check_name, msg)
send_waning(check_name, msg)
else
send_ok(check_name, msg)
end
Expand All @@ -150,7 +150,7 @@ def run
send_critical(check_name, msg)
elsif offset >= config[:warn_offset] || offset < -config[:warn_offset]
msg += ", expected > -#{config[:warn_offset]} and < #{config[:warn_offset]}"
send_critical(check_name, msg)
send_waning(check_name, msg)
else
send_ok(check_name, msg)
end
Expand Down
6 changes: 3 additions & 3 deletions lib/sensu-plugins-chrony/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

module SensuPluginsChrony
module Version
MAJOR = 2
MINOR = 2
PATCH = 1
MAJOR = 4
MINOR = 0
PATCH = 0

VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
Expand Down

0 comments on commit 0f4cc51

Please sign in to comment.