sensu-plugins-docker 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/bin/check-container.rb +12 -2
- data/lib/sensu-plugins-docker/version.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 481a29741da795dcebfcfaa118a632c598b59727
|
4
|
+
data.tar.gz: bb15b30628a2a1ba3bf8ccab1fbb6094ee7dd2fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ae1c762dc2e30912e8c6aa12fb9bc0ab4d1c2b377f440e9368e770bb0c16607cd854e8d5c1ec29c7c65da00d7a3734889bd426a1a19a23924e106dff7eb6948
|
7
|
+
data.tar.gz: 817fe789d493e9e880bd8182a626e0e76fe926572bc86bcb7376ef41175751f4fdd66623149da465222bf14c2acf7b772c305805e58372e987d6757281630247
|
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
|
+
## [1.2.0] - 2017-02-08
|
9
|
+
### Added
|
10
|
+
- check-container.rb: add an option to test image's tag (@obazoud)
|
11
|
+
|
8
12
|
## [1.1.5] - 2016-11-26
|
9
13
|
### Changed
|
10
14
|
- Loosen `sensu-plugin` dependency to `~> 1.2` (#44)
|
@@ -72,7 +76,8 @@ changes some options. Review your check commands before deploying this version.
|
|
72
76
|
### Added
|
73
77
|
- initial release
|
74
78
|
|
75
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.
|
79
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.2.0...HEAD
|
80
|
+
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.1.5...1.2.0
|
76
81
|
[1.1.5]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.1.4...1.1.5
|
77
82
|
[1.1.4]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.1.3...1.1.4
|
78
83
|
[1.1.3]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.1.2...1.1.3
|
data/bin/check-container.rb
CHANGED
@@ -52,6 +52,9 @@ class CheckDockerContainer < Sensu::Plugin::Check::CLI
|
|
52
52
|
short: '-c CONTAINER',
|
53
53
|
long: '--container CONTAINER',
|
54
54
|
required: true
|
55
|
+
option :tag,
|
56
|
+
short: '-t TAG',
|
57
|
+
long: '--tag TAG'
|
55
58
|
|
56
59
|
def run
|
57
60
|
client = create_docker_client
|
@@ -62,9 +65,16 @@ class CheckDockerContainer < Sensu::Plugin::Check::CLI
|
|
62
65
|
if response.body.include? 'no such id'
|
63
66
|
critical "#{config[:container]} is not running on #{config[:docker_host]}"
|
64
67
|
end
|
65
|
-
|
66
|
-
container_state =
|
68
|
+
body = JSON.parse(response.body)
|
69
|
+
container_state = body['State']['Status']
|
67
70
|
if container_state == 'running'
|
71
|
+
if config[:tag]
|
72
|
+
image = body['Config']['Image']
|
73
|
+
match = image.match(/^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$/)
|
74
|
+
unless match && match[4] == config[:tag]
|
75
|
+
critical "#{config[:container]}'s tag is '#{match[4]}', excepting '#{config[:tag]}'"
|
76
|
+
end
|
77
|
+
end
|
68
78
|
ok "#{config[:container]} is running on #{config[:docker_host]}."
|
69
79
|
else
|
70
80
|
critical "#{config[:container]} is #{container_state} on #{config[:docker_host]}."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-api
|
@@ -199,11 +199,11 @@ description: |-
|
|
199
199
|
metrics via `docker ps`
|
200
200
|
email: "<sensu-users@googlegroups.com>"
|
201
201
|
executables:
|
202
|
-
- metrics-docker-stats.rb
|
203
202
|
- check-container.rb
|
204
|
-
- check-container-logs.rb
|
205
203
|
- metrics-docker-container.rb
|
204
|
+
- metrics-docker-stats.rb
|
206
205
|
- check-docker-container.rb
|
206
|
+
- check-container-logs.rb
|
207
207
|
extensions: []
|
208
208
|
extra_rdoc_files: []
|
209
209
|
files:
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.6.
|
247
|
+
rubygems_version: 2.6.8
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Sensu plugins for docker
|