SOURCES: nagios-plugin-check_multipath.sh - call multipath -l once

glen glen at pld-linux.org
Thu Oct 25 00:03:45 CEST 2007


Author: glen                         Date: Wed Oct 24 22:03:45 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- call multipath -l once

---- Files affected:
SOURCES:
   nagios-plugin-check_multipath.sh (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/nagios-plugin-check_multipath.sh
diff -u SOURCES/nagios-plugin-check_multipath.sh:1.5 SOURCES/nagios-plugin-check_multipath.sh:1.6
--- SOURCES/nagios-plugin-check_multipath.sh:1.5	Thu Oct 25 00:01:13 2007
+++ SOURCES/nagios-plugin-check_multipath.sh	Thu Oct 25 00:03:40 2007
@@ -86,12 +86,13 @@
 
 MODCOUNT=`$LSMOD | grep -c ^dm_multipath`
 if [ $MODCOUNT -gt 0 ]; then
-	PATHCOUNT=`$MULTIPATH -l | wc -l`
+	OUTPUT=$($MULTIPATH -l)
+	PATHCOUNT=$(echo "$OUTPUT" | wc -l)
 	if [ $PATHCOUNT -eq 0 ]; then
 		echo "MULTIPATH: WARNING - no paths defined"
 		exit $STATEWARNING
 	else
-		FAILCOUNT=`$MULTIPATH -l | grep -c failed`
+		FAILCOUNT=$(echo "$OUTPUT" | grep -c failed)
 		if [ $FAILCOUNT -eq 0 ]; then
 			echo "MULTIPATH: OK - no failed paths"
 			exit $STATE_OK
================================================================

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



More information about the pld-cvs-commit mailing list