sensu-plugins-rancher-service 0.0.4 → 0.0.5
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/bin/check-rancher-service.rb +9 -7
- 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: d902999d0db11126e531f7478c702f5c57e75f24
|
4
|
+
data.tar.gz: 2c4ae62f41a6fb70391a8882e52699fa5b51369e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53c6dab4ed2380b540fb28b0c02684ccc927f1d2693d40134f67fb07980834b11bbb9d59f2198d45919074f05e0764dae66fd7f3a269ea0ba3f992f72bc7719d
|
7
|
+
data.tar.gz: 5ab684599c339de11496496a6b50af1daf06a8da5915c978d7b99b5ca7ae14a895d9383bdbc93c8810bcdbe56677ca6ea3bf527b17af592b9ca7b839c6a8400f
|
data/CHANGELOG.md
CHANGED
@@ -16,13 +16,6 @@ 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 :warn,
|
20
|
-
:description => "Warn instead of throwing a critical failure",
|
21
|
-
:short => "-w",
|
22
|
-
:long => "--warn",
|
23
|
-
:boolean => true,
|
24
|
-
:default => false
|
25
|
-
|
26
19
|
option :dryrun,
|
27
20
|
:description => "Do not send events to sensu client socket",
|
28
21
|
:long => "--dryrun",
|
@@ -96,6 +89,9 @@ class CheckRancherService < Sensu::Plugin::Check::CLI
|
|
96
89
|
end
|
97
90
|
|
98
91
|
def run
|
92
|
+
unmonitored = 0
|
93
|
+
unhealthy = 0
|
94
|
+
|
99
95
|
get_services().each do |service|
|
100
96
|
source = "#{service['stack_name']}_#{service['name']}.rancher.internal"
|
101
97
|
|
@@ -120,12 +116,18 @@ class CheckRancherService < Sensu::Plugin::Check::CLI
|
|
120
116
|
|
121
117
|
when nil
|
122
118
|
send_warning(check_name, source, "#{msg} not monitored")
|
119
|
+
unmonitored += 1
|
123
120
|
|
124
121
|
else
|
125
122
|
send_critical(check_name, source, "#{msg} is not healthy")
|
123
|
+
unhealthy += 1
|
126
124
|
end
|
127
125
|
end
|
128
126
|
end
|
129
127
|
end
|
128
|
+
|
129
|
+
critical("Found #{unhealthy} unhealthy instances") if unhealthy > 0
|
130
|
+
warning("Found #{unmonitored} instances not begin monitored") if unmonitored > 0
|
131
|
+
ok("All Rancher services instances are healthy")
|
130
132
|
end
|
131
133
|
end
|