aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-10-10 01:11:40 +0000
committerGerrit Code Review <review@openstack.org>2017-10-10 01:11:40 +0000
commita08260bfa47800676cca72f9292f96759cdf5873 (patch)
tree3d1ad1d1fed170f2adee7ff8a4fee2cb526da9a2 /docker
parente2d302cbacaec70588a2e7d4e42462832c072ed7 (diff)
parentb56bad29fd7aec5262ea9250711a2d3a30bc203d (diff)
Merge "List all unhealthy containers" into stable/pike
Diffstat (limited to 'docker')
-rw-r--r--docker/services/sensu-client.yaml6
1 files changed, 5 insertions, 1 deletions
diff --git a/docker/services/sensu-client.yaml b/docker/services/sensu-client.yaml
index b64231cd..a535af46 100644
--- a/docker/services/sensu-client.yaml
+++ b/docker/services/sensu-client.yaml
@@ -39,13 +39,17 @@ parameters:
SensuDockerCheckCommand:
type: string
default: |
+ output=''
for i in $(docker ps --format '{{.ID}}'); do
if result=$(docker inspect --format='{{.State.Health.Status}}' $i 2>/dev/null); then
if [ "$result" != 'healthy' ]; then
- echo "$(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{json .State}}' $i)" && exit 2;
+ output="${output} ; $(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{(index .State.Health.Log 0).Output}}' $i)";
fi
fi
done
+ if [ ! -z "${output}" ]; then
+ echo ${output:3} && exit 2;
+ fi
SensuDockerCheckInterval:
type: number
description: The frequency in seconds the docker health check is executed.