sensu-plugins-rancher-service 0.0.13 → 0.0.14

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: f8045d06aef3081c78a30af6c01e2ac264c5e741
4
- data.tar.gz: 93e439469438b64f4fe528536dbb06da420dc8af
3
+ metadata.gz: 1fab1170bfab2b585c1fe55fb3cc55b732c5940f
4
+ data.tar.gz: 1a124895073d38b2172951449637b010c3b1d3d9
5
5
  SHA512:
6
- metadata.gz: 78da0c94f03b8b86a5a04c3e935fecb1ba1ee96677532b02afe688efbd84177903c4ac20b214b9a17f4ec3cff33f8ba86cf3423f8db7f9276ac241b230331633
7
- data.tar.gz: 3e9f34e56521037bca40eb64ec7d831525696054dfcab345c13b1cffbe9c750139da6051a8a7094b00928980ee3eb547140d7567ad89d7a676e9ae8ed3006716
6
+ metadata.gz: 070b90af5052e2a2dc034e8484fc3751dee224ab25b65cd83ee52acfc03e35958bb80d4ea4494290d2052e885d4f553c6527ec5de6464bdd99c5660742c8afa6
7
+ data.tar.gz: 1b6b0d4a23f1380d8c5b586c81432ccc7005778af40cf72971522f69b31d13d3cd632b92f2e886fdd9ad94a6718a0282031c8d30ec57f7bfda39c2c8a10b631d
@@ -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.14] - 2016-01-19
9
+ ### Added
10
+ - Added support for containers having the io.rancher.container.start_once set to true
11
+
8
12
  ## [0.0.13] - 2016-01-17
9
13
  ### Added
10
14
  - Fixed service check
@@ -143,33 +143,37 @@ class CheckRancherService < Sensu::Plugin::Check::CLI
143
143
  else
144
144
  container = get_container(container_name)
145
145
 
146
- skip = false
147
- if state.has_key?(container_name)
148
- if container['start_count'] > state[container_name]['start_count']
149
- send_warning(check_name, source, "#{msg} has restarted")
150
- skip = true
151
- end
146
+ if container['labels'].has_key?('io.rancher.container.start_once') and container['labels']['io.rancher.container.start_once']
147
+ send_ok(check_name, source, "#{msg} not monitored (start-once)"
152
148
  else
153
- state[container_name] = {}
154
- end
149
+ skip = false
150
+ if state.has_key?(container_name)
151
+ if container['start_count'] > state[container_name]['start_count']
152
+ send_warning(check_name, source, "#{msg} has restarted")
153
+ skip = true
154
+ end
155
+ else
156
+ state[container_name] = {}
157
+ end
155
158
 
156
- # update state
157
- state[container_name]['start_count'] = container['start_count']
159
+ # update state
160
+ state[container_name]['start_count'] = container['start_count']
158
161
 
159
- next if skip
162
+ next if skip
160
163
 
161
- # check if the service restarted
162
- case container['health_state']
163
- when 'healthy'
164
- send_ok(check_name, source, "#{msg} is healthy")
164
+ # check if the service restarted
165
+ case container['health_state']
166
+ when 'healthy'
167
+ send_ok(check_name, source, "#{msg} is healthy")
165
168
 
166
- when nil
167
- send_warning(check_name, source, "#{msg} not monitored")
168
- unmonitored += 1
169
+ when nil
170
+ send_warning(check_name, source, "#{msg} not monitored")
171
+ unmonitored += 1
169
172
 
170
- else
171
- send_critical(check_name, source, "#{msg} is not healthy")
172
- unhealthy += 1
173
+ else
174
+ send_critical(check_name, source, "#{msg} is not healthy")
175
+ unhealthy += 1
176
+ end
173
177
  end
174
178
  end
175
179
  end
@@ -2,7 +2,7 @@ module SensuPluginsRancherService
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 13
5
+ PATCH = 14
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-rancher-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
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-17 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin