External command error: /usr/local/bin/snmpget: error while loading shared libraries: libnetsnmp.so.20: cannot open shared object file

Enigma picture Enigma · Jul 10, 2012 · Viewed 18.3k times · Source

I'm able to do a snmpget/snmpwalk and check_snmp through command line. But, when I do it through Nagios (creating a host & services entry in the config files), I see this error in the "Status Information" of the services under specific host:

External command error: /usr/local/bin/snmpget: error while loading shared libraries: libnetsnmp.so.20: cannot open shared object file: No such file or directory

OS: SLES 11

Answer

gangadhars picture gangadhars · Mar 31, 2014

The below procedure is helpful, if libnetsnmp.so.XX is in your system.

First search for library libnetsnmp.so.XX

sudo find / -name libnetsnmp.so*

So you will get output like below

/usr/lib/libnetsnmp.so.30
/usr/lib/libnetsnmp.so.15
/usr/lib/libnetsnmp.so.15.1.2
/usr/local/lib/libnetsnmp.so.30
/usr/local/lib/libnetsnmp.so
/usr/local/lib/libnetsnmp.so.30.0.2
/usr/local/lib/libnetsnmp.so.20
...

Now link that libnetsnmp.so.XX to /usr/lib/

sudo ln -s /usr/local/lib/libnetsnmp.so.XX /usr/lib/libnetsnmp.so.XX