使用snmpwalk
我可以从我的设备中获取:
OID=.1.3.6.1.4.1.5296.1.9.1.1.1.7.115.101.99.99.97.57.27.1.41
Type=OctetString
Value=secca99
我在Python中尝试了这个程序,从上面的OID中获取值字段:
^{pr2}$输出我得到:
当我运行这个程序时,它会显示一长串的OID(甚至不知道为什么我会在程序中给叶级OID作为输入)。奇怪。在
尝试了什么
lexicographicMode=True
中的lexicographicMode=True
,但它没有显示任何内容。在
我的愿望
我想在我的程序中给出一个OID列表,并想要它们的值(value是一个可以在第一行看到的键),就这样。在
请求
请在python程序中帮助我使用pysnmp。在
如果需要OID,请使用mibLookup=False参数。如果只需要MIB的分支,请使用
lexicographicMode=False
,但一定要指定非叶OID,因为在这种情况下,您将得不到任何回报。在以下是您的脚本和建议的更改:
您应该能够剪切并粘贴它,它正在运行于demo.snmplabs.com上的公共SNMP模拟器。在
相关问题 更多 >
编程相关推荐