CMK version: 2.4.0p16.cre
OS version: Debian 13
Error message:
External command error: /usr/bin/snmpget: symbol lookup error: /usr/bin/snmpget: undefined symbol: netsnmp_cleanup_session
Description:
/usr/lib/nagios/plugins/check_snmp command from monitoring-plugins-standard package was configured using “Setup > Services > Other services > Integrate Nagios plug-ins” rules. Check was running fine until upgrade do Debian13 and 2.4.0p16 (first build compatible with this OS).
The command line is (an example, we have much more like this):
/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -P 3 -L authPriv -U 'user' -a SHA256 -A <secret> -x AES -X <secret> -o .1.3.6.1.4.1.12356.101.12.2.2.1.20.3.1 -c @1:1
After upgrade all checks get UNKN with provided above error message.
Causes:
Site user uses libraries shipped with checkmk package instead of OS shipped libraries:
OMD[xyz]:~$ ldd /usr/bin/snmpget
(...)
libnetsnmp.so.40 => /omd/sites/xyz/lib/libnetsnmp.so.40 (0x00007f7a5bab9000)
(...)
(root)# ldd /usr/bin/snmpget
(...)
libnetsnmp.so.40 => /lib/x86_64-linux-gnu/libnetsnmp.so.40 (0x00007f7fd46a3000)
(...)
Running check_snmp as root does not produce any error (SNMP OK), while running as site user does.
Workaround:
I renamed /usr/lib/nagios/plugins/check_snmp to check_snmp.bin and created check_snmp wrapper script as follows:
#!/bin/bash
unset LD_LIBRARY_PATH
exec /usr/lib/nagios/plugins/check_snmp.bin "$@"
Which solved the problem for now (until monitoring-plugins-standard package get updated).
Final note:
In my opinion this is a bug in shipped /omd/sites/itw/lib/libnetsnmp.so.40
I created this post to let you all know about this issue and workaround.