tetraの外部記憶箱

«前の日記(2006-07-02) 最新 次の日記(2006-07-05)» 編集
Category;

2006-07-04

_ [log][linux] MRTGでハードディスクの温度をグラフ化

@IT:MRTGでハードディスクの温度変化をグラフ化するにはを参考に、締めっきりの部屋で稼動しているマシンのハードディスクの温度変化を観測してみることにした。ちなみに、当方の環境はFedora Core 5 + Maxtor 6Y160P0だ。

まず、ハードディスクの温度を測定するツールhddtempをインストール。

# yum install hddtemp

ためしに温度を測定してみると・・・

$ hddtemp /dev/hda
/dev/hda: Maxtor 6Y160P0: 46°C

と表示される。この数値をMRTGへ渡してあげるのだ。MRTGをインストールしよう。

# yum install mrtg

/etc/mrtg/mrtg.cfgファイルを下記のように編集する。

Target[hddtemp]: `/usr/sbin/hddtemp /dev/hda | awk '{print $4}' | sed -e 's/[^0-9]//g'`
MaxBytes[hddtemp]: 100
Title[hddtemp]: temperature of hard drive
PageTop[hddtemp]: <h1&rt;temperature of hard drive</h1&rt;
Options[hddtemp]: growright,absolute,gauge,nopercent,noinfo
WithPeak[hddtemp]: ymw
YLegend[hddtemp]: Temperature
ShortLegend[hddtemp]: C
LegendI[hddtemp]: Temp:
LegendO[hddtemp]:
Legend1[hddtemp]: HDD Temperature in Degrees Celcius
Legend2[hddtemp]:

※ ちなみに、上記のサイトでは、Targetのコマンドが/usr/sbin/hddtemp /dev/hda | awk '{print $3}'となっていたが、当方の環境ではダメだった。

初期設定では、http://PCのIPアドレス/mrtg/hddtemp.htmlにグラフページが作成される(イントラからのみ閲覧可能になっている。変えたい場合は、/etc/httpd/conf.d/mrtg.confを編集のこと)。MRTGはデフォルトで5分おきに更新されるので、もし表示されなかったらしばらく置いてからアクセスしてみよう。

ちなみに、このWebサーバの温度は→こちらから