4 # smart-megaraid.sh '^# 1' # default without args
5 # SMART="-t long" smart-megaraid.sh # execute smart command
8 test ! -z "$1" && pattern=$1
13 test $did_megaraid -eq 1 && return
16 while [ $nr -lt 8 ] ; do
17 test ! -z "$SMART" && smartctl -d megaraid,$nr $SMART /dev/$drive > /dev/shm/smart.$drive.$nr-out
18 smartctl -d megaraid,$nr -a /dev/$drive > /dev/shm/smart.$drive.$nr
24 test -r /proc/mdstat && cat /proc/mdstat
26 lsblk --noheadings --scsi -o name | while read drive ; do
27 test ! -z "$SMART" && smartctl $SMART /dev/$drive > /dev/shm/smart.$drive-out
28 smartctl -a /dev/$drive > /dev/shm/smart.$drive
29 if ! grep -q '^# 1' /dev/shm/smart.$drive ; then
34 grep "$pattern" /dev/shm/smart.* | cut -d. -f2- | sed -e 's/:/\t/'