您好,登錄后才能下訂單哦!
#! /bin/sh
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4
mysqlpath='/opt/mysql/mysql/bin'
crit="No"
null="NULL"
ok="Yes"
usage1="Usage: $0 -u user -p password -H Hostname"
exitstatus=$STATE_WARNING #default
while test -n "$1"; do
case "$1" in
-u)
user=$2
shift
;;
-p)
pass=$2
shift
;;
-h)
echo $usage1;
echo
exit $STATE_UNKNOWN
;;
-H)
host=$2
shift
;;
*)
echo "Unknown argument: $1"
echo $usage1;
echo
exit $STATE_UNKNOWN
;;
esac
shift
done
answer=`$mysqlpath/mysql -u $user -p$pass -e 'show slave status\G' | /bin/grep Slave_IO_Running | /bin/cut -f2 -d:`
# if null, critical
if [ $answer = $null ]; then
echo CRITICAL - $host - Slave IO Running is answering Null
exit $STATE_CRITICAL;
fi
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。