在Cisco路由器和Linux Box之间设置SNMP

我的最终目标是从Cisco路由器3662中看到某种数据。像使用的总连接数和带宽数据。 我正在尝试使用SNMP。 我想我的snmp正常运行,但我不知道snmp数据在哪里。 我在网上没有运气。 我看到使用perl获取对象的服务器故障后,但我不知道,如果我甚至工作。

所以我在我的ubuntu盒子上安装了一个SNMP恶魔。 码:

rocommunity public agentaddress localhost:161 

然后在路由器(xxx.xx.xx.xx == ip地址到我的ubuntu盒子)代码:

 snmp-server community public RO snmp-server enable traps bgp snmp-server host xxx.xx.xx.xx public 

所以我从我的路由器得到一些统计数据:代码:

 800 SNMP packets input 0 Bad SNMP version errors 0 Unknown community name 0 Illegal operation for community name supplied 0 Encoding errors 800 Number of requested variables 0 Number of altered variables 0 Get-request PDUs 800 Get-next PDUs 0 Set-request PDUs 0 Input queue packet drops (Maximum queue size 1000) 901 SNMP packets output 0 Too big errors (Maximum packet size 1500) 0 No such name errors 0 Bad values errors 0 General errors 800 Response PDUs 101 Trap PDUs SNMP logging: enabled Logging to xxx.xx.xx.xx.161, 0/10, 101 sent, 0 dropped. 

所以它一定是发送它,只是在我的Ubuntu的盒子呢?

如果你想从你的Linux机器上从cisco路由器中检索SNMP数据,你不需要SNMP守护进程,你需要的是一个能够获取SNMP数据和图表的工具。 SNMP数据需要被某些东西拉动。

stream行的工具包括MRTG,Cacti,RRDTool,然后是所有较重的networkingpipe理系统,如Nagios,OpenNMS和ZenOSS。

如果您安装了snmp软件包,那么您可以使用像这样的命令snmpwalk -${SnmpVer} -c${SnmpCommunity} ${systemIp} system来testing并查看您是否可以build立SNMP连接。 对于你的例子,你可能想要replace这样的variables。 snmpwalk -2 -cpublic 10.1.1.1 system