[SR-Users] SnmpStats problem

Daniel-Constantin Mierla miconda at gmail.com
Mon Nov 14 17:52:50 CET 2011


Hello,

On 11/14/11 5:22 PM, Adam Kuśmirek wrote:
> Hi All
>
> I've compiled kamailio 3.2.0 with snmpstats module.
> When trying to start the module I received the following message:
>
>  0(28197) DEBUG: <core> [sr_module.c:515]: load_module: trying to load 
> </usr/lib/kamailio/modules_k/
> snmpstats.so>
>  0(28197) ERROR: <core> [sr_module.c:523]: ERROR: load_module: could 
> not open module </usr/lib/kamailio/modules_k/snmpstats.so>: 
> /usr/lib/libnetsnmpagent.so.10: undefined symbol: boot_DynaLoader
>
> I run it on CentOS 5.7
>
> After digging Internet, I found the solution for the problem. I had to 
> modify Makefile in snmpstats module's directory and recompile it.
> I had to change BUILDAGENTLIBS env param
>
> before change:
>
>         BUILDAGENTLIBS =-L$(LOCALBASE)/lib -lnetsnmpmibs -lnetsnmpagent \
>                 -lnetsnmphelpers -lnetsnmp
>
> after change:
>
>         BUILDAGENTLIBS =-L$(LOCALBASE)/lib -lnetsnmpmibs -lnetsnmpagent \
>                 -lnetsnmphelpers -lnetsnmp \
>                 -Wl,-E 
> -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE \
>                 -L/usr/local/lib 
> /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/DynaLoader/DynaLoader.a 
> \
>                 -L/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE \
>                 -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil 
> -lpthread -lc \
>                 -lwrap \
>                 -lsensors \
>                 -lrpmdb -lrpm
>
> After that I successfully started snmpstats module.
>
> I don't know why I didn't have compilation errors before adding this 
> linking info, but got problem when trying to run compiled module. Can 
> you explain it ?
> Do you know another way to solve the problem ?
the error is due to missing linking to some libraries, thus is not a 
compile time error, but a runtime loading problem. The solutions is to 
find missing libraries at link time and add them as you did.

In this case, in many OS-es, the net-snmp library comes with a tool 
named net-snmp-config that can list the lib dependencies. That is used 
in makefile when found on the system, but seems in your case does not 
exist. Can you check somehow if the tool is provided by another package 
on centos 5.7?

In other OSes, there is a pkg-config tool that can do more or less the 
same. You can check if you have it on your centos and if yes, check if 
can print dependencies for net-snmp:

pkg-config --list-all

should list all supported packages.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-users mailing list