#! /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
為樂都等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務,及樂都網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務為做網(wǎng)站、成都網(wǎng)站建設(shè)、樂都網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務,秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!