nagios监控内存的插件
老师,我从网上下载的。。。真的没思路啊。。
创新互联公司专注于阿巴嘎网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供阿巴嘎营销型网站建设,阿巴嘎网站制作、阿巴嘎网页设计、阿巴嘎网站官网定制、成都小程序开发服务,打造阿巴嘎网络公司原创品牌,更为您提供阿巴嘎网站排名全网营销落地服务。
cd /usr/local/nagios/libexec/
vim check_vm
写入
#!/bin/bash
# check memory script
# Total memory
TOTAL=`free -m | head -2 |tail -1 |gawk '{print $2}'`
# Free memory
FREE=`free -m | head -2 |tail -1 |gawk '{print $4}'`
# check memory script
# Total memory
TOTAL=`free -m | head -2 |tail -1 |gawk '{print $2}'`
# Free memory
FREE=`free -m | head -2 |tail -1 |gawk '{print $4}'`
# to calculate free percent
# use the expression free * 100 / total
FREETMP=`expr $FREE \* 100`
PERCENT=`expr $FREETMP / $TOTAL`
# use the expression free * 100 / total
FREETMP=`expr $FREE \* 100`
PERCENT=`expr $FREETMP / $TOTAL`
echo "$FREE MB ($PERCENT%) Free Memory"
exit 0
exit 0
chmod +x check_vm
cd /usr/local/nagios/etc/objects
vim command
写入
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
vim services.cfg
define service{
host_name MySQL
service_description check_vm
check_command check_nrpe!check_mem!192.168.111.3
max_check_attempts 3
normal_check_interval 2
retry_check_interval 1
check_period 24x7
notification_period 24x7
notification_options w,u,c,r
}
重启服务
service nsgios restart
当前标题:nagios监控内存的插件
新闻来源:http://azwzsj.com/article/gcoisj.html