Thought I’d share this little script. Basically what I needed to do was build a way to track what hard drives were connected to my linux raid arrays along with their serial numbers and temperatures. This script requires hdparm and hddtemp which are both readily available on most distros. #!/bin/bash # set LANG for encoding celcius symbol, UTF-8 screws it up LANG=en_US IFS=$’\n’ for file in /dev/md[0-9]*; do VAL=`mdadm -D $file`; for line in $VAL; do if [[ $line =~…