×

微信扫一扫,快捷登录!

nagios 监控 mysql的读写比

标签: mysql监控
来自:网络


#!/bin/bash
#PORT=$1
nagios培训

u=$1
w=$2
c=$3
BC=/usr/bin/bc
GREP=/bin/grep
AWK=/bin/awk
HEAD=/usr/bin/head
TAIL=/usr/bin/tail
#u='h :8236/nagios_checkpage.ashx?key=SX_MPC'
content=`curl -s $u`
#echo $content
#echo '------------------------------'    nagios实施
eval $(awk -v info="$content" 'BEGIN{split(info,tA,";");printf("n=%s;t=%s;",tA[1],tA[2]);}')
#echo $n $t
#echo '------------------------------'
eval $(awk -v info="$t" 'BEGIN{split(info,tA,":");printf("WAIT=%s",tA[2]);}')
#echo "Wait=" $WAIT
eval $(awk -v info="$n" 'BEGIN{split(info,tA,":");printf("DATANAME=%s",tA[1]);}')
#echo "DATANAME=" $DATANAME
#echo '------------------------------'
if [ `echo "$WAIT >= $c" |bc` == 1 ] ;then        
监控软件

echo "${DATANAME} CRITICAL - ${DATANAME} Wait=${WAIT} |Wait=${WAIT};${w};${c} all=1;1;1";
exit 2;
elif [ `echo "$WAIT >= $w" |bc` == 1 ] ;then
echo "${DATANAME} WARNING - ${DATANAME} Wait = ${WAIT} |Wait=${WAIT};${w};${c} all=1;1;1";  nagios安装
exit 1;
elif [ `echo "$WAIT < $w" |bc` == 1 ] ;then
echo "${DATANAME} OK - ${DATANAME} Wait = ${WAIT} |Wait=${WAIT};${w};${c} all=1;1;1";
exit 0;         
nagios配置

else
echo "${DATANAME} ERROR - Unable to determine ${DATANAME} data";   开源监控软件
exit 3;
fi
echo "Unable to determine data.";

想做Nagios Zabbix,Cacti,iTop各种交流的,可以进入开源监控工具Nagios交流  QQ群号 476809427





上一篇:记录Nagios监控数据的脚本
下一篇:简易操作Nagios
monicazhang

写了 2297 篇文章,拥有财富 12859,被 21 人关注

您需要登录后才可以回帖 登录 | 立即注册
B Color Link Quote Code Smilies

成为第一个吐槽的人

Powered by IT 运维管理
返回顶部