Skip to content

Instantly share code, notes, and snippets.

@steverob
Last active January 2, 2016 16:59
Show Gist options
  • Save steverob/8333426 to your computer and use it in GitHub Desktop.
Save steverob/8333426 to your computer and use it in GitHub Desktop.
Check status of a web app
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!
@spritle
Copy link

spritle commented Jan 9, 2014

Pretty cool Steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment