Translating pysnmp oids to human readable strings

SpamMePlease PleasePlease spankthespam at
Sat Mar 7 17:23:45 CET 2009

On Fri, Mar 6, 2009 at 2:14 PM, Shantanu Joshi <weemadarthur at> wrote:
> SpamMePlease PleasePlease <spankthespam at> writes:
>> I actually tried to load the new file with following code:
>> print builder.MibBuilder().getMibPath()
>> mibBuilder = builder.MibBuilder().loadModules('jnx-bgpmib2')
>> but I am experiencing the error:
>> rivendell # python
>> ('/usr/lib/python2.4/site-packages/pysnmp/v4/smi/mibs/instances',
>> '/usr/lib/python2.4/site-packages/pysnmp/v4/smi/mibs')
>> Traceback (most recent call last):
>>   File "", line 7, in ?
>>     mibBuilder = builder.MibBuilder().loadModules('jnx-bgpmib2')
>>   File "//usr/lib/python2.4/site-packages/pysnmp/v4/smi/",
>> line 82, in loadModules
>>     raise error.SmiError(
>> pysnmp.smi.error.SmiError: MIB module
>> "/usr/lib/python2.4/site-packages/pysnmp/v4/smi/mibs/instances/"
>> load error: MIB file ".py" not found in search path
>> rivendell# ls -lA
>> /usr/lib/python2.4/site-packages/pysnmp/v4/smi/mibs/instances/
>> -rw-r--r-- 1 root root 2687 Mar  6 06:50
>> /usr/lib/python2.4/site-packages/pysnmp/v4/smi/mibs/instances/
>> Any clue what about is done wrong?
> The pysnmp library is not able to find your generated file. Either copy
> your generated file to /usr/lib/python2.4/site-packages/pysnmp/v4/smi/mibs/instances
> or call setMibPath on the mibBuilder instance before calling loadModules
> to add the current directory (or whatever directory holds your generated
> file).
> --

The thing is that I have copied the file (as you may see, I did 'ls
-lA' on it. If the file wasnt there, the error message was different.
Also, the setMibPath doesent seem to work, as I tried to set up it to
any value, and right after that I was performing getMibPath which was
giving me unchanged default paths. Keep in mind, that whole path setu
up code has executed without any error.
So, what is correct and working way to supply my code with that
converted mib file?

Spank The Spam!

More information about the Python-list mailing list