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 while [ $nr -lt 8 ] ; do
14 test ! -z "$SMART" && smartctl -d megaraid,$nr $SMART /dev/$drive > /dev/shm/smart.$drive.$nr-out
15 smartctl -d megaraid,$nr -a /dev/$drive > /dev/shm/smart.$drive.$nr
20 test -r /proc/mdstat && cat /proc/mdstat
22 lsblk --noheadings --scsi -o name | while read drive ; do
23 test ! -z "$SMART" && smartctl $SMART /dev/$drive > /dev/shm/smart.$drive-out
24 smartctl -a /dev/$drive > /dev/shm/smart.$drive
25 if ! grep -q '^# 1' /dev/shm/smart.$drive ; then
30 grep "$pattern" /dev/shm/smart.* | cut -d. -f2- | sed -e 's/:/\t/'