[root@db-server-61-001 script]# ll
total 4
-rwxr-xr-x 1 root root 294 Jun 20 03:38 check_mysql_slave
[root@db-server-61-001 script]# cat /software/script/check_mysql_slave
#!/bin/bash
declare -a slave_is
slave_is=($(mysql -uroot -pgb52054.GB@ -e “show slave status\G” |grep Running |awk ‘{print $2}’))
if [ “${slave_is[0]}” = “Yes” -a “${slave_is[1]}” = “Yes” ]
fi
[root@db-server-61-001 script]# ./check_mysql_slave
OK -slave isrunning
发表评论
要发表评论,您必须先登录。