-
-
Save qxzg/04a119b55109c3e2b18f20d4fa00292a to your computer and use it in GitHub Desktop.
FreeNAS 下查看硬盘温度
参考:http://forums.freenas.org/threads/how-to-monitor-system-cpu-hdd-mobo-gpu-temperatures-on-freenas-8.2994/
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/sh | |
| while true | |
| do | |
| echo " CPU temp :" | |
| sysctl -a |egrep -E "cpu\.[0-9]+\.temp" | |
| echo | |
| echo " HDD temp :" | |
| for i in $(sysctl -n kern.disks) | |
| do | |
| DevTemp=`smartctl -a /dev/$i | awk '/Temperature_Celsius/{print $0}' | awk '{print $10 "C"}'` | |
| DevSerNum=`smartctl -a /dev/$i | awk '/Serial Number:/{print $0}' | awk '{print $3}'` | |
| DevName=`smartctl -a /dev/$i | awk '/Device Model:/{print $0}' | awk '{print $3}'` | |
| echo $i $DevTemp $DevSerNum $DevName | |
| done | |
| echo 5 | |
| sleep 5 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment