sensu-plugins-rancher-service 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/bin/check-rancher-service.rb +10 -4
- data/lib/sensu-plugins-rancher-service/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd66af46962dbd0edf412f8469ff73df0a69b9f4
|
4
|
+
data.tar.gz: aaa3667a6a37a66431e04bb761e2591066a9d539
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0efe09234e8f37c3c6f545a30e13b1dec35fef0b244aa60ace0e6b9d4f5daa2cec71d7bfa05a378e635ebbc7958f027cad21a286d0991942eee489a82a7530e7
|
7
|
+
data.tar.gz: 38655493204550df98f1652b2deecaa6db0fa01540c7a6d043f8708cd61cd8b05d8dd345c45a234c89dc2eab1566c4d1170eb6b619d792db21bd650ad09fd5da
|
data/CHANGELOG.md
CHANGED
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
|
|