MRTGの使い方

2003.04.13

上へ
webalizer
MRTG
SquirrelMail
CourierIMAP+SquirrelMail

MRTGとは

あるサーバのトラフィック量をグラフ表示するためのツールです。(コンフィグレーションによっては他のデータもグラフ表示可能)

snmpのエージェントからデータを拾ってくるので,自分のマシンでsnmpのエージェント(snmpd)が動作している必要があります。(snmpdの設定方法)

MRTGのエラー

□ エラー

RedHat8.0添付のMRTGでは,コマンドからエラーメッセージを出します。

indexmakerのエラーの例
# indexmaker /etc/mrtg/localhost.cfg  > /var/www/html/mrtg/index.html
Can't locate package $VERSION for @MRTG_lib::ISA at /usr/bin/indexmaker line 49
main::BEGIN() called at /usr/bin/../lib/mrtg2/MRTG_lib.pm line 49
eval {...} called at /usr/bin/../lib/mrtg2/MRTG_lib.pm line 49
 

MRTGのバージョンアップするしかないようです。

□ 対策

以下のサイトからダウンロードしてインストールします。

bullet http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/

RedHatのRPMにしたものを以下においてあります。
IEなどのウェブブラウザでは,ftpが失敗する可能性が大きいので,リンクは張っていません。(参考: ftpクライアントの設定

bulletftp://ftp.aritia.org/pub/hizumi/RedHat8.0/RPMS/mrtg-2.9.25-1.i386.rpm
( ftp://ftp.aritia.org/pub/hizumi/RedHat8.0/RPMS )
bulletftp://ftp.aritia.org/pub/hizumi/RedHat8.0/SRPMS/mrtg-2.9.25-1.src.rpm(ソース)
 ( ftp://ftp.aritia.org )

RedHat9用

bulletftp://ftp.aritia.org/pub/hizumi/RedHat9.0/RPMS/i386/mrtg-2.9.29-2.i386.rpm
( ftp://ftp.aritia.org/pub/hizumi/RedHat9.0/RPMS/i386/ )
bullet ftp://ftp.aritia.org/pub/hizumi/RedHat9.0/SRPMS/mrtg-2.9.29-2.src.rpm(ソース)
 ( ftp://ftp.aritia.org/pub/hizumi/RedHat9.0/SRPMS/ )

 

 

コマンド

説明
# rpm -ivh mrtg-2.9.25-1.i386.rpm rpmでインストールします。既にインストールされていれば,-Fvhとしてください。

MRTGの設定

最低限の設定コマンド

コマンド

説明
# cfgmaker public@{ホスト名} >>  /etc/mrtg/mrtg.cfg 自ホストの情報を収集する場合。自ホストでsnmpdを実行させる必要があります。snmpdに関しては,別の章で説明しています。
# indexmaker /etc/mrtg/mrtg.cfg > /var/www/html/mrtg/myhost.html RedHatデフォルトのMRTGのディレクトリ上に,HTMLファイルを作成します。
# /usr/bin/mrtg /etc/mrtg/mrtg.cfg
Rateup WARNING: /usr/bin/rateup could not read the primary log file for est_2
Rateup WARNING: /usr/bin/rateup The backup log file for est_2 was invalid as well
Rateup WARNING: /usr/bin/rateup Can't remove est_2.old updating log file
Rateup WARNING: /usr/bin/rateup Can't rename est_2.log to est_2.old updating log
file
# /usr/bin/mrtg /etc/mrtg/mrtg.cfg
Rateup WARNING: /usr/bin/rateup Can't remove est_2.old updating log file
#
/usr/bin/mrtg /etc/mrtg/mrtg.cfg
3回,MRTGを実行させます。ワークのファイルを作成します。

参照方法

bullet http://localhost/mrtg/myhost.html をWEBブラウザで参照します。(localhostは,MRTGが実行しているホスト名に置き換えてください)

horizontal rule

改正歴

2003.03.30 ftpサイトのURLを修正
snmpdの設定へのリンクを張る
2003.04.13 記述の誤りの訂正
RedHat9用のRPMの追加
2003.04.26 ftpサイトのリンクを外した。
   

 

horizontal rule