cacti出现snmp error
一、在被监控机器中确认snmp是否启动
service snmpd status
[root@test2 ~]# service snmpd status
snmpd (pid 1247) 正在运行...
表示已经snmpd进程已经启动了!
二、如果没有启动的,执行下列命令启动
service snmpd start
三、启动成功后,在监控机器上执行下面命令确认被监控机器的snmp能否返回数据
snmpwalk -v 2c -c public 192.168.200.221
四、如果出现下面字样则表示被监控机器的snmp服务没有给监控机器授权
Timeout: No Response from 192.168.200.221或者
SNMPv2-SMI::mib-2 = No more variables left in this MIB View (It is past the end of the MIB tree)
五、打开被监控机器的/etc/snmp/snmp.conf文件,更改如下配置:
1. 查找以下字段
<p># sec.name source community </p><p>com2sec notConfigUser default public </p>
将"comunity"字段改为你要设置的密码.比如"public".
将“default”改为你想哪台机器可以看到你的snmp信息,如192.168.2.105
2. 查找以下字段:
<p>#### </p><p># Finally, grant the group read-only access to the systemview view. </p><p># group context sec.model sec.level prefix read write notif </p><p>access notConfigGroup "" any noauth exact systemview none none </p>
将"read"字段值改为all.
<p>access notConfigGroup "" any noauth exact all none none </p>
3. 查找以下字段:
<p>## incl/excl subtree mask </p><p>#view all included .1 80 </p>
将该行前面的"#"去掉.
保存关闭.
4. 运行/etc/init.d/snmpd start命令运行snmpd.或 service snmpd start
六、再用snmpwalk执行
<p>IF-MIB::ifIndex.1 = INTEGER: 1 </p><p>IF-MIB::ifIndex.2 = INTEGER: 2 </p><p>IF-MIB::ifIndex.3 = INTEGER: 3 </p><p>IF-MIB::ifIndex.4 = INTEGER: 4 </p><p>IF-MIB::ifIndex.5 = INTEGER: 5 </p><p>IF-MIB::ifIndex.6 = INTEGER: 6 </p><p>IF-MIB::ifDescr.1 = STRING: lo </p><p>IF-MIB::ifDescr.2 = STRING: eth0 </p><p>IF-MIB::ifDescr.3 = STRING: eth1 </p><p>.... </p>
收到返回数据则表明snmp已经ok了