mtrgのインストール

mtrgを使ってサーバー負荷を監視しようということでインストールしてみました。その際の設定メモ。

# tar zxf mrtg-2.14.4.tar.gz
# cd mrtg-2.14.4
# ./configure –prefix=/usr/local/mrtg-2
–with-gd-inc=/usr/local/include
–with-gd-lib=/usr/local/lib
# make
# make install

設定
/usr/local/mrtg-2/bin/cfgmaker

cfgmaker –global ‘WorkDir: /usr/local/apache/htdocs/mrtg’
–global ‘Options[_]: bits,growright’
–output /usr/local/apache/htdocs/mrtg/cfg/mrtg.cfg
postmaster@test.net

WARNING: “Title[test]” not specified
WARNING: “MaxBytes[test]” not specified

cd /usr/local/mrtg-2/bin/
./cfgmaker –global
‘WorkDir: /usr/local/apache/htdocs/mrtg’
–global ‘Options[_]: bits,growright’
–global ‘Target[test]: 2:public@test.net’
–global ‘Title[test]: test: fe11’
–global ‘MaxBytes[test]: 25000’
–output /usr/local/apache/htdocs/mrtg/cfg/mrtg.cfg
postmaster@test.net
起動
/usr/local/mrtg-2/bin/mrtg /usr/local/apache/htdocs/mrtg/cfg/mrtg.cfg
crontabに登録
crontab -eでやっているなら
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/apache/htdocs/mrtg/cfg/mrtg.cfg –logging /var/log/mrtg.log

でも、SNMPサーバーが入って無かった。イミネェ… orz…