Random Project

patch for 1.15

I’ve had to make a bunch of hacks to this to keep it running over time. PROGPATH is wrong on some systems, the execute test does not look at the correct owner (since sudo is used), and a failed battery/capacity can result in the cache “permanently” disabled.

@@ -188 +188,3 @@
-. $PROGPATH/utils.sh
+[[ -x $PROGPATH/utils.sh ]] && . $PROGPATH/utils.sh
+[[ -x /usr/lib/nagios/plugins/utils.sh ]] && . /usr/lib/nagios/plugins/utils.sh
+[[ -x /usr/lib64/nagios/plugins/utils.sh ]] && . /usr/lib64/nagios/plugins/utils.sh
@@ -291 +293 @@
-if [ ! -x $hpacucli ]; then
+if [ ! -f $hpacucli ]; then
@@ -296 +298 @@
– if [ -x $hpssacli ]; then
+ if [ -f $hpssacli ]; then
@@ -410,0 +413 @@
+ check=`echo “$check” | grep -v ‘Cache Status: Permanently Disabled’`