SOURCES: nagios-plugin-check_multipath.sh - check sudo setup only ...

glen glen at pld-linux.org
Thu Oct 25 00:56:05 CEST 2007


Author: glen                         Date: Wed Oct 24 22:56:05 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- check sudo setup only when failed

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

---- Diffs:

================================================================
Index: SOURCES/nagios-plugin-check_multipath.sh
diff -u SOURCES/nagios-plugin-check_multipath.sh:1.10 SOURCES/nagios-plugin-check_multipath.sh:1.11
--- SOURCES/nagios-plugin-check_multipath.sh:1.10	Thu Oct 25 00:52:49 2007
+++ SOURCES/nagios-plugin-check_multipath.sh	Thu Oct 25 00:56:00 2007
@@ -85,12 +85,7 @@
 
 # if not yet root, check sudo
 if [ $(id -un) != "root" ]; then
-	if [ `$SUDO -l | grep -c multipath` -eq 0 ]; then
-		echo "MULTIPATH: UNKNOWN - sudo not configured"
-		exit $STATE_UNKNOWN
-	fi
 	MULTIPATH="$SUDO $MULTIPATH"
-
 	# on grsec kernel /proc might be protected
 	if [ ! -r /proc/modules ]; then
 		LSMOD="$SUDO $LSMOD"
@@ -100,6 +95,11 @@
 OUTPUT=$($MULTIPATH -l 2>/dev/null)
 if [ $? != 0 ]; then
 	# Failed. grab more info why
+	if [ $(id -un) != "root" ] && [ `$SUDO -l | grep -c multipath` -eq 0 ]; then
+		echo "MULTIPATH: UNKNOWN - sudo not configured"
+		exit $STATE_UNKNOWN
+	fi
+
 	MODCOUNT=$($LSMOD | grep -c ^dm_multipath)
 	if [ $MODCOUNT = 0 ]; then
 		echo "MULTIPATH: UNKNOWN - Module dm-multipath not loaded"
================================================================

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



More information about the pld-cvs-commit mailing list