免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 549 | 回复: 0
打印 上一主题 下一主题

MRTG 系列连载-1 : MRTG 介绍 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-03 10:07 |只看该作者 |倒序浏览
mrtg

Description
The Multi Router Traffic Grapher (MRTG) is a tool to
monitor the traffic load on network links. MRTG generates HTML pages containing
PNG images which provide a LIVE visual representation of this traffic. Check
http://www.stat.ee.ethz.ch/mrtg/
to see what it does.
Go to
http://oss.oetiker.ch/mrtg
for all the details about mrtg.

# 注释 :MRTG 是一个监测网络链路流量的工具,生成 HTML 页面(内嵌
PNG 图片)


Highlights

#  注释 :MRTG
的亮点
Portable
MRTG works on most UNIX platforms and Windows
NT.

# 注释:可移植性。MRTG 可以在 UNIX 和 WINDOWS
上运行


Perl
MRTG is written in Perl and comes with full
source.

# 注释 :MRTG 是用 Perl
写的,附带源代码

Portable SNMP
MRTG Uses a highly portable SNMP implementation
written entirely in Perl (thanks to Simon Leinen). There is no need to install
any external SNMP package.

# 注释 :MRTG 使用自己写的可移植性强的 SNMP
客户端,不需要事先安装任何 SNMP 软件包

SNMPv2c support
MRTG can read the new SNMPv2c 64bit counters. No
more counter wrapping.

# 注释 :MRTG 能够读取 SNMP v2c 的 64 bit
计数器。


Reliable Interface
Identification

Router interfaces can be identified by IP
address, description and ethernet address in addition to the normal interface
number.

# 注释 :MRTG 可以通过 ip地址、描述信息、MAC
地址来区分不同的物理接口


Constant size Logfiles
MRTG's logfiles do NOT grow thanks to the use of
a unique data consolidation algorithm.

# 注释 :由于 MRTG
采取了数据合并算法,所以日志大小固定。


Automatic Configuration
MRTG comes with a set of configuration tools
which make configuration and setup very simple.

# 注释 :MRTG
通过提供一系列的工具实现自动配置


Performance
Time critical routines are written in C (thanks
to the initiative of Dave Rand my Co-Author).

# 注释:重要的例程都是用 C
写的,保证了软件的性能


GIF free Graphics
Graphics are generated directly in PNG format
using the GD library by Thomas Boutell.

# 注释 :图片是使用 GD 库生成的 PNG
格式。


Customizability
The look of the webpages produced by MRTG is
highly configurable.

# 注释 :MRTG
生成的页面外观可以自由的修改


RRDtool
MRTG has built-in hooks for using RRDtool. If
you are strapped for performance this may help.

# 注释 :MRTG 内建支持 RRDtool

Details

MRTG consists of a Perl script which uses SNMP
to read the traffic counters of your routers and a fast C program which logs the
traffic data and creates beautiful graphs representing the traffic on the
monitored network connection. These graphs are embedded into webpages which can
be viewed from any modern Web-browser.

# 注释 :MRTG 使用一个 Perl 脚本,通过
SNMP 读取流量信息。并通过 C 程序快速记录流量数据日志和生成图表

In addition to a detailed daily view, MRTG also
creates visual representations of the traffic seen during the last seven days,
the last five weeks and the last twelve months. This is possible because MRTG
keeps a log of all the data it has pulled from the router. This log is
automatically consolidated so that it does not grow over time, but still
contains all the relevant data for all the traffic seen over the last two years.
This is all performed in an efficient manner. Therefore you can monitor 200 or
more network links from any halfway decent UNIX box.

# 注释 :MRTG
除了提供每天的流量图外,还能提供每周的、每5周、每年的图表。

[color="#0000ff"]# 但即使这样日志文件也不会太大。

MRTG is not limited to monitoring traffic,
though. It is possible to monitor any SNMP variable you choose. You can even use
an external program to gather the data which should be monitored via MRTG.
People are using MRTG, to monitor things such as System Load, Login Sessions,
Modem availability and more. MRTG even allows you to accumulate two or more data
sources into a single graph.

# 注释 :MRTG 不限于监测流量,任何 SNMP
对象都可以被监测。

# 甚至还可以使用外部程序来收集数据,再交给 MRTG
。例如监测系统负载、会话数量等等


History

