-
-
Save Raboo/91e799d1290920f9c22c to your computer and use it in GitHub Desktop.
FreeNAS 9 temperature script
This file contains 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/sh | |
# Write some general information | |
echo System Temperatures - `date` | |
uptime | awk '{ print "\nSystem Load:",$10,$11,$12,"\n" }' | |
# Write CPU temperatures | |
echo "CPU Temperature:" | |
sysctl -a | egrep -E "cpu\.[0-9]+\.temp" | |
# Write HDD temperatures and status | |
echo "HDD Temperature:" | |
for i in $(sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) if(match($i, '/ada/')) print $i }' ) ; do | |
echo $i: `smartctl -a -n standby /dev/$i | awk '/Temperature_Celsius/{DevTemp=$10;} /Serial Number:/{DevSerNum=$3}; /Device Model:/{DevVendor=$3; DevName=$4} END {printf "%s C - %s %s (%s)", DevTemp,DevVendor,DevName,DevSerNum }'`; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment