sensu-plugins-chrony 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b23197137ffd6dcadea7434ea6812ffbfb56b23
4
- data.tar.gz: 299f681a4ba5bf7d0f3dd4b8374297d9c7001f6a
3
+ metadata.gz: a7bd01527c697178934ed9c59a6df46b302fa1b5
4
+ data.tar.gz: 145cc7031f9698f76766964ea86d875b422e5164
5
5
  SHA512:
6
- metadata.gz: 9e23cdcdcab5d88c05f00f134f8261c7cf0e614e9d49e0bf7691dc3bc1f05fe93610607c2a3ab46935b4c72e59b00e1089bdbec9faf5ed8dc338aa47d13b4b18
7
- data.tar.gz: 3fa7c032151f17027a186f4657889b29fe8ebec62fba5e7e75451cd16a837ea638ad98607c75ef76767fd5c4235a65f7151e0252fe56ed04650eaea6d3cbdb8e
6
+ metadata.gz: 2741c39c02ffe360b7fcf609b6efae4f8b64dbd65de6e151b49f918bf86f5353b49f8c6b32fbeb99262f0538209e08fe26fdf8f95ab6c9dee8a9a6e1a18f60da
7
+ data.tar.gz: d9bf4693647701a191d2af2fd29ca1708a31ea2e2ff8665c9e80393bdbe6e05325ad22106dbab335faaa37f4810dd378bad49f043470b282c31f8cec16478d38
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## [0.0.5] - 2016-01-14
9
+ ### Added
10
+ - Added --handlers command line option
11
+
8
12
  ## [0.0.4] - 2016-01-14
9
13
  ### Added
10
14
  - not using config[:handler]
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  A sensu plugin to monitor Chrony NTP.
4
4
 
5
- The plugin generates multiple OK/WARN/CRIT/UNKNOWN events via the sensu client socket (https://sensuapp.org/docs/latest/clients#client-socket-input)
6
- so that you do not miss state changes when monitoring offset, stratum and status.
5
+ 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.
7
6
 
8
7
  ## Usage
9
8
 
@@ -15,9 +14,12 @@ Usage: check-chrony.rb (options)
15
14
  --crit-offset <OFFSET> Critical if OFFSET exceeds current offset (ms)
16
15
  --crit-stratum <STRATUM> Critical if STRATUM exceeds current stratum
17
16
  --dryrun Do not send events to sensu client socket
17
+ --handlers <HANDLERS> Comma separated list of handlers
18
18
  --warn-offset <OFFSET> Warn if OFFSET exceeds current offset (ms)
19
19
  --warn-stratum <STRATUM> Warn if STRATUM exceeds current stratum
20
20
  ```
21
21
 
22
+ Use the --handlers command line option to specify which handlers you want to use for the generated events.
23
+
22
24
  ## Author
23
25
  Matteo Cerutti - <matteo.cerutti@hotmail.co.uk>
data/bin/check-chrony.rb CHANGED
@@ -40,6 +40,12 @@ class CheckChrony < Sensu::Plugin::Check::CLI
40
40
  :proc => proc(&:to_i),
41
41
  :default => 16
42
42
 
43
+ option :handlers,
44
+ :description => "Comma separated list of handlers",
45
+ :long => "--handlers <HANDLER>",
46
+ :proc => proc { |s| s.split(',') },
47
+ :default => []
48
+
43
49
  option :dryrun,
44
50
  :description => "Do not send events to sensu client socket",
45
51
  :long => "--dryrun",
@@ -60,22 +66,22 @@ class CheckChrony < Sensu::Plugin::Check::CLI
60
66
  end
61
67
 
62
68
  def send_ok(check_name, msg)
63
- event = {"name" => check_name, "status" => 0, "output" => "OK: #{msg}"}
69
+ event = {"name" => check_name, "status" => 0, "output" => "#{self.class.name} OK: #{msg}", "handlers" => config[:handlers]}
64
70
  send_client_socket(event.to_json)
65
71
  end
66
72
 
67
73
  def send_warning(check_name, msg)
68
- event = {"name" => check_name, "status" => 1, "output" => "WARNING: #{msg}"}
74
+ event = {"name" => check_name, "status" => 1, "output" => "#{self.class.name} WARNING: #{msg}", "handlers" => config[:handlers]}
69
75
  send_client_socket(event.to_json)
70
76
  end
71
77
 
72
78
  def send_critical(check_name, msg)
73
- event = {"name" => check_name, "status" => 2, "output" => "CRITICAL: #{msg}"}
79
+ event = {"name" => check_name, "status" => 2, "output" => "#{self.class.name} CRITICAL: #{msg}", "handlers" => config[:handlers]}
74
80
  send_client_socket(event.to_json)
75
81
  end
76
82
 
77
83
  def send_unknown(check_name, msg)
78
- event = {"name" => check_name, "status" => 3, "output" => "UNKNOWN: #{msg}"}
84
+ event = {"name" => check_name, "status" => 3, "output" => "#{self.class.name} UNKNOWN: #{msg}", "handlers" => config[:handlers]}
79
85
  send_client_socket(event.to_json)
80
86
  end
81
87
 
@@ -2,7 +2,7 @@ module SensuPluginsChrony
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-chrony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti