Linux
Tips
CPUの温度やファンの回転数などをモニタするには
北浦訓行
2005/6/2
PCのマザーボードには、電源電圧やCPUの温度、CPUファンの回転数などをモニタする機能があり、BIOS画面でそれを確認することができる。「lm_sensors 」というプログラムを利用すれば、それらをLinux上で知ることが可能になる(注 )。
注: lm_sensorsは、すべてのチップセットおよびセンサーチップに対応しているわけではない。マザーボードに搭載されているセンサーチップをマニュアルなどで特定し、lm_sensorsのWebサイトの「Supported Devices」でサポート状況を確認すること。
Fedora Core 3(FC3)には、lm_sensorsのパッケージが用意されている。インストールされていない場合は、
でインストールできる。また、lm_sensorsの最新版はhttp://secure.netroedge.com/%7Elm78/ でダウンロード可能だ。ここでは、例としてFC3でlm_sensorsを利用する手順を説明する。
最初に、sensors-detect コマンドでセンサーを検出する。途中でいくつか質問が表示されるが、基本的には[Enter]キーを押すだけでいいだろう。
# sensors-detect
(省略)
We can start with probing for (PCI) I2C or SMBus adapters.
You do not need any special privileges for this.
Do you want to probe now? (YES/no): ←[Enter]キー
To make the sensors modules behave correctly, add these lines to
/etc/modules.conf:
#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----
To load everything that is needed, add this to some /etc/rc* file:
#----cut here----
# I2C adapter drivers
modprobe i2c-amd756
modprobe i2c-isa
# I2C chip drivers
modprobe w83781d
modprobe eeprom
modprobe w83627hf
# sleep 2 # optional
/usr/bin/sensors -s # recommended
#----cut here----
WARNING! If you have some things built into your kernel, the list
above
will contain too many modules. Skip the appropriate ones! You really
should
try these commands right now to make sure everything is working
properly.
Monitoring programs won't work until it's done.
Do you want to generate /etc/sysconfig/lm_sensors? (YES/no): ←[Enter]キー
Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors
for initialization at boot time.
最後に、/etc/modules.conf および/etc/rc* に追加すべき項目が表示される。FC3の場合、/etc/modules.confは/etc/modprobe.conf 、/etc/rc*は/etc/rc.local に読み替えること。まずはsensors-detectコマンドの指示どおり、/etc/modprobe.confに以下の行を追加する。
# I2C module options
alias char-major-89 i2c-dev
続いて、/etc/rc.localに
# I2C adapter drivers
modprobe i2c-amd756
modprobe i2c-isa
# I2C chip drivers
modprobe w83781d
modprobe eeprom
modprobe w83627hf
# sleep 2 # optional
/usr/bin/sensors -s # recommended
を追加する。
以上の作業が終了したらシステムを再起動して、lsmod コマンドでモジュールが読み込まれているかどうかを確認する。
# lsmod
Module Size Used by
(省略)
w83627hf 30185 0
w83781d 35049 0
i2c_sensor 7489 3 eeprom,w83627hf,w83781d
i2c_isa 6081 0
i2c_amd756 10309 0
i2c_dev 13633 0
i2c_core 25665 7 eeprom,w83627hf,w83781d,i2c_sensor,
i2c_isa,i2c_amd756,i2c_dev
(省略)
ハードウェアの情報は、sensors コマンドで表示できる。
# sensors
eeprom-i2c-0-54
Adapter: SMBus AMD768 adapter at 80e0
Unknown EEPROM type (255).
eeprom-i2c-0-51
Adapter: SMBus AMD768 adapter at 80e0
Memory type: DDR SDRAM DIMM
Memory size (MB): 512
eeprom-i2c-0-50
Adapter: SMBus AMD768 adapter at 80e0
Memory type: DDR SDRAM DIMM
Memory size (MB): 512
w83627hf-isa-0c00
Adapter: ISA adapter
VCore 1: +1.73 V (min = +0.00 V, max = +0.00 V) ALARM
VCore 2: +1.73 V (min = +0.00 V, max = +0.00 V) ALARM
+3.3V: +3.28 V (min = +3.14 V, max = +3.47 V)
+5V: +4.92 V (min = +4.76 V, max = +5.24 V)
+12V: +9.48 V (min = +10.82 V, max = +13.19 V) ALARM
-12V: -12.28 V (min = -13.18 V, max = -10.80 V)
-5V: +0.08 V (min = -5.25 V, max = -4.75 V) ALARM
V5SB: +5.46 V (min = +4.76 V, max = +5.24 V) ALARM
VBat: +2.05 V (min = +2.40 V, max = +3.60 V) ALARM
fan1: 5357 RPM (min = 3214 RPM, div = 2)
fan2: 4090 RPM (min = 9121 RPM, div = 2) ALARM
fan3: 0 RPM (min = 4017 RPM, div = 2) ALARM
temp1: +80°C (high = +11°C, hyst = -107°C) sensor = thermistor ALARM
temp2: +80.5°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM
temp3: +79.5°C (high = +80°C, hyst = +75°C) sensor = thermistor
ERROR: Can't get VID data!
alarms:
beep_enable:
Sound alarm disabled
(省略)
Linux Squareフォーラム Linux Tipsカテゴリ別インデックス
TechTargetジャパン
Linux Square フォーラム 新着記事
新しい記事も入っていて安心しました (2012/2/7) Linux Squareのアクセスランキングを公開します。定番の記事ばかりでなく、連載中の記事もよろしくお願いいたします
エラーメッセージをどう扱うか? (2012/2/2) 今回は、スクリプト実行時にエラーが発生したことを知らせるメッセージの扱い方を説明します
ファイルのアップロードを制限する (2012/1/30) HTTPクライアントがアップロードしてくるファイルの扱いについて解説します。そもそも受け入れる必要があるのか? ということのほかにも、いろいろ設定が必要です
OSに付属するシェルスクリプトを読んで技術を盗む (2012/1/27) シェルスクリプトマスターに近づくには、他人から技術を盗まなければならない。OS付属のスクリプトから技術を盗もう
キャリアアップ
**先週の人気講座ランキング**
〜 Android編 〜