Import custom MIB PySNMP Windows

868 views Asked by At

I have already converted the CISCO-VTP-MIB to work with PySNMP, but I am unable to import it.

All the help online is for *nix machines. How can I import this module to use in my script?

1

There are 1 answers

0
Ilya Etingof On BEST ANSWER

To point PySNMP to a place where you keep Pythonized MIBs, use ObjectIdentity.addMibSource().

But a better approach (at least for SNMP manager apps) is to let PySNMP compile ASN.1 MIB file into whatever form it needs. For that you just need to point it to a location where it could find ASN.1 MIBs. You could do the latter with ObjectIdentity.addAsn1MibSource().

Speaking of Windows paths, PySNMP does not do anything special about them. I guess you could just follow Python customs in that regard. For instance, c:\mibs in Python parlance might look like c:/mibs.