MIB和OID对应关系查看命令:snmptranslate -Tz -m all
SNMP测试
本地测试:snmpwalk -v 2c -c public@123 localhost 1.3.6.1.2.1.25.3.3.1.1
远程测试:snmpwalk -v 2c -c public@123 192.168.227.172 1.3.6.1.2.1.25.3.3.1.1
如果有报错:
No Such Object available on this agent at this OID或No more variables left in this MIB View (It is past the end of the MIB tree)
此时需要修改配置文件
修改snmpd.conf(/etc/snmp/snmpd.conf),
# 修改配置文件
vim /etc/snmp/snmpd.conf
# sec.name source community
com2sec notConfigUser default public
# public 可以修改,修改成自己的团体号
# 添加这一行
view all included .1
# 修改访问权限 systemview ===> all
access notConfigGroup "" any noauth exact all none none
重启snmpd(service snmpd restart)
snmpd服务正常