In 1994 I was working at a site where we had one
64kbit line to the outside world. Obviously, everybody was interested in knowing
how the link was performing. So I wrote a quick hack which created a constantly
updated graph on the web that showed the traffic load on our Internet link. This
eventually evolved into a rather configurable Perl script called MRTG-1.0 which
I released in spring 1995. After a few updates, I left my job at DMU to start
work at the Swiss Federal Institute of Technology. Due to lack of time I had to
put MRTG aside. One day in January of 1996, I received email from Dave Rand
asking if I had any ideas why MRTG was so slow. Actually, I did. MRTG's
programming was not very efficient and it was written entirely in Perl. After a
week or so, Dave wrote back to me and said he had tried what I had suggested for
improving MRTG's speed. Since the changes did not help much, he had decided to
rewrite the time-critical sections of MRTG in C. The code was attached to his
email. His tool increased the speed of MRTG by a factor of 40! This got me out
of my 'MRTG ignorance' and I started to spend my spare time developing of
MRTG-2.
Soon after MRTG-2 development had begun I
started to give beta copies to interested parties. In return I got many feature
patches, a lot of user feedback and bug fixes. The product you are getting now
wouldn't be in this state if it hadn't been for the great contributions and
support I received from of many people. I would like to take this opportunity to
thank them all. (See the files CHANGES for a long list of folk people who helped
to make MRTG what it is today.)


Command-line

Mrtg is also the name of the script you have to
run to poll data and generate the graphs. Most configuration is set through the
configuration file; some command-line options exist all the
same.

# 注释 :mrtg
也是用来轮询的脚本的名称,可以带下面的参数
--user username and --group
groupname

Run as the given user and/or group. (Unix Only)

# 注释 :--user  ,
--group  表示以什么用户/用户组运行


--lock-file
filename

Use an
alternate lock-file (the default is to use the configuration-file appended with
_l).

# 注释 :--lock-file
指定锁文件。默认是配置文件名后面加上 "_l"

[color="#ff0000"]


--confcache-file
filename

Use an
alternate confcache-file (the default is to use the configuration-file appended
with .ok)

[color="#ff0000"]# 注释 :--confcache-file  给出配置缓存文件。默认是配置文件加 ".ok"

[color="#ff0000"]

--logging
filename|eventlog

If this is set to writable filename, all output
from mrtg (warnings, debug messages, errors) will go to filename. If you
are running on Win32 you can specify eventlog instead of a filename which
will send all error to the windows event log.
NOTE:Note, there
is no Message DLL for mrtg. This has the side effect that the windows event
logger will display a nice message with every entry in the event log, complaing
about the fact that mrtg has no message dll. If any of the Windows folks want to
contribute one, they are welcome.

[color="#0000ff"]# 注释 :--logging  |eventlog 设置 MRTG 的输出信息写到什么地方。如果是  ,则记录到文件。如果是 windows ,则 使用 "eventlog"   

--daemon
Put MRTG into the background, running as a
daemon. This works the same way as the config file option, but the switch is
required for proper FHS operation (because /var/run is writable only by root)

# 注释 :--daemon 表示 MRTG
以守护进程方式运行


--fhs
Configure all mrtg paths to conform to the FHS
specification;
http://www.pathname.com/fhs/


# 注释 :--fhs 配置所有 MRTG 路径符合 FHS
规范

[color="#0000ff"]# 问题 :什么是 FHS 规范?


--check
Only check the cfg file for errors. Do not do
anything.

# 注释 :--check
仅仅检查配置文件的错误,其他的不做

#
可以使用该选项来检查配置文件的语法和格式是否正确

--pid-file=s
Define the name and path of the pid file for
mrtg running as a daemon

# 注释 :--pid-file=
定义以 daemon 方式运行的 MRTG 的 pid 文件的路径

--log-only
Only update the logfile, do not produce graphics
or html pages

# 注释 :--log-only 只更新日志,不生成图表或者
HTML 页面


--debug=s
Enable debug options. The argument of the debug
option is a comma separated list of debug values:
cfg  -
watch the config file reading
dir  -
directory mangeling
base - basic program flow
tarp - target
parser
snpo - snmp polling
fork - forking view
time - some timing
info
log  -
logging of data via rateup or rrdtool

# 注释 :--debug= 启用 debug
功能,可选的  有如下几个 :

#     -)cfg :输出 mrtg
读取配置文件的信息

[color="#0000ff"]#     -)dir :输出目录信息

#     -)base
:输出基础程序的信息

#     -)tarp
:输出目标解释的信息

#     -)snpo :输出 snmp
轮询的信息

#     -)fork :输出 fork view
的信息

[color="#0000ff"]#     -)time :输出定时信息

[color="#0000ff"]#     -)log :输出日志记录信息

# 注释 :可以指定多个 token ,每个用 ','
分开


Example:
--debug="cfg,snpo"

Read on
Learn more about MRTG by going to the mrtg home page
on:
http://oss.oetiker.ch/mrtg

Author
Tobias Oetiker
tobi@oetiker.ch
> and many
contributors
Last Update: 09/06/06 by
Tobias Oetiker


               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12066/showart_488175.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP