Python 2 Bindings Net-SNMP Error - undefined symbol: netsnmp-memdup
Asked Answered
N

1

8

I successfully compiled net-snmp-5.7.3 on Ubuntu. :D This is the specific version of Ubuntu:

Linux loserBox 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I seemed to have successfully installed the Python bindings for net-snmp too. This is included with the net-nsmp download as a different folder titled 'Python' with the setup.py file in it. However when running the command python setup.py test I noticed some problems. I thought this may be nothing to worry about so I went ahead and executed python setup.py install I was not sure what the instructions meant in the README file that say, "python setup.py test (requires a locally running agent w/ config provided)". So, this is why I installed it with the failed test or something. Anyways, I am not sure if this is a problem or not.

After successfully installing the python bindings for net-snmp I switched directories back to my Desktop and opened up an interactive python shell. From here I imported the netsnmp module and received the below error. It almost looks like there is a spelling error in the variable netsnmp_memdup that is throwing the error in the Traceback. This looks like a problem with the C code and not python.

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netsnmp
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: 
/home/loser_user/.python-eggs is writable by group/others and vulnerable to attack
when used with get_resource_filename. Consider a more secure location 
(set with   .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "build/bdist.linux-x86_64/egg/netsnmp/__init__.py", line 1, in <module>
File "build/bdist.linux-x86_64/egg/netsnmp/client.py", line 1, in <module>
File "build/bdist.linux-x86_64/egg/netsnmp/client_intf.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/netsnmp/client_intf.py", line 6, in __bootstrap__
ImportError: /home/loser_user/.python-eggs/netsnmp_python-1.0a1-py2.7-linux-x86_64.egg-  
tmp/netsnmp/client_intf.so: undefined symbol: netsnmp_memdup

Does anyone know how to fix this problem? I looked on the mailing list page on sourceforge for this project and searched the supoort archives but did not find anything.

Thanks for listening to a crazy man's Python problems.

Happy Holidays,

user_loser

Nordine answered 24/12, 2014 at 4:54 Comment(1)
I'm having the same problem here on Ubuntu 14.04.Mauretania
M
5

Alrgihty, thanks to my good friend Naveen, we have traced this down to an actual bug in the Python Net-SNMP bindings in the 5.7.3.

There are two ways around this:

  1. Use the Python bindings in Net-SNMP 5.7.2
  2. See this commit on our fork of the Net-SNMP Python library (only started yesterday so bear with us): https://github.com/fgimian/easysnmp/commit/fa86af977b563f65e7d70243752d48b94a8d5686 and replicate this in your download of Net-SNMP.
Mauretania answered 24/5, 2015 at 9:20 Comment(2)
Wow, thank-you for the reply! :D That is interesting to read the C code on github showing the diff data. I will have to try your solution if I ever need to use this again. I bet this info helps someone else on the Internet though. Happy coding. Stay Cool.Nordine
@user_loser: You're not alone in being glad to hear of this fix - I've been stuck for the past month - option #1 worked for me.Somersomers

© 2022 - 2024 — McMap. All rights reserved.