Mrtg、MRTG安装配置指导手册

安装MRTG(http://people.ee.ethz.ch/~oetiker/webtools/
首页 新闻资讯 行业资讯 Mrtg、MRTG安装配置指导手册

mrtg 安装(http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub),可以使用用mrtg-2.9.17.zip或者mrtg-2.9.29.zip 。在win32中的文件应该包含一个rateup.exe 。


mrtg 安装:
1.解压MRTG到c:\mrtg-2.9.17目录下
2.安装perl,你要确信perl的系统目录路径跟下面列出的一致:
C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;...
你可以到控制面板--系统--环境变量中看到这些信息。
如果你安装好了,可以在命令提示符下,到c:\mrtg-2.9.17\bin目录下,输入:
perl mrtg

系统会给你一个正常的错误信息,需要一个mrtg 安装的配置文件:
Usage: mrtg mrtg-2.9.17 is the Multi Router Traffic Grapher.If you want to know more about this tool, you might want
to read the docs. They came together with mrtg!Home: http://people.ee.ethz.ch/~oetiker/webtools/mrtg/配置MRTG:
首先应该建立一个MRTG的配置文件,你需要知道下面的一些信息:
1.了解你要监控的设备ip地址或者主机名,snmp的端口号码(如果不是标准的端口号码);
2.如果你想监控其它的输入输出字节,还需要知道设备得的SNMPOID
3.***你还必须了解SNMP的只读团体字符串

现在用一个例子说明一下:设备ip为10.56.57.38,我们将监控流量和CPU负载
1.首先我们设置mrtg 安装的默认配置文件,在命令提示符下,进入到c:\mrtg-2.9.17\bin 目录下,输入下面命令:
perl cfgmaker public@10.56.57.38 --global "WorkDir: c:\InetPub\wwwroot\MRTG" --output mrtg.cfg

这样就建立了一个初始的配置文件,注意这个文件中设备所有接口的存储号码。当你重配置你的设备时这些号码可能会被改变,因此你可以使用cfgmaker描述一些接口。
 

复制

C:\mrtg-2.9.17\mrtg-2.9.17\bin>perl cfgmaker public@10.56.57.38 --global "WorkDi  r: c:\InetPub\wwwroot\MRTG" --output mrtg.cfg  --base: Get Device Info on public@10.56.57.38:  --base: Vendor Id:  --base: Populating confcache  --snpo: confcache public@10.56.57.38: Descr MS TCP Loopback interface  --snpo: confcache public@10.56.57.38: Descr VMware Virtual Ethernet Adapter --> --snpo: confcache public@10.56.57.38: Descr VMware Virtual Ethernet Adapter -->(duplicate)  --snpo: confcache public@10.56.57.38: Descr Intel 8255x-based Integrated Fast Ethernet  --snpo: confcache public@10.56.57.38: Ip 10.56.57.38 --> 16777221  --snpo: confcache public@10.56.57.38: Ip 127.0.0.1 --> 1  --snpo: confcache public@10.56.57.38: Ip 192.168.198.1 --> 3  --snpo: confcache public@10.56.57.38: Ip 192.168.240.1 --> 2  --snpo: confcache public@10.56.57.38: Type 24 --> 1  --snpo: confcache public@10.56.57.38: Type 6 --> 2  --snpo: confcache public@10.56.57.38: Type 6 --> 3 (duplicate)  --snpo: confcache public@10.56.57.38: Type 6 --> 16777221 (duplicate)  --snpo: confcache public@10.56.57.38: Eth--> 1  --snpo: confcache public@10.56.57.38: Eth 00-50-56-c0-00-08 --> 2  --snpo: confcache public@10.56.57.38: Eth 00-50-56-c0-00-01 --> 3  --snpo: confcache public@10.56.57.38: Eth 00-a0-c9-25-ba-9d --> 16777221  --base: Get Interface Info  --base: Walking ifIndex  --base: Walking ifType  --base: Walking ifSpeed  --base: Walking ifAdminStatus  --base: Walking ifOperStatus  --base: Writing mrtg.cfg
  • 1.

  • 2.

  • 3.

  • 4.

  • 5.

  • 6.

  • 7.

  • 8.

  • 9.

  • 10.

  • 11.

  • 12.

  • 13.

  • 14.

  • 15.

  • 16.

  • 17.

  • 18.

  • 19.

  • 20.

  • 21.

  • 22.

  • 23.

  • 24.

  • 25.

  • 26.

  • 27.

  • 28.

现在基本mrtg 安装配置文件建立,你进入c:\mrtg-2.9.17\bin 目录下输入下面的命令看一下结果:
perl mrtg mrtg.cfg

现在你就可以通过web查看到一些流量信息。这些信息将每隔五分钟描述结果,这样你就得每隔几分钟运行一次。使MRTG实时运行:
现在我们希望让他实时运行,我们需要对他的配置文件进行设置,让他运行后不再终止。以避免每隔五分钟就的运行一次。
增加选项
RunAsDaemon: yes
到你的mrtg.cfg文件中并且开始运行:
start /Dc:\mrtg-2.9.17\bin wperl mrtg --logging=eventlog mrtg.cfg
如果你想停止的话,可以在任务管理器中终止wperl进程。

假如你想在win启动时就启动MRTG,可以使用下面的信息:
Target:wperl mrtg --logging=eventlog mrtg.cfg
Start in:c:\mrtg-2.9.17\bin
你可以参阅下面的页面信息:http://www.firedaemon.com/mrtg-howto.html
其使用firedaemon软件

【编辑推荐】

  1. Linux查看端口使用状态及启动

  2. linux 网络监控系统的开发及其应用

  3. Linux查看进程命令和具体操作

  4. 系统监控:linux 系统监控命令详解

  5. Linux监控网络流量工具安装及功能

 

13    2010-06-07 18:12:39    mrtg 安装