#! /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
为乐都等地区用户提供了全套网页设计制作服务,及乐都网站建设行业解决方案。主营业务为做网站、成都网站建设、乐都网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!
分享标题:nagios监控ab复制
文章出自:http://scyingshan.cn/article/pchshh.html