I only use one legacy nagios plugin- check_ldap_syncrepl_status.pl, but the nature of the problem makes me think that most legacy nagios plugins written in perl will have this issue.
The problem is a shared library in version/lib. I do not know which one. It is not utils.pm.
Workaround is to wrap nagios plugin with a script that removes version/lib from LD_LIBRARY_PATH
#!/bin/bash
more_args=""
executable=$1
while [ "$2" != "" ]; do
more_args="$more_args $2"
# Shift all the parameters down by one
shift
done
export LD_LIBRARY_PATH=$OMD_ROOT/local/lib
$executable $more_args
In the case of check_ldap_syncrepl_status.pl, the plugin will return a “Can’t connect to host” error if run as the omd user. Other users can run the plugin manually without error. The error message is misleading, as it never actually tries to connect to the host, but rather it errors while initializing a Net::LDAP object.
Edit- I forgot to mention that this is on Oracle Linux 9