- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SMI error converting MIB to Python egg
Hello, new to Splunk here. Having some issues converting a SonicWall MIB to the python egg format.
Here was my input:
"#build-pysnmp-mib -o SONICWALL-FIREWALL-TRAP-MIB.py SONICWALL-FIREWALL-TRAP-MIB.MIB"
Output:
Traceback (most recent call last):
File "/usr/bin/libsmi2pysnmp", line 4, in < module >
import pkg_resources
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 3007, in < module >
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 728, in require
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 626, in resolve
pkg_resources.DistributionNotFound: pycrypto>=2.4.1
smidump -k -f python SONICWALL-FIREWALL-TRAP-MIB.MIB | /usr/bin/libsmi2pysnmp fails
make sure you are using libsmi version > 0.4.5 (or svn)
The libsmi version: libsmi-0.4.8-4.el6.x86_64
could anyone point me in the right direction on what I should do next?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you enabled the EPEL repository? I had some success installing python-pip from that repo and using pip install
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was getting the same error, running on a centOS box.
Here is what I did to address the issue. Please take in mind I am not a linux expert by any means, not sure if it would be OK to perform these steps on any production environment.
- Downloaded pycrypto-2.6 and untar
- cd to pycrypto-2.6 and run python setup.py install to install module
I then had to do the same thing for pyans1.
This allowed me to combile .py files from my standard .MIB files.
(However I still got an error when I tried to use them with snmp modular input)
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess this is more of a python issue... I was able to compile my .pyc files but now I get this error:
pysnmp.smi.error.SmiError: MIB module "E:\Splunk\etc\apps\snmp_ta\bin\mibs\WWP-LEOS-TRAFFIC-PROFILE-MIB.py" load error: importSymbols: empty MIB module name
thanks for any suggestions
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My error message is: "python E:\Splunk\etc\apps\snmp_ta\bin\snmp.py" pysnmp.smi.error.SmiError: MIB file "WWP-TRAFFIC-PROFILE-MIB.py[co]" not found in search path
I have a WWP-TRAFFIC-PROFILE-MIB.py and .egg file present. However my egg does not contain any .pyc files.
Am I missing a step in the build/compile process?
Doing my development on a centOS box, and splunk is installed on a windows box.
thx
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What sort of error? Mine are working (although I had to drop the py/pyc loose in the folder, haven't been able to get an .egg to work) 😉
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you can get smidump to work, then build-pysnmp-mib will work. Try running smidump by itself -- chances are you don't even have smidump available, but if you do, it should give you a more specific error (particularly if you leave off the -k):
smidump .\SONICWALL-FIREWALL-TRAP-MIB.MIB
If that fails, the MIB probably depends on other MIBs which aren't in your SMIPATH (try setting that environment variable to where you have your .MIB files, or create a $HOME/.smirc file defining path=/where/you/have/your/mibs )
If you don't have smidump, you can install it (even on OSX, if you've got your xcode & gnu tools set up) from http://www.ibr.cs.tu-bs.de/projects/libsmi/download/libsmi-current.tar.gz using ./configure
&& make install
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

smidump fails with the same error for me on OSX. I have pycrypto 2.6 installed. Any other ideas?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So it is looking like from the distro im using it will not work. As a work around I will try on a higher version of RHEL. Thanks for the help!
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Am working on a CentOS box, and I will try upgrading python-crypto package, seems the yum repo thinks its latest ver.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Question are you doing this on a Windows Box? Personally I have never been able to get build-pysnmp-mib to work on any Windows Python install. My work around has been to run a cygwin install or on nix box. Dont know if that is your problem.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

DistributionNotFound: pycrypto>=2.4.1
Have you addressed this error ? ie : upgrade your pycrypto version.
