report failures from smart log
[gnt-info] / smart-megaraid.sh
index 21e455a..35db0c9 100755 (executable)
@@ -4,7 +4,7 @@
 # smart-megaraid.sh '^# 1'             # default without args
 # SMART="-t long" smart-megaraid.sh    # execute smart command
 
-pattern='(^# [1-2]|test remaining|Hours|Error|Serial|Model|Firmware)'
+pattern='(^# [1-2]|test remaining|Hours|Error|Serial|Model|Firmware|Load|Reallocated|Pending|failure)'
 test ! -z "$1" && pattern=$*
 
 did_megaraid=0
@@ -26,9 +26,9 @@ test -r /proc/mdstat && cat /proc/mdstat
 lsblk --noheadings --scsi -o name | while read drive ; do
        test ! -z "$SMART" && smartctl $SMART /dev/$drive > /dev/shm/smart.$drive-out
        smartctl -a /dev/$drive > /dev/shm/smart.$drive
-       if egrep -q '(PERC|MegaRaid/DELL)' /dev/shm/smart.$drive ; then
+       if egrep -q '(PERC|MegaRaid|DELL)' /dev/shm/smart.$drive ; then
                megaraid $drive
        fi
 done
 
-egrep "$pattern" /dev/shm/smart.* | grep -v -- '-  *0$' | cut -d. -f2- | sed -e 's/:/\t/'
+egrep -i "$pattern" /dev/shm/smart.* | grep -v -- '-  *0$' | cut -d. -f2- | sed -e 's/:/\t/'