tags:

views:

879

answers:

2

Hi,

I created a Perl script and tested it on a couple of servers running Net::SNMP 5.3.1-19, but now I'm trying to run it on a different server and I'm getting the following error:

Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/default_store/default_store.so' for module NetSNMP::default_store: libnetsnmp.so.15: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230. at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/SNMP.pm line 16 Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/SNMP.pm line 16. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/SNMP.pm line 16. Compilation failed in require at /shaw/neteye/perl_scripts/cmtsmonitord.pl line 9. BEGIN failed--compilation aborted at /shaw/neteye/perl_scripts/cmtsmonitord.pl line 9.

Why is the loader complaininig about the libnetsnmp.so.15? I have libnetsnmp.so.10 installed in all of the other servers and it works just fine. The symlinks are pointing to the same version (10), not 15. Isn't that required for a later version of Net::SNMP (5.4.2.1)?

    [user@wb lib]$ sudo /sbin/ldconfig |grep snmp
    /sbin/ldconfig: /usr/lib/libgd.so.2 is not a symbolic link

    [user@wb lib]$ sudo /sbin/ldconfig -p |grep snmp
    libsnmp.so.10 (libc6) => /usr/lib/libsnmp.so.10
    libnetsnmptrapd.so.10 (libc6) => /usr/lib/libnetsnmptrapd.so.10
    libnetsnmpmibs.so.10 (libc6) => /usr/lib/libnetsnmpmibs.so.10
    libnetsnmphelpers.so.10 (libc6) => /usr/lib/libnetsnmphelpers.so.10
    libnetsnmpagent.so.10 (libc6) => /usr/lib/libnetsnmpagent.so.10
    libnetsnmp.so.10 (libc6) => /usr/lib/libnetsnmp.so.10

Why is it trying to use a more recent version of the dynamic library in this server when all of the snmp packages are the same?

I noticed something else. There are 2 sets of default_store.so libraries.

/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/agent/default_store/default_store.so /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/default_store/default_store.so /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/agent/default_store/default_store.so /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/default_store/default_store.so

The machines that are working fine only have the vendor_perl ones, which is what gets installed with the RPMs. What is the difference between the 2? (vendor and base) how do I force perl to use the add on in vendoer_perl?

Thanks!

+1  A: 

It may be that the

  • /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/agent/default_store/default_store.so, or
  • /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/default_store/default_store.so

is linked against a specific version of libntsnmp.so, run ldd against both of the above files, and see what the output tells you.

Beano
A: 

If libnetsnmp.so.15 is unknown print:
find / -name libnetsnmp.so.15 cp /.../libnetsnmp.so.15 /usr/lib or in that directory where all libs are allocated And it's all will be fine...