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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/bin/check-influxdb-q.rb +10 -4
- data/lib/sensu-plugins-influxdb-q/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b5da9f248b5432ea5fb9f30966302969cac98f
|
4
|
+
data.tar.gz: 0f1be2928fb827a91d75756aa849a4aca8838286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/bin/check-influxdb-q.rb
CHANGED
@@ -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}", "
|
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}", "
|
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}", "
|
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}", "
|
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
|
|
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
|
+
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-
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|