diff options
author | elie <elie> | 2015-07-04 16:30:27 +0000 |
---|---|---|
committer | elie <elie> | 2015-07-04 16:30:27 +0000 |
commit | a39f371a33466985dee8b9712c820bfae6037954 (patch) | |
tree | 1e5b8d2ebae09b66b0595f9d668b1bfb915a94be /examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py | |
parent | 8ffb93f364237f9b75db5e2017e57c808e200063 (diff) | |
download | pysnmp-a39f371a33466985dee8b9712c820bfae6037954.tar.gz |
* default /usr/share/mibs MIB source added
* compiler.addMibCompiler() now supports ifAvailable and ifNotAdded flags
* rfc1902.ObjectIdentity() now always tries to instantiate and attach
MIB compiler to snmpEngine (if not done yet), also .addMibCompiler()
renamed to .addAsn1MibSource() to signify the fact that MIB compiler
is attached behind the scene
Diffstat (limited to 'examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py')
-rw-r--r-- | examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py b/examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py index a8c5b35..eab7906 100644 --- a/examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py +++ b/examples/v3arch/manager/cmdgen/getnext-v2c-with-mib-compilation-and-lookup.py @@ -21,7 +21,10 @@ from pysnmp.smi import compiler, view, rfc1902 snmpEngine = engine.SnmpEngine() # Attach MIB compiler to SNMP Engine (MIB Builder) +# This call will fail if PySMI is not present on the system compiler.addMibCompiler(snmpEngine.getMibBuilder()) +# ... alternatively, this call will not complain on missing PySMI +#compiler.addMibCompiler(snmpEngine.getMibBuilder(), ifAvailable=True) # Used for MIB objects resolution mibViewController = view.MibViewController(snmpEngine.getMibBuilder()) |