Skip to content

Instantly share code, notes, and snippets.

View schellenbergk's full-sized avatar
💭
Making magic happen at @3magine

Karl Schellenberg schellenbergk

💭
Making magic happen at @3magine
View GitHub Profile
@schellenbergk
schellenbergk / cron_monitor_mysql
Last active October 19, 2017 15:27 — forked from mheadd/monitor.sh
Simple bash script to check whether MySQL is running.
#!/bin/bash
# crontab -e
# add:
# */5 * * * * /root/bin/cron_monitor_mysql > /dev/null 2>&1
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";