#!/bin/bash
MYSQLUSER=root
MYSQLPS=000000
MYSQLBIN=/usr/local/webserver/mysql/bin/mysqladmin
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_NUM=$($MYSQLBIN -u$MYSQLUSER -p$MYSQLPS version | grep "Server version" | grep "5.5.2-m2-log"|wc -l)
if [ $? -ne 0 ];then
echo "Please Check the Plugins"
exit $STATE_UNKNOWN
fi
if [ "${STATE_NUM}" -eq 1 ];then
echo "Check OK,MySQL Replication is running"
echo {`$MYSQLBIN -u$MYSQLUSER -p$MYSQLPS version`}
exit $STATE_OK
else
echo "Check Critical,MySQL Replication is error"
exit $STATE_CRITICAL
MYSQLUSER=root
MYSQLPS=000000
MYSQLBIN=/usr/local/webserver/mysql/bin/mysqladmin
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_NUM=$($MYSQLBIN -u$MYSQLUSER -p$MYSQLPS version | grep "Server version" | grep "5.5.2-m2-log"|wc -l)
if [ $? -ne 0 ];then
echo "Please Check the Plugins"
exit $STATE_UNKNOWN
fi
if [ "${STATE_NUM}" -eq 1 ];then
echo "Check OK,MySQL Replication is running"
echo {`$MYSQLBIN -u$MYSQLUSER -p$MYSQLPS version`}
exit $STATE_OK
else
echo "Check Critical,MySQL Replication is error"
exit $STATE_CRITICAL
fi
本文转自 freeterman 51CTO博客,原文链接:http://blog.51cto.com/myunix/1104182,如需转载请自行联系原作者