LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 11378|回复: 20

终于搞定了MTRG流量监控

[复制链接]
发表于 2003-10-3 03:03:33 | 显示全部楼层 |阅读模式
Mrtg(Multi Router Traffic Grapher,MRTG)是一个监控网络链路流量负载的工具软件,它通过snmp协议从设备得到设备的流量信息,并将流量负载以包含PNG格式的图形的HTML文档方式显示给用户,以非常直观的形式显示流量负载
安装mrtg-2.10.5
#./configure --prefix=/usr/local/mrtg
make
make install
好了 因为mrtg是通过snmp来监控信息的 所以要修改一下snmp配置文件
vi /etc/snmp/snmpd.conf
#view systemview included mib2

的内容修改为:

view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

然后将

access notConfigGroup "" any noauth exact systemview none none

修改为:

access notConfigGroup "" any noauth exact mib2 none none

ok 启动 service snmpd start
好 接下来我们用cfgmaker来生成mrtg的配置文件
cd /usr/local/mrtg/bin
./cfgmaker --global "WorkDir: /var/www/html/mrtg"
--global "Options[_]: growright,bits"
--ifref=ip
--output /etc/mrtg.cfg
public@192.168.0.6
global指对哪些设备有效(如果有多个设备的情况下)
workDir 是指你APACHE的访问目录
Options用来指定一些特定的选项,这里的growright,bits是用来指定默认options配置的对于常见的应用来说默认options配置就可以满足需求了。ifref用来指示用什么选项来标识设备接口,这里指定使用IP地址来标识网络设备接口。ifref可以指定为nr、ip、eth、descr、name。nr表示用接口在MIBII库中Interface接口的ifIndex来识别接口;IP表示使用ip地址识别接口;eth表示使用接口的物理地址标识接口;descr表示使用接口的描述信息来标识接口;name表示使用接口名来标识接口。一般来说ip地址是唯一的,但是有些情况下接口是没有IP地址的,例如交换机就会出现这种情况。对于接口来说nr(接口号)是唯一的,因此对于一般情况使用IP地址就可以了,而对于其他一些情况则需要采用nr了
--output /etc/mrtg.cfg  指把配置文件生成在/etc目录下
public@192.168.0.1 监控192.168.0.1 采用public作为共同体名通过snmp协议来监控设备192.168.0.1。
ok 最后一步 启动mrtg
./mrtg /etc/mrtg.cfg 就可以了 然后用HTTP访问 http://192.168.0.6/mrtg
OK 监控你的网络吧

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2003-10-3 04:10:54 | 显示全部楼层
精华!!!

多谢宝兄!!!
 楼主| 发表于 2003-10-3 10:13:18 | 显示全部楼层
还有个疑问 那个MAX SPEED是指什么的MAX SPEED 我现在改成了100M  是不是指网络的最大速度  调大了就起不了看负载情况的作用了
发表于 2003-10-7 09:59:31 | 显示全部楼层
好像没起到控的做用
 楼主| 发表于 2003-10-7 18:10:46 | 显示全部楼层
一般我们有可能会没什么用 但对大型网络就很有用 管理员可以知道哪个时候网络负载最大 那就可以适当的调整机器 网络等
发表于 2003-10-8 22:57:43 | 显示全部楼层
nice
发表于 2003-10-10 11:09:20 | 显示全部楼层
直接用SNMP还不是一样.
发表于 2004-9-5 11:24:50 | 显示全部楼层
我照兄弟的方法做了,但是有下面的提示:

** Ooops, one of many bad things happened:

   a)  You don't have the GD library installed.
       Get it from http://www.boutell.com, compile it and
       use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify
       its location. You might also have to use --with-z-inc,
             --with-z-lib and --with-png-inc, --with-png-lib for gd
             versions 1.6 and higher.  Check config.log for more
       information on the problem.

   b)  You have the GD library installed, but not the gd.h
       header file.  Download the source (see above) and use
       --with-gd-inc=DIR to specify where the file can be found.

   c)  You have the library and the header file installed, but
       you also have a shared GD library in the same directory.
       Remove the shared library files and/or links (e.g.
       libgd.so.2.0.0, libgd.so and libgd.so.2).  This is especially
             likely if you're using a recent (post 1.8.4) version of GD
       and didn't configure it with --disable-shared.

   d)  You have gd library installed and also it's headers, but you are
       missing libpng (and headers) or freetype (and headers)
       (mrtg does not use freetype, but if your copy of gd is precompiled
       against it, you have to install it ...

   Consider following the instructions in doc/mrtg-unix-guide.txt
我的系统是redhat as2
发表于 2004-9-5 11:25:57 | 显示全部楼层
还有我看的别人做的有cpu,内存,硬盘的监控,还有网络流量的每天,每小时这样的监控,请问怎么做
发表于 2004-9-23 15:00:40 | 显示全部楼层
我也要试试!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表