MRTGでHDDの温度も見る
# /usr/sbin/smartctl -A /dev/hda | grep Temperature | awk '{print $10}' 33
こんな感じでHDDの温度を知ることができるのですが、
これをMRTGにAddしちゃいました。
# vi /usr/local/bin/hddtemp.sh
#/bin/sh /usr/sbin/smartctl -A /dev/hda | grep Temperature | awk '{print $10}' /usr/sbin/smartctl -A /dev/hda | grep Temperature | awk '{print $10}' ←同じ値を二度吐いてます。エラー防止
# vi /etc/mrtg/mrtg.conf
### HDD Temperature ### Target[hddtemp]: `/usr/local/bin/hddtemp.sh` MaxBytes[hddtemp]:70 Unscaled[hddtemp]:dwmy Options[hddtemp]: gauge, growright, noinfo , nopercent Title[hddtemp]: HDD Temperature PageTop[hddtemp]: <H1>HDD温度</H1> ShortLegend[hddtemp]: (Celsius) YLegend[hddtemp]: HDD Temperature(Celsius) LegendI[hddtemp]: hda LegendO[hddtemp]: none Legend1[hddtemp]: hda(Celsius)
こんな感じでOKです。