X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=smart-megaraid.sh;h=35db0c90208edc902a7273952f75e5489f81ed21;hb=0ef451470bc9a108b6836e05abaeec44a3adec75;hp=5f158916694039e71f1f0d6e2824b2d15c20d52b;hpb=2ce716dba8b471323cb71778aa8e6a220ea31b80;p=gnt-info diff --git a/smart-megaraid.sh b/smart-megaraid.sh index 5f15891..35db0c9 100755 --- a/smart-megaraid.sh +++ b/smart-megaraid.sh @@ -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 ! grep -q '^# 1' /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/'