DRBD监控脚本

#!/bin/bash
role=($(drbdadm role all|tr "/" "\n"))
dstate=($(drbdadm dstate all|tr "/" "\n"))
cstate=`drbdadm cstate all`
if [ "Primary" = "${role[0]}" ]&& [ "Secondary" = "${role[1]}" ] && [ "UpToDate" = "$dstate{0}" ]&& [ "UpToDate" = "${dstate[1]}" ] && [ "Connected" = "$cstate" ];then
        echo "OK --MYSQL_DRBD_STATUS is ok!"
        #exit $STATE_OK
else

        echo "OK --MYSQL_DRBD_STATUS is ok!"
        #exit $STATE_CRITICAL
fi

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS