zhousan 发表于 2013-4-26 08:58:19

nagios 监控流量插件check_traffic

一,安装所需软件net-snmp net-snmp-utils net-snmp-libs net-snmp-devel   yum install net-snmp net-snmp-utils net-snmp-libs net-snmp-devel二,修复snmp配置:vim /etc/snmp/snmp.conf 修改为:

#       sec.namesource          community#com2sec notConfigUserdefault       publiccom2sec notConfigUserlocalhost      publicaccessnotConfigGroup ""   any    noauthexactmib2 none noneview mib2   included.iso.org.dod.internet.mgmt.mib-2 fc三,启动snmp服务:service snmpd start四,设置开启启动:chkconfig snmpd on五,上传插件到/usr/local/nagios/libexec (插件在附件中)六,配置测试check_traffic 脚本:cd /usr/local/nagios/libexec./check_traffic -V 2c -C nagios -H localhost –L命令列出网络接口cd /usr/local/nagios/etcvim nrpe.cfg #添加command=/usr/local/nagios/libexec/check_traffic -V 2c -C public -H localhost -I 2 -w 2200,4000 -c 2500,4500 -K -B-I 2 指网卡接口(就是你要监控的网卡接口)修改chown nagios:nagios /var/tmp/check_traffic_localhost_2.hist_dat重启nrpe 服务七,配置监控服务器:cd /usr/local/nagios/etc/objects编辑vim services.cfg中添加:define service {
       use services-pnp
       host_name xxx-Server
       service_description check-traffic
       check_period 24x7
       max_check_attempts 4
       normal_check_interval 3
       retry_check_interval 2
       contact_groups sagroup
       notification_interval 10
       notification_period 24x7
       notification_options w,u,c,r
       check_command check_nrpe!check_traffic
}八,测试

上帝大脸 发表于 2013-4-26 09:00:30

人生自古谁无死,啊个拉屎不用纸!

52037317 发表于 2013-5-16 16:15:46

写的真的很不错

zeromax 发表于 2013-5-17 19:59:01

支持一下:lol

ysoren 发表于 2013-5-19 01:41:55

竹子开花的时 发表于 2013-5-20 07:07:20

勿以坑小而不灌,勿以坑大而灌之。

samdung 发表于 2013-5-21 09:37:50

睡眠是一门艺术——谁也无法阻挡我追求艺术的脚步!
页: [1]
查看完整版本: nagios 监控流量插件check_traffic