Created
March 16, 2019 13:04
-
-
Save gdm/1448d66a76561f4640d78383758a084c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| hhvm.conf: | |
| check program check-hhvm with path "/etc/monit/bin/check-hhvm.sh" | |
| if status != 0 then alert | |
| if status != 0 | |
| then exec "/usr/sbin/service hhvm restart" | |
| /etc/monit/bin/check-hhvm.sh: | |
| #!/bin/bash | |
| HOST=yourhost | |
| ts=$(date +%F-%H%M%S) | |
| response=$(curl --silent -I --resolve "www.${HOST}.com:443:127.0.0.1' "https://www.${HOST}.com/?ping=$ts" | grep 'HTTP/1.1' | grep 200 ) | |
| if [ -z "$response" ] | |
| then | |
| exit 1 | |
| else | |
| exit 0 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment