Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > f4a5198ca12dcf9a8d9c105955b5c783 > files > 831

python3-pysnmp-4.4.8-1.mga7.noarch.rpm


Walking whole MIB
-----------------

Q. 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 1.3.6.1, I would get everything under 
   the 1.3.6.1 prefix, but not 1.3.6.2.  Is there any way to make it walking 
   the whole MIB?

A. 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.

.. code-block:: python

    cmdGen = cmdgen.CommandGenerator()
    errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.bulkCmd(
        ....,
        ....,
        ....,
        lexicographicMode=True
    )