I have two MIBS files, MIB1 and MIB2, MIB2 is importing elements from MIB1. I've run smilint and build-pysnmp-mib, actually smidump as I was not be able to pre-load the file exporting elements with build-pysnmp-mib.
With smidump I have two MIB .py modules, MIB1.py and MIB2.py, however when I write my SNMP agent, pysnmp is not able to find MIB1.py exporting module. I got this error
Traceback (most recent call last):
File "snmpagent.py", line 165, in <module>
agent = SNMPAgent(objects)
File "snmpagent.py", line 90, in __init__
mibObject.objectType)
File "/usr/lib/python2.7/dist-packages/pysnmp/smi/builder.py", line 299, in importSymbols
self.loadModules(modName, **userCtx)
File "/usr/lib/python2.7/dist-packages/pysnmp/smi/builder.py", line 259, in loadModules
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.SmiError: MIB module "./MIB2.py" load error: ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/dist-packages/pysnmp/smi/builder.py", line 255, in loadModules\n exec(modData, g)\n', ' File "<string>", line 17, in <module>\n', ' File "/usr/lib/python2.7/dist-packages/pysnmp/smi/builder.py", line 302, in importSymbols\n \'No module %s loaded at %s\' % (modName, self)\n', 'SmiError: No module MIB1 loaded at <pysnmp.smi.builder.MibBuilder instance at 0x7f99213c0b48>\n']
I have tried updating SMIPATH, and also loading manually the .py module with
mibPath = mibBuilder.getMibSources() + (builder.DirMibSource('path'),)
mibBuilder.setMibSources(*mibPath)
mibBuilder.loadModules(
'MIB1',
)
I'm running pysnmp on Ubuntu 14.04 and Python 2.7.6.
Can anybody help me out on this?