Skip to content

Instantly share code, notes, and snippets.

@spritle
Last active January 4, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spritle/8596184 to your computer and use it in GitHub Desktop.
Save spritle/8596184 to your computer and use it in GitHub Desktop.
MySQL Server Status Monitor
netstat -na | grep LISTEN | grep MYSQL_PORT
if [ $? != 0 ]; then
sudo service mysql start
#send email
fi
#Make the script executable
# $ chmod +x isalive.sh
#Add it to crontab (say every 10 minutes)
# $ crontab -e
#Add following:
# */10 * * * * /home/spritle/scripts/ismysql-alive.sh
#save it :) sleep well!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment