Created
October 18, 2010 21:03
-
-
Save flores/633056 to your computer and use it in GitHub Desktop.
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
# count DOWN servers by first excluding the key, frontends, and any servers that aren't "up" | |
# if DOWN servers exist, email the admin | |
wet:~# DOWN=$(./proxyctl "show stat" |egrep -v '^#|no check|FRONTEND|UP'); if [ ${#DOWN} -gt 0 ]; then echo $DOWN |mail -s "oh snap" admin@mysite.com; fi | |
# add it to the cron for every 5 minutes | |
wet:~# crontab -e | |
no crontab for root - using an empty one | |
crontab: installing new crontab | |
wet:~# | |
wet:~# | |
wet:~# | |
wet:~# crontab -l | |
# m h dom mon dow command | |
*/5 * * * * DOWN=$(./proxyctl "show stat" |egrep -v '^#|no check|FRONTEND|UP'); if [ ${#DOWN} -gt 0 ]; then echo $DOWN |mail -s "oh snap" admin@mysite.com; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment