Archive

SMI error converting MIB to Python egg

Explorer

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 pkgresources

File "build/bdist.linux-x86
64/egg/pkgresources.py", line 3007, in < module >

File "build/bdist.linux-x86
64/egg/pkgresources.py", line 728, in require

File "build/bdist.linux-x86
64/egg/pkgresources.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?

Tags (1)

New Member

Have you enabled the EPEL repository? I had some success installing python-pip from that repo and using pip install to install the requisite modules.

0 Karma

Path Finder

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.

  1. Downloaded pycrypto-2.6 and untar
  2. 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)

Path Finder

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

0 Karma

Path Finder

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

0 Karma

Explorer

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) 😉

0 Karma

Explorer

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

Motivator

smidump fails with the same error for me on OSX. I have pycrypto 2.6 installed. Any other ideas?

0 Karma

Explorer

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!

0 Karma

Explorer

Am working on a CentOS box, and I will try upgrading python-crypto package, seems the yum repo thinks its latest ver.

0 Karma

Champion

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.

0 Karma

Ultra Champion

DistributionNotFound: pycrypto>=2.4.1

Have you addressed this error ? ie : upgrade your pycrypto version.