sensu-plugins-docker-swarm 3.3.2 → 3.3.3
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/bin/check-service.rb +7 -1
- data/lib/sensu-plugins-docker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e544574cc69793d9cd6530d19c22d41ef734380985fc730b52a5a8b7daa401e7
|
|
4
|
+
data.tar.gz: fb3efb0794c7cd8f18959add22e79562ecebf6fed33c723122ee2218ae1e8467
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8fbc4b54a889806de58aa126207846b5ee724809b0aa5be1d5a80edf1dca4280eff85a54893c0b3a594cda3ec7e085ffd71fdd530006c8dcd933b9e7b970acf9
|
|
7
|
+
data.tar.gz: 65a802b0e2dc94ad34685c886c552e41428db609bf1f092768c3cb2fc1e6291dd0f57e07fe73c601bf5a1e8f42f76e7df1c705cffb3fc1d4ac4c60d9fa227ada
|
data/bin/check-service.rb
CHANGED
|
@@ -82,9 +82,15 @@ class CheckDockerService < Sensu::Plugin::Check::CLI
|
|
|
82
82
|
critical "service #{config[:service]} is not running on #{@client.uri}, but was returned by the API"
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
+
# Currently there is an outstanding issue in docker where the filter by name returns any services / tasks
|
|
86
|
+
# contain the name. ref - https://github.com/moby/moby/issues/32985
|
|
87
|
+
# Since there is no way to define an exact name filter, we assume the first record returned is the exact
|
|
88
|
+
# match and extract the ID to be used in tasks
|
|
89
|
+
service_id = body[0]['ID']
|
|
90
|
+
|
|
85
91
|
# Call /tasks to get the number of running replicas (this is how `docker service ls` works)
|
|
86
92
|
running_replicas = 0
|
|
87
|
-
path = "/tasks?filters=%7B%
|
|
93
|
+
path = "/tasks?filters=%7B%22id%22%3A%7B%22#{service_id}%22%3Atrue%7D%7D"
|
|
88
94
|
response = @client.call(path, false)
|
|
89
95
|
if response.code.to_i == 404
|
|
90
96
|
critical "service #{config[:service]} is not running on #{@client.uri}, tasks not found"
|