diff --git a/check_smartarray.sh b/check_smartarray.sh index 4ecedcc..5cb2b67 100644 --- a/check_smartarray.sh +++ b/check_smartarray.sh @@ -1,7 +1,8 @@ #!/bin/sh # NRPE check for Proliant SmartArray Controllers (ciss) -# Written by: Søren Klintrup -# version 1.4.4 +# Written by: Søren Klintrup +# Get your copy from: https://github.com/Klintrup/check_smartarray/ +# version 1.4.5 PATH="/sbin:/bin:/usr/sbin:/usr/bin" DEVICES="$(camcontrol devlist|grep "COMPAQ RAID"|sed -Ee 's/.*(pass[0-9]{1,3}).*/\1/')" @@ -18,7 +19,7 @@ do ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: unknown state" if ! [ "${ERR}" = 2 ];then ERR=3;fi else - case $(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|exp|rec|fai|ok).*/\1/') in + case $(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -e s/'\>.*'//|sed -Ee 's/.*(rea|int|exp|rec|fai|ok).*/\1/') in int) ERR=2 ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: DEGRADED"