Author: glen                         Date: Wed Oct 24 22:52:54 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- skip lsmod if multipath operates correctly

---- Files affected:
SOURCES:
   nagios-plugin-check_multipath.sh (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/nagios-plugin-check_multipath.sh
diff -u SOURCES/nagios-plugin-check_multipath.sh:1.9 
SOURCES/nagios-plugin-check_multipath.sh:1.10
--- SOURCES/nagios-plugin-check_multipath.sh:1.9        Thu Oct 25 00:36:08 2007
+++ SOURCES/nagios-plugin-check_multipath.sh    Thu Oct 25 00:52:49 2007
@@ -97,13 +97,19 @@
        fi
 fi
 
-MODCOUNT=`$LSMOD | grep -c ^dm_multipath`
-if [ $MODCOUNT = 0 ]; then
-       echo "MULTIPATH: UNKNOWN - Module dm-multipath not loaded"
+OUTPUT=$($MULTIPATH -l 2>/dev/null)
+if [ $? != 0 ]; then
+       # Failed. grab more info why
+       MODCOUNT=$($LSMOD | grep -c ^dm_multipath)
+       if [ $MODCOUNT = 0 ]; then
+               echo "MULTIPATH: UNKNOWN - Module dm-multipath not loaded"
+               exit $STATE_UNKNOWN
+       fi
+
+       echo "MULTIPATH: $(MULTIPATH -l 2>&1)"
        exit $STATE_UNKNOWN
 fi
 
-OUTPUT=$($MULTIPATH -l)
 PATHCOUNT=$(echo "$OUTPUT" | wc -l)
 if [ $PATHCOUNT -eq 0 ]; then
        echo "MULTIPATH: WARNING - No paths defined"
================================================================

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to