Last active
January 2, 2016 16:59
-
-
Save steverob/8333426 to your computer and use it in GitHub Desktop.
Check status of a web app
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
wget --timeout=3 --tries=1 --spider --no-check-certificate http://mysite.com | |
if [ $? -ne 0 ];then | |
echo "Site Down" | mail -s "Site Down" admin@yourdomain.com | |
fi | |
#Make the script executable | |
# $ chmod +x isalive.sh | |
#Add it to crontab (say every 10 minutes) | |
# $ crontab -e | |
#Add following: | |
# */10 * * * * /home/steve/scripts/isalive.sh | |
#save it :) sleep well! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pretty cool Steve