标签:
com2sec notConfigUser localhost-IP public group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser view systemview included .1.3.6.1.2.1.1 view systemview included .1.3.6.1.2.1.25.1.1 access notConfigGroup "" any noauth exact all none none view all included .1 80 syslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
拷贝check_traffic.sh到/usr/lib64/nagios/plugins/check_traffic.sh
check_traffic.sh文件GitHub下载地址:https://github.com/cloved/check_traffic/blob/master/check_traffic.sh
wget https://github.com/cloved/check_traffic/archive/master.zip
赋予执行权限并测试:
chmod +x check_traffic.sh
./check_traffic.sh -V 2c -C public -H your_ip -I 2 -w 1200,1500 -c 1700,1800 -K –B
./check_traffic.sh -V 2c -C public -H your_ip –L
例子:
./check_traffic.sh -V 2c -C public -H your_ip -N eth0 -w 8,7 -c 16,14 -M -b
-V snmp 版本
-C 认证信息
-H 主机IP
-N 网卡
-w 8,7 下行/上行流量超过 8,7 Mbit/s 警告
-c 16,14 下行/上行流量超过 16,14 Mbit/s 严重
-M 兆
-b 比特
编辑/etc/nagios/objects/command.cfg文件,追加:
# ‘check_traffic‘ command definition define command{ command_name check_traffic command_line $USER1$/check_traffic.sh -V 2c -C public -H $HOSTADDRESS$ -I $ARG1$ -w $ARG2$ -c $ARG3$ -M -b }
编辑/etc/nagios/objects/localhost.cfg文件
define service{ use local-service ; Name of service template to use host_name localhost service_description Check_Trafffic check_command check_traffic!2!12,15!20,30 notifications_enabled 1 normal_check_interval 5 retry_interval 1 }
并且修改localhost.cfg文件中的IP地址(127.0.0.1)为本机的IP!!!!!!!(坑了我2天)
nagios 配置 check_traffic 模块(Server 端)
标签:
原文地址:http://www.cnblogs.com/Mrhuangrui/p/4570200.html