Last active
January 4, 2016 08:29
-
-
Save spritle/8596184 to your computer and use it in GitHub Desktop.
MySQL Server Status Monitor
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
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