Created
November 9, 2017 19:21
-
-
Save mdpuma/6f5aa62a97de9062a54356325dab14cc to your computer and use it in GitHub Desktop.
get_drive_temp.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| raid=cciss | |
| maxdisks=7 | |
| for i in {0..7}; do | |
| temp=$(smartctl -a -d $raid,$i /dev/sda | grep "Current Drive Temperature:" | awk -F: '{ print $2}') | |
| [ -z "$temp" ] && temp=$(smartctl -a -d $raid,$i /dev/sda | grep "Temperature_Celsius" | grep -oE "[0-9]+" | xargs | cut -d ' ' -f7); | |
| [ -n "$temp" ] && echo slot $i: $temp; | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment