温度計

なんか急に鯖が再起動して、内部時計が2007年2月にタイムスリップしててびっくりした。
夏の暑さにやられたんかな、とか思って、CPUの温度とかチェックできるソフトウェアを導入してみた。


まずbisonが必要なので、入手しておく。
bisonをコンパイルするのにm4などが入ってないと怒られるらしいが、
僕の環境では入っていたので特には書かない。
m4の入手先はこちら→ http://ftp.gnu.org/gnu/m4/
ソースコード拾ってmakeするだけなんで、やることは一緒なんだけども。

wget http://ftp.gnu.org/gnu/bison/bison-2.4.tar.gz
tar xvf bison-2.4.tar.gz
cd bison-2.4
./configure
make
make install

[root@localhost ~]# bison --version
bison (GNU Bison) 2.4
...


ちゃんと入ってるようです。
次に本命のlm_sensors...といいたいとこだが、今度はflexってのが必要らしい。
なんなんだよもう!!


flex
http://flex.sourceforge.net/

wget http://jaist.dl.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.bz2
tar xvf flex-2.5.35.tar.bz2
cd flex-2.5.35
./configure
make
make install

[root@localhost ~]# flex --version
flex 2.5.35

よしよし。いい子だ。


最後にlm_sensorsを導入。
やることはやはり、ソースコードを拾ってきて、そのままmake。

wget http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-3.1.2.tar.bz2
tar xvf lm_sensors-3.1.2.tar.bz2
cd lm_sensors-3.1.2
make all
make install

makeだけだと途中で止まってしまうので、make allとしてみたら通った。


仕上げに"sensors-detect"で、適当に初期化する。
応答を聞かれてもEnterだけでOKっぽい。


実際に温度を検出するには、"sensors"を打つ。


chkconfigによる自動起動登録と確認

/sbin/service lm_sensors start
chkconfig lm_sensors on
chkconfig --list lm_sensors


再起動してみて動作のほどを確認してみる。

[root@localhost ~]# sensors
it8718-isa-0a10
Adapter: ISA adapter
in0: +1.14 V (min = +0.00 V, max = +4.08 V)
in1: +1.84 V (min = +0.00 V, max = +4.08 V)
in2: +2.03 V (min = +0.00 V, max = +4.08 V)
in3: +2.93 V (min = +0.00 V, max = +4.08 V)
in4: +2.03 V (min = +0.00 V, max = +4.08 V)
in5: +0.86 V (min = +0.00 V, max = +4.08 V)
in6: +1.12 V (min = +0.00 V, max = +4.08 V)
in7: +2.93 V (min = +0.00 V, max = +4.08 V)
Vbat: +3.36 V
fan1: 0 RPM (min = 0 RPM)
fan2: 3245 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
temp1: +25.0°C (low = -1.0°C, high = +127.0°C) sensor = thermistor
temp2: -128.0°C (low = -1.0°C, high = +127.0°C) sensor = disabled
temp3: +53.0°C (low = -1.0°C, high = +127.0°C) sensor = thermal diode
cpu0_vid: +1.450 V

あ、あれ。
これ多分うまく検出できてないんじゃね?


―終―