Walking whole MIB¶
The nextCmd() and bulkCmd() methods of CommandGenerator app (oneliner version) stop working once returned OIDs went out of scope of request OIDs.
In other words, if I request 188.8.131.52, I would get everything under the 184.108.40.206 prefix, but not 220.127.116.11. Is there any way to make it walking the whole MIB?
- Yes, just pass the lexicographicMode=True parameter to CommandGenerator nextCmd() and bulkCmd() methods (introduced in PySNMP 4.2.3+) or set CommandGenerator.lexicographicMode=True option before calling nextCmd() and bulkCmd() methods.
cmdGen = cmdgen.CommandGenerator() errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.bulkCmd( ...., ...., ...., lexicographicMode=True )