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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e9c52fa218941ae5a5d0e65eeb7fd17b6f6e88d
4
- data.tar.gz: 8fc81637da314027324615863042a8115521039c
3
+ metadata.gz: d902999d0db11126e531f7478c702f5c57e75f24
4
+ data.tar.gz: 2c4ae62f41a6fb70391a8882e52699fa5b51369e
5
5
  SHA512:
6
- metadata.gz: 2ea98bfc98dcff2f5e24d6a8c3f52a1eeb9e80b7ee46b4e05891abed15ff23288d9b4f85e9164795c14fb82d4b58f418a9aa7ac189a071beb6dd944719053200
7
- data.tar.gz: 0e40aac2c99e82446fcd71bfd6c8257953d41fcae224a8456d92425f558ee90cbe1777dce33740a7a157967aff51278e2ad060ac152f993e5ea8809737b5e9a0
6
+ metadata.gz: 53c6dab4ed2380b540fb28b0c02684ccc927f1d2693d40134f67fb07980834b11bbb9d59f2198d45919074f05e0764dae66fd7f3a269ea0ba3f992f72bc7719d
7
+ data.tar.gz: 5ab684599c339de11496496a6b50af1daf06a8da5915c978d7b99b5ca7ae14a895d9383bdbc93c8810bcdbe56677ca6ea3bf527b17af592b9ca7b839c6a8400f
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-08
9
+ ### Added
10
+ - Provide final main status
11
+
8
12
  ## [0.0.4] - 2016-01-08
9
13
  ### Added
10
14
  - Fixed services loop
@@ -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
@@ -2,7 +2,7 @@ module SensuPluginsRancherService
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,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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti