nagios监控网卡之check_traffic
环境【centos系】所需软件:net-snmp net-snmp-utils net-snmp-libs。
所需脚本:check_traffic.sh 见文章下方附件。 1.查看系统是否安装rpm -qa|grep snmp,如没有上传以上包,再上传check_traffic.sh脚本至$nagios/libexec/,并更改traffic脚本权限为 7552.未安装时下载上面的snmp的rpm。3.vi /etc/snmp/snmp.confa)更改# sec.name source communitycom2sec notConfigUser default public为# sec.namesource communitycom2sec notConfigUserlocalhost(源IP) nagios(访问密码)b)更改accessnotConfigGroup "" any noauth exactsystemview none none为access notConfigGroup "" any noauth exact mib2 none nonec)去掉该的##view mib2 included.iso.org.dod.internet.mgmt.mib-2 fcd)启动snmp/etc/init.d/snmpd start检查启动情况Netstat –na|grep 161测试snmp#snmpwalk -v 1 -c nagios localhost systemTraffic 脚本测试如果不知道网卡/usr/local/nagios/libexec/check_traffic.sh -V 2c -C nagios -H localhost –L命令列出 ./check_traffic.sh -V 2c -C passwd -H localhost -I 2 -w 12,30 -c 15,35 -K -b
页:
[1]