Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # check if mysql slave is running
- log=/var/log/mysqlslave.log
- email=user@example.com
- date >> $log
- res=`mysql -u root -pPassword -h db.example.com -N -B -e "show status like 'Slave_running'"|cut -f2`
- if [ $res = 'ON' ]
- then
- echo 'running' >> $log
- else
- echo 'NOT RUNNING' >> $log
- echo "Mysql slave not running" |mail -s "Slave not running" $email
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement