LoginSignup
72
73

More than 5 years have passed since last update.

LinuxでCPUの温度を取得する

Last updated at Posted at 2016-02-09

TL;DR

LinuxでCPU温度を取得する方法メモ

sysfs経由で温度を取得する

例えば以下のように取得できる。

$ cat /sys/class/thermal/thermal_zone0/temp
48154 # -> 48.154℃

温度観測用のファイルがどこに存在するかが、CPUのアーキテクチャ依存かは未確認。(存在しない場合もある)

ターゲット名 ファイルパス
intel系 /sys/devices/platform/coretemp.0/temp[0-9]_input
i.mx6 /sys/class/thermal/thermal_zone0/temp
RaspberryPi /sys/class/thermal/thermal_zone0/temp

lm_sensors を使用する

パッケージをインストールできる環境なら lm_sensors を使うと良さそうです。
lm_sensors の使い方は検索するとたくさん出てくるので省略します。例として以下などを参照すると良いと思います。

lm sensors - ArchWiki
CentOS 6.5 - サーバ監視ツール(munin)でCPU温度・電圧・ファン回転数測定! - mk-mode BLOG

※自分の試した範囲ではVirtualBox等のVM環境上では取得できませんでした。

FVEip.png

xsensors 等と併用すればよりみやすいかもしれません。

XSensors CPUのコアごとの温度を表示するコンパクトなシステムモニタ | Ubuntuアプリのいいところ

CPUの耐熱温度について

DataSheetはあるんですが、結局何度まで大丈夫なのかはいまいち読み方が不明。
70℃前後あたりが想定温度で、Maxは100℃ぐらいまで?
ただし、温度が高くなるとプロセッサによってはクロックを下げる機能があるので、その閾値を参考にする必要がありそう。

intel

Intel® Core™ Processors Technical Resources

参考

全般

Generic Thermal Sysfs driver How To
monitoring - How do I get the CPU temperature? - Ask Ubuntu

intel

sensors - How to get core temperature of haswell i7 cores in i3status - Unix & Linux Stack Exchange
How to read CPU Temperature on Android platform

i.mx6 (freescale/NXP)

Get the temperature of i.mx6 | NXP Community

RaspberryPi

Raspberry Pi に熱対策してみる : アジャイル株式会社
RaspberryPi(Raspbian)のCPUの温度をcatを使わないで取得してみた - Qiita

72
73
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
72
73