- blogs:
- cles::blog
2010/09/06

linuxでコマンドラインから温度をモニタする


linuxにはコマンドラインからセンサー情報を取得するためのLm_sensorsというパッケージがあるので、今日はこれのインストールと設定に挑戦します。
ProjectInformation – lm-sensors
The primary mission for our project is to provide the best and most complete hardware health monitoring support for Linux, in the form of kernel drivers and a user-space library. We strive to produce well organized, efficient, safe, flexible, and tested code free of charge to all Linux users. The project attempts to support as many related devices as possible (when documentation is available), especially those which are commonly included on PC mainboards.
最近のディストリビューションを使っていて、カーネルがきちんと最新にアップデートされている環境であれば基本的にはyumで下記のようにインストールし、sensors-detectで表示される質問にすべてEnterで答えていくだけでOKなはずです。
# yum install lm_sensors
# sensors-detect
センサーが上手く認識されない場合には、下記のようにサイトから最新のsensors-detectを拾ってきて使うと改善する場合があります。
# wget http://dl.lm-sensors.org/lm-sensors/files/sensors-detect
# chmod 755 sensors-detect
# ./sensors-detect
また、それでもダメな場合には「CentOS 5 で認識されないハードウェアを使うとき ELRepo がべんり - daily dayflower」で紹介されているようにELRepoに登録されているlm_sensorsを使うと認識できるようになる場合もあります。
# rpm -Uvh http://elrepo.org/elrepo-release-0.1-1.el5.elrepo.noarch.rpm
# yum --disablerepo=base --disablerepo=updates --enablerepo=elrepo install kmod-coretemp lm_sensors
下記に実際のセンサーの認識の様子と取得例をメモしておきます。
あとはMRTGを使ってこれをグラフなんかにしてやると面白いかもしれません。
† センサーの認識の様子
基本的にはEnterで進んでいけば問題ありません。
下記のようにSuccess!で終わる行があれば、センサーが認識されています。
# sensors-detect
Stopping lm_sensors: [ OK ]
# sensors-detect revision 5569 (2008-12-15 09:36:09 +0100)
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 0000:00:1f.3: Intel ICH9
We will now try to load each adapter module in turn.
Load `i2c-i801' (say NO if built into your kernel)? (YES/no):
Module loaded successfully.
If you have undetectable or unsupported I2C/SMBus adapters, you can have
them scanned by manually loading the modules before running this script.
We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.
Next adapter: SMBus I801 adapter at 1100 (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x1f
Probing for `Maxim MAX6650/MAX6651'... No
Client found at address 0x2f
Probing for `National Semiconductor LM78'... No
Probing for `National Semiconductor LM78-J'... No
Probing for `National Semiconductor LM79'... No
Probing for `National Semiconductor LM80'... No
Probing for `Analog Devices ADT7470'... No
Probing for `Winbond W83781D'... No
Probing for `Winbond W83782D'... No
Probing for `Winbond W83792D'... No
Probing for `Winbond W83793R/G'... Success!
(confidence 8, driver `w83793')
Probing for `Winbond W83791SD'... No
Probing for `Winbond W83627HF'... No
Probing for `Winbond W83627EHF'... No
Probing for `Winbond W83627DHG'... No
Probing for `Asus AS99127F (rev.1)'... No
Probing for `Asus AS99127F (rev.2)'... No
Probing for `Asus ASB100 Bach'... No
Probing for `Winbond W83L786NR/NG/R/G'... No
Probing for `Analog Devices ADM9240'... No
Probing for `Dallas Semiconductor DS1780'... No
Probing for `National Semiconductor LM81'... No
Probing for `Analog Devices ADM1029'... No
Probing for `ITE IT8712F'... No
Probing for `Fintek custom power control IC'... No
Probing for `Winbond W83791D'... No
Client found at address 0x50
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... Yes
(confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'... No
Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no):
Probing for `National Semiconductor LM78' at 0x290... No
Probing for `National Semiconductor LM78-J' at 0x290... No
Probing for `National Semiconductor LM79' at 0x290... No
Probing for `Winbond W83781D' at 0x290... No
Probing for `Winbond W83782D' at 0x290... No
Probing for `IPMI BMC KCS' at 0xca0... No
Probing for `IPMI BMC SMIC' at 0xca8... No
Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Fintek'... Yes
Found `Winbond W83627HF/F/HG/G Super IO Sensors' Success!
(address 0x295, driver `w83627hf')
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Fintek'... No
Trying family `ITE'... No
Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no):
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD K10 thermal sensors... No
Intel Core family thermal sensor... Success!
(driver `coretemp')
Intel AMB FB-DIMM thermal sensor... No
VIA C7 thermal and voltage sensors... No
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `w83793' (should be inserted):
Detects correctly:
* Bus `SMBus I801 adapter at 1100'
Busdriver `i2c-i801', I2C address 0x2f
Chip `Winbond W83793R/G' (confidence: 8)
Driver `w83627hf' (should be inserted):
Detects correctly:
* ISA bus, address 0x295
Chip `Winbond W83627HF/F/HG/G Super IO Sensors' (confidence: 9)
Driver `coretemp' (should be inserted):
Detects correctly:
* Chip `Intel Core family thermal sensor' (confidence: 9)
Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
Starting lm_sensors: [ OK ]
† センサー情報の取得の様子
センサーが認識されればsensorsコマンドから下記のような感じでデータが取得できるようになります。
# sensors
w83793-i2c-0-2f
Adapter: SMBus I801 adapter at 1100
VCoreA: +1.12 V (min = +0.92 V, max = +1.38 V)
VCoreB: +1.24 V (min = +0.00 V, max = +2.05 V)
Vtt: +1.12 V (min = +0.99 V, max = +1.33 V)
in3: +0.50 V (min = +0.40 V, max = +0.67 V)
in4: +1.81 V (min = +1.62 V, max = +1.98 V)
+3.3V: +3.30 V (min = +2.96 V, max = +3.63 V)
+12V: +11.81 V (min = +10.75 V, max = +13.25 V)
+5V: +5.14 V (min = +4.64 V, max = +5.65 V)
5VSB: +4.97 V (min = +4.64 V, max = +5.65 V)
VBAT: +3.26 V (min = +2.96 V, max = +3.63 V)
fan1: 0 RPM (min = 712 RPM) ALARM
fan2: 0 RPM (min = 712 RPM) ALARM
fan3: 0 RPM (min = 712 RPM) ALARM
fan4: 0 RPM (min = 712 RPM) ALARM
fan5: 0 RPM (min = 712 RPM) ALARM
fan6: 0 RPM (min = 712 RPM) ALARM
fan7: 2083 RPM (min = 712 RPM)
fan8: 0 RPM (min = 712 RPM) ALARM
fan9: 0 RPM (min = 712 RPM) ALARM
fan10: 0 RPM (min = 712 RPM) ALARM
CPU1 Temp: +37.0 C (high = +83.0 C, hyst = +78.0 C)
CPU2 Temp:-101.0 C (high = +83.0 C, hyst = +78.0 C)
temp3: -128.0 C (high = +83.0 C, hyst = +78.0 C)
temp4: -128.0 C (high = +83.0 C, hyst = +78.0 C)
temp5: +37 C (high = +50 C, hyst = +45 C)
temp6: +39 C (high = +50 C, hyst = +45 C)
w83627hf-isa-0290
Adapter: ISA adapter
VCore 1: +0.03 V (min = +1.09 V, max = +1.50 V) ALARM
VCore 2: +0.03 V (min = +1.09 V, max = +1.50 V) ALARM
+3.3V: +0.03 V (min = +2.82 V, max = +3.79 V) ALARM
+5V: +5.16 V (min = +1.53 V, max = +5.51 V)
+12V: +0.12 V (min = +5.78 V, max = +1.09 V) ALARM
-12V: -14.75 V (min = -8.91 V, max = -4.47 V) ALARM
-5V: -7.61 V (min = +0.83 V, max = -2.03 V) ALARM
V5SB: +5.51 V (min = +4.65 V, max = +6.02 V)
VBat: +3.31 V (min = +1.52 V, max = +3.70 V)
fan1: 0 RPM (min = 3534 RPM, div = 2) ALARM
fan2: 0 RPM (min = 2909 RPM, div = 2) ALARM
fan3: 0 RPM (min = 2909 RPM, div = 2) ALARM
temp1: +126 C (high = -127 C, hyst = -53 C) sensor = thermistor ALARM
temp2: +126.5 C (high = +80 C, hyst = +75 C) sensor = thermistor ALARM
temp3: +126.5 C (high = +80 C, hyst = +75 C) sensor = thermistor ALARM
vid: +1.300 V (VRM Version 8.2)
alarms: Chassis intrusion detection ALARM
beep_enable:
Sound alarm enabled
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +43 C (high = +100 C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +45 C (high = +100 C)
トラックバックについて
Trackback URL:
お気軽にどうぞ。トラックバック前にポリシーをお読みください。[policy]
このエントリへのTrackbackにはこのURLが必要です→https://blog.cles.jp/item/3785
Trackbacks
このエントリにトラックバックはありません
Comments
愛のあるツッコミをお気軽にどうぞ。[policy]
古いエントリについてはコメント制御しているため、即時に反映されないことがあります。
古いエントリについてはコメント制御しているため、即時に反映されないことがあります。
コメントはありません
Comments Form
コメントは承認後の表示となります。
OpenIDでログインすると、即時に公開されます。
OpenID を使ってログインすることができます。
サイト内検索
検索ワードランキング
へぇが多いエントリ
閲覧数が多いエントリ
1 . アーロンチェアのポスチャーフィットを修理(113239)
2 . 福岡銀がデマの投稿者への刑事告訴を検討中(111861)
3 . 年次の人間ドックへ(111387)
4 . 2023 年分の確定申告完了!(1つめ)(110973)
5 . 三菱鉛筆がラミーを買収(110860)
2 . 福岡銀がデマの投稿者への刑事告訴を検討中(111861)
3 . 年次の人間ドックへ(111387)
4 . 2023 年分の確定申告完了!(1つめ)(110973)
5 . 三菱鉛筆がラミーを買収(110860)
cles::blogについて
Referrers