SOURCES: nagios-plugin-check_multipath.sh - check multipath progra...

glen glen at pld-linux.org
Wed Oct 24 23:57:17 CEST 2007


Author: glen                         Date: Wed Oct 24 21:57:17 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- check multipath program also from env var

---- Files affected:
SOURCES:
   nagios-plugin-check_multipath.sh (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/nagios-plugin-check_multipath.sh
diff -u SOURCES/nagios-plugin-check_multipath.sh:1.3 SOURCES/nagios-plugin-check_multipath.sh:1.4
--- SOURCES/nagios-plugin-check_multipath.sh:1.3	Wed Oct 24 23:54:17 2007
+++ SOURCES/nagios-plugin-check_multipath.sh	Wed Oct 24 23:57:12 2007
@@ -60,28 +60,28 @@
 	;;
 esac
 
-# if not yet root, check sudo first
+if [ ! -x $MULTIPATH ]; then
+	echo "MULTIPATH: UNKNOWN - $MULTIPATH not found"
+	exit $STATE_UNKNOWN
+fi
+
+# if not yet root, check sudo
 if [ $(id -un) != "root" ]; then
-	if [ `$SUDO | grep -c multipath` -eq 0 ]; then
+	if [ `$SUDO -l | grep -c multipath` -eq 0 ]; then
 		echo "MULTIPATH: UNKNOWN - sudo not configured"
 		exit $STATE_UNKNOWN
 	fi
 	MULTIPATH="$SUDO $MULTIPATH"
 fi
 
-if [ ! -x /sbin/multipath ]; then
-	echo "MULTIPATH: UNKNOWN - /sbin/multipath not found"
-	exit $STATE_UNKNOWN
-fi
-
 MODCOUNT=`/sbin/lsmod | grep -c ^dm_multipath`
-if [ $MODCOUNT -gt 0 ]; then	
+if [ $MODCOUNT -gt 0 ]; then
 	PATHCOUNT=`$MULTIPATH -l | wc -l`
 	if [ $PATHCOUNT -eq 0 ]; then
 		echo "MULTIPATH: WARNING - no paths defined"
 		exit $STATEWARNING
 	else
-		FAILCOUNT=`$MULTIPATH -l|grep -c failed`
+		FAILCOUNT=`$MULTIPATH -l | grep -c failed`
 		if [ $FAILCOUNT -eq 0 ]; then
 			echo "MULTIPATH: OK - no failed paths"
 			exit $STATE_OK
@@ -93,6 +93,6 @@
 else
 	echo "MULTIPATH: UNKNOWN - module dm_multipath not loaded"
 	exit $STATE_UNKNOWN
-fi	
+fi
 
-# vim: ts=4
+# vim: ts=4:sw=4:noet
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/nagios-plugin-check_multipath.sh?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list