sensu-plugins-docker-swarm 3.3.0 → 3.3.1
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 +4 -4
- data/README.md +0 -6
- data/bin/check-service.rb +8 -3
- data/lib/sensu-plugins-docker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd23b0f4352ebbf15c28779014a01cba03ee2d5ceb4fe34bb3746bdc7f98709f
|
|
4
|
+
data.tar.gz: ee886589da87002b0bd3e8a637592cf1ea5e2d71ec6946d6909c497b56623b9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1751570e2c8ead59606c95f881e6edf474a0112f6a65ffe4fe9d549c89347052ed84852f7c6880ec848596cf23fec07b7e9a38e1950442eb3e197c49dcd99747
|
|
7
|
+
data.tar.gz: b8d29964e6cfe7fefd05c711fce53ccdb52aa001e193ee1c40d93078528a933d3c421e2beeb47b67f44c5d45fabbcf201b3b5a45aaf3f644b9e26a0ec31eaf4a
|
data/README.md
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
## Sensu-Plugins-docker
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/sensu-plugins/sensu-plugins-docker)
|
|
4
|
-
[](http://badge.fury.io/rb/sensu-plugins-docker)
|
|
5
|
-
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-docker)
|
|
6
|
-
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-docker)
|
|
7
|
-
[](https://gemnasium.com/sensu-plugins/sensu-plugins-docker)
|
|
8
|
-
|
|
9
3
|
## Functionality
|
|
10
4
|
This check supports docker versions >= 1.18. Check docker-engine API for more information
|
|
11
5
|
|
data/bin/check-service.rb
CHANGED
|
@@ -70,12 +70,17 @@ class CheckDockerService < Sensu::Plugin::Check::CLI
|
|
|
70
70
|
path = "/services?filters=%7B%22name%22%3A%7B%22#{config[:service]}%22%3Atrue%7D%7D"
|
|
71
71
|
response = @client.call(path, false)
|
|
72
72
|
if response.code.to_i == 404
|
|
73
|
-
critical "service #{config[:service]} is not running on #{@client.uri}
|
|
73
|
+
critical "service #{config[:service]} is not running on #{@client.uri}"
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# Pass the number of replicas the service should be running
|
|
77
77
|
body = parse_json(response)
|
|
78
|
-
intended_replicas =
|
|
78
|
+
intended_replicas = 0
|
|
79
|
+
begin
|
|
80
|
+
intended_replicas = body[0]['Spec']['Mode']['Replicated']['Replicas']
|
|
81
|
+
rescue KeyError => e
|
|
82
|
+
critical "service #{config[:service]} is not running on #{@client.uri}, but was returned by the API"
|
|
83
|
+
end
|
|
79
84
|
|
|
80
85
|
# Call /tasks to get the number of running replicas (this is how `docker service ls` works)
|
|
81
86
|
running_replicas = 0
|
|
@@ -95,7 +100,7 @@ class CheckDockerService < Sensu::Plugin::Check::CLI
|
|
|
95
100
|
|
|
96
101
|
# If the number of running replicas is not what the service expects, return critical
|
|
97
102
|
if intended_replicas != running_replicas
|
|
98
|
-
critical "service #{config[:service]} is not running the intended number of replicas"
|
|
103
|
+
critical "service #{config[:service]} is not running the intended number of replicas. #{running_replicas} replicas are running when #{intended_replicas} was expected"
|
|
99
104
|
end
|
|
100
105
|
ok "#{config[:service]} is running correctly on #{@client.uri}."
|
|
101
106
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sensu-plugins-docker-swarm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Veea Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sensu-plugin
|