MRTG 監控 Server CPU 溫度
Description :
使用 MRTG 監控 CPU 溫度有個好處,除了可以確定 Server 上 CPU
的風扇有無掛點之外,我們也可以用於無人管理之機房,若機房內之冷氣出問題或不冷時我們亦可判斷,MRTG 真是網管人員的好幫手。
Step
1.
安裝監控系統之監控軟體,此軟體可查
出 CPU 溫度,所以我們安裝它。
#cd
/usr/ports/sysutils/xmbmon
#make
install WITHOUT_X11="yes"
Setp
2.
寫個 shell script
方便我們 MRTG 抓系統溫度資料。
#vi
/xxx-path-xxx/tempmon.sh
#!/bin/sh
/usr/local/bin/mbmon
-c 1 -i -T 4 -u -n
exit
0
Setp
3.
設定 MRTG 裡的 .cfg
設定檔,溫度資料輸出環境,這邊我們使用台灣慣用的攝氏 Centigrade 刻度。
#vi
/xxx-path-xxx/ntut.cfg
#
----- temperature ----
Target[temp]:
`/xxx-path-xxx/tempmon.sh`
MaxBytes[temp]:
100
Title[temp]:
FreeBSD System Temperature
PageTop[temp]:
<H1>System Temperature</H1>
Options[temp]:
gauge,absolute,unknaszero,growright
YLegend[temp]:
Temperature(C)
ShortLegend[temp]:
(C)
Legend1[temp]:
CPU Temperature
Legend2[temp]:
M/B Temperature
LegendI[temp]:
CPU Temp.
LegendO[temp]:
M/B Temp.
我的 MRTG 溫度表:
http://mrtg.ntut.idv.tw/ntut/temp.html