java监控网卡流量_cacti通过snmp监控ubuntu9.10网卡流量遇到的问题

折腾无线,snmp总是链接不上,debug报如下错误;

+ Running data query [1].

+ Found type = '3' [snmp query].

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ XML file parsed ok.

+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.2.2.1.1'

+ No SNMP data returned

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

谷歌百度,终于找到解决办法,记录之。。。

bear@njava:/var/www/njava$ sudo vi /etc/snmp/snmpd.conf

# First, map the community name (COMMUNITY) into a security name

# (local and mynetwork, depending on where the request is coming

# from):

# sec.name source community

#com2sec paranoid default public

#com2sec paranoid default njava

com2sec readonly default public

bear@njava:/var/www/njava$ sudo /etc/init.d/snmpd restart

获取到后的数据源

+ Running data query [1].

+ Found type = '3' [snmp query].

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ XML file parsed ok.

+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.2.2.1.1'

+ Index found at OID: '1.3.6.1.2.1.2.2.1.1.1' value: '1'

+ Index found at OID: '1.3.6.1.2.1.2.2.1.1.2' value: '2'

+ Index found at OID: '1.3.6.1.2.1.2.2.1.1.3' value: '3'

+ Located input field 'ifIndex' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.1'

+ Found item [ifIndex='1'] index: 1 [from value]

+ Found item [ifIndex='2'] index: 2 [from value]

+ Found item [ifIndex='3'] index: 3 [from value]

+ Located input field 'ifOperStatus' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.8'

+ Found item [ifOperStatus='Up'] index: 1 [from value]

+ Found item [ifOperStatus='Up'] index: 2 [from value]

+ Found item [ifOperStatus='Down'] index: 3 [from value]

+ Located input field 'ifDescr' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2'

+ Found item [ifDescr='lo'] index: 1 [from value]

+ Found item [ifDescr='eth0'] index: 2 [from value]

+ Found item [ifDescr='eth1'] index: 3 [from value]

+ Located input field 'ifName' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.1'

+ Found item [ifName='lo'] index: 1 [from value]

+ Found item [ifName='eth0'] index: 2 [from value]

+ Found item [ifName='eth1'] index: 3 [from value]

+ Located input field 'ifAlias' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.18'

+ Found item [ifAlias=''] index: 1 [from value]

+ Found item [ifAlias=''] index: 2 [from value]

+ Found item [ifAlias=''] index: 3 [from value]

+ Located input field 'ifType' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.3'

+ Found item [ifType='softwareLoopback(24)'] index: 1 [from value]

+ Found item [ifType='ethernetCsmacd(6)'] index: 2 [from value]

+ Found item [ifType='ethernetCsmacd(6)'] index: 3 [from value]

+ Located input field 'ifSpeed' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.5'

+ Found item [ifSpeed='10000000'] index: 1 [from value]

+ Found item [ifSpeed='100000000'] index: 2 [from value]

+ Found item [ifSpeed='0'] index: 3 [from value]

+ Located input field 'ifHwAddr' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.6'

+ Found item [ifHwAddr=''] index: 1 [from value]

+ Found item [ifHwAddr='00:0D:60:D4:BC:04'] index: 2 [from value]

+ Found item [ifHwAddr='00:0D:60:D4:BC:05'] index: 3 [from value]

+ Located input field 'ifIP' [walk]

+ Executing SNMP walk for data @ '.1.3.6.1.2.1.4.20.1.2'

+ Found item [ifIP='127.0.0.1'] index: 1 [from regexp oid parse]

+ Found item [ifIP='8.8.8.8'] index: 2 [from regexp oid parse]

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/interface.xml'

参考:http://www.linuxquestions.org/questions/linux-networking-3/cacti-traffic-stats-snmp-config-prob-378983/

星期四, 四月 1st, 2010

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值