4月 20

CentOS5.5 lm_sensorsによるファンコントロール

By はるはる。
Categories: CentOS
Tags: , , , , , , Add comments

毎回細かい設定値とかを忘れてしまうのでメモがてら。

インストール

[root@Uranus ~] # yum install -y lm_sensors

サービス起動・自動起動設定

[root@Uranus ~] # service lm_sensors start
[root@Uranus ~] # chkconfig lm_sensors on

センサー認識

[root@Uranus ~] # sensors-detect # ひたすらEnter

設定ファイル作成(環境による)

[root@Uranus ~] # pwmconfig

設定ファイル確認(環境による)

[root@Uranus ~]# cat /etc/fancontrol
INTERVAL=10
FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp1_input hwmon1/device/pwm2=hwmon0/device/temp1_input
FCFANS=hwmon1/device/pwm1=hwmon1/device/fan1_input hwmon1/device/pwm2=hwmon1/device/fan2_input
MINTEMP=hwmon1/device/pwm1=45 hwmon1/device/pwm2=35
MAXTEMP=hwmon1/device/pwm1=55 hwmon1/device/pwm2=45
MINSTART=hwmon1/device/pwm1=75 hwmon1/device/pwm2=30
MINSTOP=hwmon1/device/pwm1=60 hwmon1/device/pwm2=28
MINPWM=hwmon1/device/pwm1=0
MAXPWM=hwmon1/device/pwm1=255

上記の設定の場合、CPUコア温度が45度以上、環境温度が35度以上でケースファンが回り始める。

ファンコントロール実行

[root@Uranus ~]# cat /var/log/fancontrol.log
Loading configuration from /etc/fancontrol ...

Common settings:
  INTERVAL=10

Settings for hwmon1/device/pwm1:
  Depends on hwmon1/device/temp1_input
  Controls hwmon1/device/fan1_input
  MINTEMP=45
  MAXTEMP=55
  MINSTART=75
  MINSTOP=60
  MINPWM=0
  MAXPWM=255

Settings for hwmon1/device/pwm2:
  Depends on hwmon0/device/temp1_input
  Controls hwmon1/device/fan2_input
  MINTEMP=35
  MAXTEMP=45
  MINSTART=30
  MINSTOP=28
  MINPWM=0
  MAXPWM=255

Enabling PWM on fans...
Starting automatic fan control...

温度とファン回転数の確認

[root@Uranus ~]# sensors
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp:
             +34°C
Core1 Temp:
             +36°C

it8716-isa-0290
Adapter: ISA adapter
VCore:     +0.98 V  (min =  +0.00 V, max =  +4.08 V)
VDDR:      +3.31 V  (min =  +0.00 V, max =  +4.08 V)
+3.3V:     +0.00 V  (min =  +0.00 V, max =  +4.08 V)   ALARM
+5V:       +4.78 V  (min =  +0.00 V, max =  +6.85 V)
+12V:     +11.71 V  (min =  +0.00 V, max = +16.32 V)
in5:       +0.00 V  (min =  +0.00 V, max =  +4.08 V)   ALARM
in6:       +0.00 V  (min =  +0.00 V, max =  +4.08 V)   ALARM
5VSB:      +4.68 V  (min =  +0.00 V, max =  +6.85 V)
VBat:      +3.01 V
fan1:        0 RPM  (min =    0 RPM)
fan2:        0 RPM  (min =    0 RPM)
fan3:        0 RPM  (min =    0 RPM)
temp1:       +44°C  (low  =    -1°C, high =  +127°C)   sensor = diode
temp2:       +36°C  (low  =    -1°C, high =  +127°C)   sensor = thermistor
temp3:        +0°C  (low  =    -1°C, high =  +127°C)   sensor = thermistor
vid:      +1.100 V

ここまで問題なければ、バックグラウンドで実行し、次回起動時に自動起動するようにcrontabに書く。 /etc/rc.local に記述して自動起動させる
[root@Uranus ~]# /usr/sbin/fancontrol &> /var/log/fancontrol.log &
[root@Uranus ~]# crontab -e
@reboot /usr/sbin/fancontrol &> /var/log/fancontrol.log &

[root@Uranus ~]# /usr/sbin/fancontrol &> /var/log/fancontrol.log &
[root@Uranus ~]# echo "/usr/sbin/fancontrol &> /var/log/fancontrol.log &" >> /etc/rc.local

※2010/4/23 訂正。
CentOS5.6になってからcrontabに@rebootと指定しても自動機能しない模様?
/etc/rc.localに記述するように変更しました。

Leave a Reply

preload preload preload