如何解决pysnmpget ,pysnmp.smi.error.SmiError: <pysnmp.smi.builder.MibBuilder object at 0x7ffbbd55ac18> 没有符号 IF-MIB::ifDescr.1
from pysnmp.hlapi import *
test = getCmd(SnmpEngine(),CommunityData('public',mpModel=0),UdpTransportTarget(('192.168.0.253',161)),ContextData(),ObjectType(ObjectIdentity('IF-MIB','ifDescr',0)))
errorIndication,errorStatus,errorIndex,varBinds = next(test)
if errorIndication: # SNMP engine errors
print(errorIndication)
else:
if errorStatus: # SNMP agent errors
print('%s at %s' % (errorStatus.prettyPrint(),varBinds[int(errorIndex) - 1] if errorIndex else '?'))
else:
for varBind in varBinds: # SNMP response contents
print(' = '.join([x.prettyPrint() for x in varBind]))
pysnmp.smi.error.SmiError: No symbol IF-MIB::ifDescr.1 at <pysnmp.smi.builder.MibBuilder object at 0x7ffbbd55ac18>
每当我尝试获取特定值 ifDescr 或在接口的输出或输入中时,我都会收到此错误(pysnmp.smi.error.SmiError: No symbol IF-MIB::ifDescr.1 at
先谢谢你
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。