-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: easysnmp/interface.so: undefined symbol: netsnmp_transport_config_compare #12
Comments
Yep, the reason this is likely happening is that you're not running net-snmp 5.7.x. Please upgrade your Net-SNMP libraries to 5.7.2 or 5.7.3 and everything should work correctly. Cheers |
What version of net-snmp are you currently running? I'm tempted to see if I can get it supported in the C backend. |
@nnathan worth a shot, but don't forgot, we have OSs shipping with versions as old as 5.4. It may be quite a challenge to support them all (but worthwhile if not too much work). 😄 |
net-snmp-devel-5.5-50.el6_6.1.x86_64 is the package currently on the system yum install net-snmp-devel |
I installed 5.7.3. I believe its installed correctly but I am still facing the same error trying to use this easysnmp module which snmpget/usr/local/bin/snmpget /usr/local/bin/snmpget --versionNET-SNMP version: 5.7.3 |
You'll need to ensure that you re-install the package via pip after installing the latest version of Net-SNMP. Further to this, you'll need to ensure that easysnmp is using the correct header files and libraries for the new version of Net-SNMP which you have installed. The following code in setup.py configures your libdirs. You may wish to use the print statement after this code to confirm that the correct paths are being detected: # If a base directory has been provided, we use it
if in_tree:
netsnmp_libs = os.popen(basedir + '/net-snmp-config --libs').read()
libdir = os.popen(
basedir + '/net-snmp-config --build-lib-dirs ' + basedir).read()
incdir = os.popen(
basedir + '/net-snmp-config --build-includes ' + basedir).read()
libs = re.findall(r' -l(\S+)', netsnmp_libs)
libdirs = re.findall(r' -L(\S+)', libdir)
incdirs = re.findall(r' -I(\S+)', incdir)
# Otherwise, we use the system-installed SNMP libraries
else:
netsnmp_libs = os.popen('net-snmp-config --libs').read()
libs = re.findall(r' -l(\S+)', netsnmp_libs)
libdirs = re.findall(r' -L(\S+)', netsnmp_libs)
incdirs = [] Good luck |
I think this will only handle the case of compiling and installing the module. When Python runs, it will also need to load |
@mlammon any update on this? I'll be closing the issue in a few days as I'm assuming you've got it all working 😄 |
Thanks Fotis. You can close it by I never did resolve it. It's ok though
|
@mlammon OK, I do suspect this is an issue with your install of Net-SNMP as we have gotten it working perfectly. Perhaps try again on a fresh system. I'll close this for now, but feel free to open a new issue if you encounter further dramas that you suspect relate to the package itself. |
I have been experiment with running easysnmp on OSX where the original problem manifested. The fix is actually incredibly simple and requires a slight modification of Once I have sorted this out, I will be happy to say that we do infact support Net-SNMP 5.6 which seems to ship with the latest versions of OSX (10.8, 10.9), and push out a new version. So @mlammon: not sure if you're still interested, but bear with me :). |
Support for Net-SNMP 5.6.x and OSX closing issue #12.
I ran the test suite against the local running In OSX I would run: Followed by running These are the results:
This seems to be an issue that's limited to OSX whereby the I'm now closing this issue again, now that it has been sorted once and for all. |
I'm using Ubuntu 12 and can reproduce this problem. I installed net-snmp 5.7.3 from source. I believe the problem is related to not being able to locate the libnetsnmp.so given that is where the symbol is located. You can run this command: LD_PRELOAD=/usr/local/lib/libnetsnmp.so python I hope this helps future users of this great python library. |
@normanuber Is there a way to permanently place /usr/local/lib/netsnmplib.so into the LD_LIBRARY_PATH? Trying to avoid having to have LD_PRELOAD=/usr/local/lib/libnetsnmp.so python in the execution command for my script. Thanks in advance. |
@normanuber really the same ask like jdub982, how do we to load the correct /usr/local/lib/libnetsnmp.so permanently? |
This issue happens on Red Hat Enterprise Linux Server release 6.6 (Santiago). I have to manually do the following in order for easysnmp to work as expected: $ cat /etc/redhat-release $ /usr/local/bin/snmpget --version $ /usr/local/bin/python3.6 -c 'import easysnmp' $ export LD_PRELOAD=/usr/local/lib/libnetsnmp.so $ /usr/local/bin/python3.6 -c 'import easysnmp' Is this going to be fixed so that we don't have to depend on doing the LD_PRELOAD? |
Hi Fotis,
I moved this issue off email and into your formal support at your request.
I have python 2.6.6 and I installed easysnmp using pip as requested
Any idea why the error?
Thanks,
Mike
The text was updated successfully, but these errors were encountered: