Reputation: 3088
I am trying to perform a snmp walk on certain networking devices.
On some netwroking devices I succeed to go through all the devices oids and on some networking devices I don't succeed to go through all the devices oids.
Here is my code:
cmdGen = cmdgen.AsynCommandGenerator()
cmdGen.asyncNextCmd(
cmdgen.CommunityData('public', mpModel=0),
cmdgen.UdpTransportTarget(('ip', 161),timeout=timeout,retries=retries),
((1,3),),
(cbFun_Walk, None))
cmdGen.snmpEngine.transportDispatcher.runDispatcher()
The problem is that sometimes asyncCommandGenerator gets a timeout on a certaion oid and exists out of the thread.
As you can see the thread reaches some oid, gets a timeout error, and then quits the thread.
So i would like to know how to continue the snmpwalk even if a timed out oid was reached.
Basically if asyncCommandGenerator reaches a timed out oid, it should just continue with the walk and get the rest of the oids.
How could I achieve this?
Upvotes: 0
Views: 1158
Reputation: 5555
Logically speaking, you can't skip the "next" OID on request timeout, as you will not know what is the next OID then. I can see two workarounds here:
Upvotes: 1