【インストール方法】
1.MRTGを解凍してC:\にmrtg新規フォルダを作成してc:\mrtgフォルダに本体を保存する。
2.ローカルマシンのMRTGの設定ファイル(mrtg.cfg)を自動生成する場合はDOS窓で下記コマンドを実行すればC:\mrtg\binにmrtg.cfgが作成される。
例)
・SNMPコミュニティー名 : public
・mrtg.cfgで作成されるWEBファイル設置場所 : C:\xampplite\htdocs\mrtgdata
・MRTGの設定ファイル名 : mrtg.cfg
C:\>cd C:\mrtg\bin
C:\mrtg\bin>perl cfgmaker public@localhost –global “WorkDir: C:\xampplite\htdocs\mrtgdata” –output mrtg.cfg
上記のコマンドを実行するとDOS窓には、下記のような表示されC:\mrtg\binにmrtg.cfgが作成されます。
cs\mrtgdata” –output mrtg.cfg
–base: Get Device Info on public@localhost:
–base: Vendor Id: Unknown Vendor – 1.3.6.1.4.1.311.1.1.3.1.1
–base: Populating confcache
–base: Get Interface Info
–base: Walking ifIndex
–snpd: public@localhost: -> 1 -> ifIndex = 1
–snpd: public@localhost: -> 2 -> ifIndex = 2
–snpd: public@localhost: -> 3 -> ifIndex = 3
–snpd: public@localhost: -> 4 -> ifIndex = 4
–snpd: public@localhost: -> 5 -> ifIndex = 5
–snpd: public@localhost: -> 6 -> ifIndex = 6
–snpd: public@localhost: -> 7 -> ifIndex = 7
–snpd: public@localhost: -> 8 -> ifIndex = 8
–snpd: public@localhost: -> 9 -> ifIndex = 9
–snpd: public@localhost: -> 10 -> ifIndex = 10
–snpd: public@localhost: -> 11 -> ifIndex = 11
–snpd: public@localhost: -> 12 -> ifIndex = 12
–snpd: public@localhost: -> 13 -> ifIndex = 13
–snpd: public@localhost: -> 14 -> ifIndex = 14
–snpd: public@localhost: -> 15 -> ifIndex = 15
–snpd: public@localhost: -> 16 -> ifIndex = 16
–snpd: public@localhost: -> 17 -> ifIndex = 17
–snpd: public@localhost: -> 18 -> ifIndex = 18
–base: Walking ifType
–snpd: public@localhost: -> 1 -> ifType = 24
–snpd: public@localhost: -> 2 -> ifType = 131
–snpd: public@localhost: -> 3 -> ifType = 131
–snpd: public@localhost: -> 4 -> ifType = 131
–snpd: public@localhost: -> 5 -> ifType = 131
–snpd: public@localhost: -> 6 -> ifType = 23
–snpd: public@localhost: -> 7 -> ifType = 6
–snpd: public@localhost: -> 8 -> ifType = 6
–snpd: public@localhost: -> 9 -> ifType = 6
–snpd: public@localhost: -> 10 -> ifType = 23
–snpd: public@localhost: -> 11 -> ifType = 6
–snpd: public@localhost: -> 12 -> ifType = 131
–snpd: public@localhost: -> 13 -> ifType = 6
–snpd: public@localhost: -> 14 -> ifType = 6
–snpd: public@localhost: -> 15 -> ifType = 6
–snpd: public@localhost: -> 16 -> ifType = 6
–snpd: public@localhost: -> 17 -> ifType = 6
–snpd: public@localhost: -> 18 -> ifType = 6
–base: Walking ifAdminStatus
–snpd: public@localhost: -> 1 -> ifAdminStatus = 1
–snpd: public@localhost: -> 2 -> ifAdminStatus = 1
–snpd: public@localhost: -> 3 -> ifAdminStatus = 1
–snpd: public@localhost: -> 4 -> ifAdminStatus = 1
–snpd: public@localhost: -> 5 -> ifAdminStatus = 1
–snpd: public@localhost: -> 6 -> ifAdminStatus = 1
–snpd: public@localhost: -> 7 -> ifAdminStatus = 1
–snpd: public@localhost: -> 8 -> ifAdminStatus = 1
–snpd: public@localhost: -> 9 -> ifAdminStatus = 1
–snpd: public@localhost: -> 10 -> ifAdminStatus = 1
–snpd: public@localhost: -> 11 -> ifAdminStatus = 1
–snpd: public@localhost: -> 12 -> ifAdminStatus = 1
–snpd: public@localhost: -> 13 -> ifAdminStatus = 1
–snpd: public@localhost: -> 14 -> ifAdminStatus = 1
–snpd: public@localhost: -> 15 -> ifAdminStatus = 1
–snpd: public@localhost: -> 16 -> ifAdminStatus = 1
–snpd: public@localhost: -> 17 -> ifAdminStatus = 1
–snpd: public@localhost: -> 18 -> ifAdminStatus = 1
–base: Walking ifOperStatus
–snpd: public@localhost: -> 1 -> ifOperStatus = 1
–snpd: public@localhost: -> 2 -> ifOperStatus = 1
–snpd: public@localhost: -> 3 -> ifOperStatus = 2
–snpd: public@localhost: -> 4 -> ifOperStatus = 1
–snpd: public@localhost: -> 5 -> ifOperStatus = 1
–snpd: public@localhost: -> 6 -> ifOperStatus = 1
–snpd: public@localhost: -> 7 -> ifOperStatus = 1
–snpd: public@localhost: -> 8 -> ifOperStatus = 1
–snpd: public@localhost: -> 9 -> ifOperStatus = 1
–snpd: public@localhost: -> 10 -> ifOperStatus = 1
–snpd: public@localhost: -> 11 -> ifOperStatus = 1
–snpd: public@localhost: -> 12 -> ifOperStatus = 2
–snpd: public@localhost: -> 13 -> ifOperStatus = 1
–snpd: public@localhost: -> 14 -> ifOperStatus = 1
–snpd: public@localhost: -> 15 -> ifOperStatus = 1
–snpd: public@localhost: -> 16 -> ifOperStatus = 1
–snpd: public@localhost: -> 17 -> ifOperStatus = 1
–snpd: public@localhost: -> 18 -> ifOperStatus = 1
–base: Walking ifMtu
–snpd: public@localhost: -> 1 -> ifMtu = 1500
–snpd: public@localhost: -> 2 -> ifMtu = 4091
–snpd: public@localhost: -> 3 -> ifMtu = 1480
–snpd: public@localhost: -> 4 -> ifMtu = 1460
–snpd: public@localhost: -> 5 -> ifMtu = 1464
–snpd: public@localhost: -> 6 -> ifMtu = 1494
–snpd: public@localhost: -> 7 -> ifMtu = 1500
–snpd: public@localhost: -> 8 -> ifMtu = 1500
–snpd: public@localhost: -> 9 -> ifMtu = 1500
–snpd: public@localhost: -> 10 -> ifMtu = 3256
–snpd: public@localhost: -> 11 -> ifMtu = 1500
–snpd: public@localhost: -> 12 -> ifMtu = 1280
–snpd: public@localhost: -> 13 -> ifMtu = 1500
–snpd: public@localhost: -> 14 -> ifMtu = 1500
–snpd: public@localhost: -> 15 -> ifMtu = 1500
–snpd: public@localhost: -> 16 -> ifMtu = 1500
–snpd: public@localhost: -> 17 -> ifMtu = 1500
–snpd: public@localhost: -> 18 -> ifMtu = 1500
–base: Walking ifSpeed
–snpd: public@localhost: -> 1 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 2 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 3 -> ifSpeed = 0
–snpd: public@localhost: -> 4 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 5 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 6 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 7 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 8 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 9 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 10 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 11 -> ifSpeed = 100000000
–snpd: public@localhost: -> 12 -> ifSpeed = 100000
–snpd: public@localhost: -> 13 -> ifSpeed = 100000000
–snpd: public@localhost: -> 14 -> ifSpeed = 100000000
–snpd: public@localhost: -> 15 -> ifSpeed = 100000000
–snpd: public@localhost: -> 16 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 17 -> ifSpeed = 1073741824
–snpd: public@localhost: -> 18 -> ifSpeed = 1073741824
–base: Writing mrtg.cfg
(参考:作成されたmrtg.cnfの一番下の行に展開するフォルダーが記載されているので変更することにより別の場所にMRTGファイルを展開する事が可能である。)
WorkDir: C:\xampplite\htdocs\mrtgdata
3.DOS窓から下記コマンドを実行すると指定されたフォルダーにhtmlファイルが作成される。
C:\cd \mrtg\bin
C:\mrtg\bin>perl mrtg mrtg.cfg
4.上記コマンドを定期的(5分間1回)に実行すると、そのデータが蓄積され下記の様なURLでMRTGグラフが表示さる。
(C:\xampplite\htdocs\mrtgdataのフォルダの中身を見て拡張子htmlが付いているファイルを指定下さい。)
(例)
http://localhost/mrtgdata/localhost_1.html
5.DOS窓より perl mrtg mrtg.cfg のコマンドを定期的に実行してあげる必要があり、UNIXだとcron等で対応できるようですがWindowsでは、使用できないためタスクスケジューラを利用する事にします。