1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-09-28 16:33:46 +02:00

fixed to support rhel6-style multipath output (ra)

This commit is contained in:
root 2012-02-22 13:09:39 +00:00
parent 067d5a3887
commit 987325d2ff

View File

@ -14,8 +14,6 @@ PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION=`echo '$Revision: 1.12 $' | sed -e 's/[^0-9.]//g'` REVISION=`echo '$Revision: 1.12 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh
MULTIPATH=/sbin/multipath MULTIPATH=/sbin/multipath
SUDO=/usr/bin/sudo SUDO=/usr/bin/sudo
LSMOD=/sbin/lsmod LSMOD=/sbin/lsmod
@ -126,9 +124,15 @@ fi
if [ "$NUMPATHS" ]; then if [ "$NUMPATHS" ]; then
echo "$OUTPUT" | awk -vnumpaths=$NUMPATHS -vrc=0 -vlun= -vtargets=0 ' echo "$OUTPUT" | awk -vnumpaths=$NUMPATHS -vrc=0 -vlun= -vtargets=0 '
/^\[/ {next} # skip flags /^\[/ {next} # skip flags (lenny)
/^\\/ {next} # skip devinfo /^size=/ {next} # skip flags (squeeze)
/^ \\/ {targets++; next} # count targets /^\\/ {next} # skip devinfo (lenny)
/policy=/ {next} # skip devinfo (squeeze)
/^ \\/ {targets++; next} # count targets (lenny)
/[0-9]+:[0-9]+:[0-9]+:[0-9]+/ {
if (/active undef running/) { targets++ } # count targets (squeeze)
next
}
{ {
# The LUN line # The LUN line
# process if this is not first LUN # process if this is not first LUN