Skip to content

Commit

Permalink
Added online expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
Klintrup committed Dec 3, 2023
1 parent 1f43f2c commit 09bc3ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions check_smartarray.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# NRPE check for Proliant SmartArray Controllers (ciss)
# Written by: Søren Klintrup <soren at klintrup.dk>
# version 1.4.3
# version 1.4.4

PATH="/sbin:/bin:/usr/sbin:/usr/bin"
DEVICES="$(camcontrol devlist|grep "COMPAQ RAID"|sed -Ee 's/.*(pass[0-9]{1,3}).*/\1/')"
Expand All @@ -13,12 +13,12 @@ for DEVICE in ${DEVICES}
do
DEVICENAME="$(camcontrol devlist|grep ${DEVICE}|sed -Ee 's/.*(da[0-9]{1,3}).*/\1/')"
DEVICESTRING="$(camcontrol inquiry ${DEVICE} -D|sed -n -e 's/^[^<]*<\([^>]*\)>.*$/\1/p')"
if [ "$(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/')" = "" ]
if [ "$(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|exp|rec|fai|ok).*/\1/')" = "" ]
then
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: unknown state"
if ! [ "${ERR}" = 2 ];then ERR=3;fi
else
case $(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/') in
case $(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|exp|rec|fai|ok).*/\1/') in
int)
ERR=2
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: DEGRADED"
Expand All @@ -31,6 +31,10 @@ do
if ! [ "${ERR}" = 2 -o "${ERR}" = 3 ]; then ERR=1;fi
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: rebuilding"
;;
exp)
if ! [ "${ERR}" = 2 -o "${ERR}" = 3 ]; then ERR=1;fi
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: expanding"
;;
rea)
if ! [ "${ERR}" = 2 -o "${ERR}" = 3 ]; then ERR=1;fi
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: ready for recovery"
Expand Down

0 comments on commit 09bc3ca

Please sign in to comment.