Created
April 10, 2019 07:28
-
-
Save latenssi/4404c558f938510b4b0732a1327520e7 to your computer and use it in GitHub Desktop.
Healthchecks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVICE_NAME= | |
FAIL_URL= | |
OK_URL= | |
if [ -z `docker ps -q --no-trunc | grep $(docker-compose ps -q $SERVICE_NAME)` ]; | |
then curl -fsS --retry 3 $FAIL_URL; | |
else curl -fsS --retry 3 $OK_URL; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g') | |
THRESHOLD=80 | |
FAIL_URL= | |
OK_URL= | |
if [ "$CURRENT" -gt "$THRESHOLD" ]; | |
then curl -fsS --retry 3 $FAIL_URL; | |
else curl -fsS --retry 3 $OK_URL; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment