sensu-plugins-rancher-service 0.0.6 → 0.0.7

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: 77e6f98064f778f902a95d8f9df85426ddddbd9e
4
- data.tar.gz: f4efd5642c4ba5d4267103b998eef10a93ec90b2
3
+ metadata.gz: dd66af46962dbd0edf412f8469ff73df0a69b9f4
4
+ data.tar.gz: aaa3667a6a37a66431e04bb761e2591066a9d539
5
5
  SHA512:
6
- metadata.gz: 82c35dfc23876444bdb59034723f8966507892574eeea7cf0ff78799b6445637991cbf007000358fd4c35e58ea3c4caa408fd43bb3bd1837e05a5ebbf105629e
7
- data.tar.gz: a35458ef97fad7b270207a817ca926954f24f832c5b93580f6003eb65c6e657c328cb75adfc9f4df0728518381c6789ec9a59455e17fc9b03f4177ff13febf21
6
+ metadata.gz: 0efe09234e8f37c3c6f545a30e13b1dec35fef0b244aa60ace0e6b9d4f5daa2cec71d7bfa05a378e635ebbc7958f027cad21a286d0991942eee489a82a7530e7
7
+ data.tar.gz: 38655493204550df98f1652b2deecaa6db0fa01540c7a6d043f8708cd61cd8b05d8dd345c45a234c89dc2eab1566c4d1170eb6b619d792db21bd650ad09fd5da
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.7] - 2016-01-14
9
+ ### Added
10
+ - Added --handlers command line option
11
+
8
12
  ## [0.0.6] - 2016-01-08
9
13
  ### Added
10
14
  - Removed unused config[:handler]
data/README.md CHANGED
@@ -25,9 +25,12 @@ The plugin accepts the following command line options:
25
25
  Usage: check-rancher-service.rb (options)
26
26
  --api-url <URL> Rancher Metadata API URL (default: http://rancher-metadata/2015-07-25)
27
27
  --dryrun Do not send events to sensu client socket
28
+ --handlers <HANDLERS> Comma separated list of handlers
28
29
  -w, --warn Warn instead of throwing a critical failure
29
30
  ```
30
31
 
32
+ Use the --handlers command line option to specify which handlers you want to use for the generated events.
33
+
31
34
  ## Deployment
32
35
 
33
36
  In order to run this check, you might want to deploy a sensu-client running as a container in Rancher, acting as a "sensu proxy".
@@ -16,6 +16,12 @@ class CheckRancherService < Sensu::Plugin::Check::CLI
16
16
  :proc => proc { |s| s.gsub(/\/$/, '') },
17
17
  :default => "http://rancher-metadata/2015-07-25"
18
18
 
19
+ option :handlers,
20
+ :description => "Comma separated list of handlers",
21
+ :long => "--handlers <HANDLER>",
22
+ :proc => proc { |s| s.split(',') },
23
+ :default => []
24
+
19
25
  option :dryrun,
20
26
  :description => "Do not send events to sensu client socket",
21
27
  :long => "--dryrun",
@@ -36,22 +42,22 @@ class CheckRancherService < Sensu::Plugin::Check::CLI
36
42
  end
37
43
 
38
44
  def send_ok(check_name, source, msg)
39
- event = {"name" => check_name, "source" => source, "status" => 0, "output" => "OK: #{msg}"}
45
+ event = {"name" => check_name, "source" => source, "status" => 0, "output" => "#{self.class.name} OK: #{msg}", "handlers" => config[:handlers]}
40
46
  send_client_socket(event.to_json)
41
47
  end
42
48
 
43
49
  def send_warning(check_name, source, msg)
44
- event = {"name" => check_name, "source" => source, "status" => 1, "output" => "WARNING: #{msg}"}
50
+ event = {"name" => check_name, "source" => source, "status" => 1, "output" => "#{self.class.name} WARNING: #{msg}", "handlers" => config[:handlers]}
45
51
  send_client_socket(event.to_json)
46
52
  end
47
53
 
48
54
  def send_critical(check_name, source, msg)
49
- event = {"name" => check_name, "source" => source, "status" => 2, "output" => "CRITICAL: #{msg}"}
55
+ event = {"name" => check_name, "source" => source, "status" => 2, "output" => "#{self.class.name} CRITICAL: #{msg}", "handlers" => config[:handlers]}
50
56
  send_client_socket(event.to_json)
51
57
  end
52
58
 
53
59
  def send_unknown(check_name, source, msg)
54
- event = {"name" => check_name, "source" => source, "status" => 3, "output" => "UNKNOWN: #{msg}"}
60
+ event = {"name" => check_name, "source" => source, "status" => 3, "output" => "#{self.class.name} UNKNOWN: #{msg}", "handlers" => config[:handlers]}
55
61
  send_client_socket(event.to_json)
56
62
  end
57
63
 
@@ -2,7 +2,7 @@ module SensuPluginsRancherService
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 6
5
+ PATCH = 7
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-rancher-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti