sensu-plugins-influxdb-q 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: 6e650968fffac29cb93668649219d88c11010a53
4
- data.tar.gz: a15f03566144a6e6eba9ba7433f8ded3cee56b57
3
+ metadata.gz: e6b5da9f248b5432ea5fb9f30966302969cac98f
4
+ data.tar.gz: 0f1be2928fb827a91d75756aa849a4aca8838286
5
5
  SHA512:
6
- metadata.gz: 6737956edaf435950c5ccef0d4cac958a38be02586634868732e545cab8f84a3e550e935a51b6817dafabcd52758d6a263d185d27f06ef438cccc04d35305fd8
7
- data.tar.gz: e53267e4e3890564d0400b54e7ae0bc36508bb9677828fe33580b6a5ba34ffe4ede05dd27b0e44d2b570f63adf6b29887d2a7ac4fc6458178a10b47e9fd6c385
6
+ metadata.gz: f902b27a27d42352afda39341b342583ef421ac4e54b38dfe9c7f9c15b62139f43345562988cf4ea1eb1455578f018692dd3a1c398ae6b4eeb1ff7df97f6a16f
7
+ data.tar.gz: 4f71cb80f64a3db72af54f5425972f3545a34cc15e536bcd1e7889d9e4d2bc6ae567f0ca8765a897085241bebd9d93dc735142071a36f44331392447e69f54ce
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-08
9
13
  ### Added
10
14
  - Made --json-path optional and got rid of --debug
data/README.md CHANGED
@@ -20,6 +20,7 @@ Usage: check-influxdb-q.rb (options)
20
20
  -c, --crit <EXPR> Critical expression (e.g. value >= 10)
21
21
  --database <DATABASE> InfluxDB database (default: collectd)
22
22
  --dryrun Do not send events to sensu client socket
23
+ --handlers <HANDLERS> Comma separated list of handlers
23
24
  --host <HOST> InfluxDB host (default: localhost)
24
25
  --host-field <FIELD> InfluxDB measurement host field (default: host)
25
26
  -j, --json-path <PATH> JSON path for value matching (docs at http://goessner.net/articles/JsonPath)
@@ -30,6 +31,8 @@ Usage: check-influxdb-q.rb (options)
30
31
  -w, --warn <EXPR> Warning expression (e.g. value >= 5)
31
32
  ```
32
33
 
34
+ Use the --handlers command line option to specify which handlers you want to use for the generated events.
35
+
33
36
  ## Example
34
37
 
35
38
  A typical example could be the monitoring of interface errors when using the 'interface' collectd plugin.
@@ -85,6 +85,12 @@ class CheckInfluxDbQ < Sensu::Plugin::Check::CLI
85
85
  :long => "--host-field <FIELD>",
86
86
  :default => "host"
87
87
 
88
+ option :handlers,
89
+ :description => "Comma separated list of handlers",
90
+ :long => "--handlers <HANDLER>",
91
+ :proc => proc { |s| s.split(',') },
92
+ :default => []
93
+
88
94
  option :warn,
89
95
  :description => "Warning expression (e.g. value >= 5)",
90
96
  :short => "-w <EXPR>",
@@ -135,22 +141,22 @@ class CheckInfluxDbQ < Sensu::Plugin::Check::CLI
135
141
  end
136
142
 
137
143
  def send_ok(check_name, source, msg)
138
- event = {"name" => check_name, "source" => source, "status" => 0, "output" => "OK: #{msg}", "handler" => config[:handler]}
144
+ event = {"name" => check_name, "source" => source, "status" => 0, "output" => "#{self.class.name} OK: #{msg}", "handlers" => config[:handlers]}
139
145
  send_client_socket(event.to_json)
140
146
  end
141
147
 
142
148
  def send_warning(check_name, source, msg)
143
- event = {"name" => check_name, "source" => source, "status" => 1, "output" => "WARNING: #{msg}", "handler" => config[:handler]}
149
+ event = {"name" => check_name, "source" => source, "status" => 1, "output" => "#{self.class.name} WARNING: #{msg}", "handlers" => config[:handlers]}
144
150
  send_client_socket(event.to_json)
145
151
  end
146
152
 
147
153
  def send_critical(check_name, source, msg)
148
- event = {"name" => check_name, "source" => source, "status" => 2, "output" => "CRITICAL: #{msg}", "handler" => config[:handler]}
154
+ event = {"name" => check_name, "source" => source, "status" => 2, "output" => "#{self.class.name} CRITICAL: #{msg}", "handlers" => config[:handlers]}
149
155
  send_client_socket(event.to_json)
150
156
  end
151
157
 
152
158
  def send_unknown(check_name, source, msg)
153
- event = {"name" => check_name, "source" => source, "status" => 3, "output" => "UNKNOWN: #{msg}", "handler" => config[:handler]}
159
+ event = {"name" => check_name, "source" => source, "status" => 3, "output" => "#{self.class.name} UNKNOWN: #{msg}", "handlers" => config[:handlers]}
154
160
  send_client_socket(event.to_json)
155
161
  end
156
162
 
@@ -2,7 +2,7 @@ module SensuPluginsInfluxDbQ
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-influxdb-q
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
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin