Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #375 from SUSE/vladi/no-monit-summary
Browse files Browse the repository at this point in the history
Don't use "monit summary" in container readiness probe
  • Loading branch information
mook-as authored Jul 27, 2018
2 parents ec5724d + 02a7b97 commit d62c076
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/dockerfiles/readiness-probe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

set -o errexit -o nounset

# Grab monit port
monit_port=$(awk '/httpd port/ { print $4 }' /etc/monitrc)

# Check that monit thinks everything is ready
/var/vcap/bosh/bin/monit summary | gawk '
BEGIN { status = 0 }
$1 == "Process" && $3 != "running" { print ; status = 1 }
$1 == "File" && $3 != "accessible" { print ; status = 1 }
END { exit status }
curl -s -u admin:${MONIT_PASSWORD} http://127.0.0.1:${monit_port}/_status | gawk '
BEGIN { status = 0 }
$1 == "status" && $2 != "running" && $2 != "accessible" { print ; status = 1 }
END { exit status }
'

# Check that any additional readiness checks are ready
Expand Down

0 comments on commit d62c076

Please sign in to comment.