#!/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
2016-11-28
DRBD监控脚本
评论
发表评论
姓 名: