Hello
I am getting the "Could not find nagios utils include file" error when running check_drupal under OMD.
I resolved this by editing check_drupal and setting:
temp=`mktemp`
if [[ -e $PROGPATH/utils.sh ]]; then
. $PROGPATH/utils.sh
elif [[ -e /opt/omd/sites/(site name here)/lib/nagios/plugins/utils.sh ]]; then
. /opt/omd/sites/(site name here)/usr/nagios/plugins/utils.sh
else
echo 'Could not find nagios utils include file!'
exit 1
fi
The problem is that I don't know how to make this more portable. In an OMD site, ~/etc/nagios/resource.conf defines some macros for Nagios that would help locate the path, but I don't know that there's an environment variable that has this path defined.
Comments
Comment #1
greg.harveyLooking in to this...
Comment #2
greg.harveyOK, this issue spawned a 4-way discussion and no resolution, but a better idea for resolving it. The problem is this - there's no point in trying to patch for every possible location of utils.sh, as there are potentially infinite possibilities, so that's not going to happen.
So, we need to either:
- allow PROGPATH to be configured in an ini file and document that
- work out a clever way to "discover" the path to utils.sh and set PROGPATH
Comment #3
greg.harveyAfter speaking to a few people, consensus was trying to support every distro out there is silly - people need to alter PROGPATH in the check_drupal script if they're using a distro that keeps the Nagios utils.sh script in an odd place - it's a one line change, so not a big deal.
Added docs to that effect.