Installation

SMI error converting MIB to Python egg

tchristoff
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 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?

Tags (1)

andarnold
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

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

pmeyerson
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

pmeyerson
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

Jaykul
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

Jaykul
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

halr9000
Motivator

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

0 Karma

tchristoff
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

tchristoff
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

bmacias84
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

Damien_Dallimor
Ultra Champion

DistributionNotFound: pycrypto>=2.4.1

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

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...