etingof / pysnmp

Python SNMP library
http://snmplabs.com/pysnmp/
BSD 2-Clause "Simplified" License
576 stars 196 forks source link

Mib Walk fails in the middle of the walk. #395

Open jahe7959 opened 3 years ago

jahe7959 commented 3 years ago

Hey there,

i'm stuck here. I have a custom MIB that i compiled from a .txt to .py, loaded it and trying to just walk through. Midway through, the walk fails with the following error:

Traceback (most recent call last): File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\carrier\asyncore\dispatch.py", line 46, in runDispatcher use_poll=True, map=self.__sockMap, count=1) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\asyncore.py", line 207, in loop poll_fun(timeout, map) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\asyncore.py", line 150, in poll read(obj) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\asyncore.py", line 87, in read obj.handle_error() File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\asyncore.py", line 83, in read obj.handle_read_event() File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\asyncore.py", line 422, in handle_read_event self.handle_read() File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\carrier\asyncore\dgram\base.py", line 170, in handle_read self._cbFun(self, transportAddress, incomingMessage) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\carrier\base.py", line 85, in _cbFun self, transportDomain, transportAddress, incomingMessage File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\entity\engine.py", line 152, in __receiveMessageCbFun self, transportDomain, transportAddress, wholeMsg File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\proto\rfc3412.py", line 486, in receiveMessage cachedParams['cbCtx']) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\entity\rfc3413\cmdgen.py", line 152, in processResponsePdu cbFun(snmpEngine, origSendRequestHandle, None, PDU, cbCtx) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\entity\rfc3413\cmdgen.py", line 303, in processResponseVarBinds varBindTable, cbCtx): File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\hlapi\asyncore\cmdgen.py", line 345, in __cbFun varBindTable], File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\hlapi\asyncore\cmdgen.py", line 344, in <listcomp> [vbProcessor.unmakeVarBinds(snmpEngine, varBindTableRow, lookupMib) for varBindTableRow in File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\hlapi\varbinds.py", line 47, in unmakeVarBinds mibViewController) for x in varBinds] File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\hlapi\varbinds.py", line 47, in <listcomp> mibViewController) for x in varBinds] File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\smi\rfc1902.py", line 853, in resolveWithMib self.__args[0].resolveWithMib(mibViewController) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\smi\rfc1902.py", line 450, in resolveWithMib self.__indices = rowNode.getIndicesFromInstId(suffix) File "C:\Users\hengst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pysnmp\smi\mibs\SNMPv2-SMI.py", line 1258, in getIndicesFromInstId (self, instId) pysnmp.smi.error.SmiError: Excessive instance identifier sub-OIDs left at MibTableRow((1, 3, 6, 1, 4, 1, 23056, 2, 30, 1), None): 1

Loading the MIB in ManagedEngine MIB-Walker works just fine. Could this be a bug in the compiler or in the Library?

Attached is the MIB compiled and plain. RIEDEL-MEDIORNET-MIB.txt MediorNet_SNMP.zip