方法一:
apt install lm-sensors hddtemp
sensors
hddtemp /dev/sd?
方法二,数值除以1000就是真实温度
grep . /sys/class/thermal/thermal_zone*/type
/sys/class/thermal/thermal_zone0/type:acpitz
/sys/class/thermal/thermal_zone1/type:acpitz
/sys/class/thermal/thermal_zone2/type:x86_pkg_temp
grep . /sys/class/thermal/thermal_zone*/temp
/sys/class/thermal/thermal_zone0/temp:27800
/sys/class/thermal/thermal_zone1/temp:29800
/sys/class/thermal/thermal_zone2/temp:29000
下面这个更全面,包含所有cpu核心及i350网卡温度:
grep . /sys/class/hwmon/hwmon*/name
/sys/class/hwmon/hwmon0/name:acpitz
/sys/class/hwmon/hwmon1/name:i350bb
/sys/class/hwmon/hwmon2/name:coretemp
grep . /sys/class/hwmon/hwmon*/temp*input
/sys/class/hwmon/hwmon0/temp1_input:27800
/sys/class/hwmon/hwmon0/temp2_input:29800
/sys/class/hwmon/hwmon1/temp1_input:42000
/sys/class/hwmon/hwmon2/temp1_input:29000
/sys/class/hwmon/hwmon2/temp2_input:28000
/sys/class/hwmon/hwmon2/temp3_input:28000
/sys/class/hwmon/hwmon2/temp4_input:29000
/sys/class/hwmon/hwmon2/temp5_input:28000
读取硬盘SMART查看温度:
ls -1 /dev/sd? | xargs -n1 smartctl -A | grep Celsius
参考:
https://developer.toradex.com/knowledge-base/temperature-sensor-linux
标签:none
good, very helpful to me