- 论坛徽章:
- 0
|
系统:RedHat Enterprise Linux AS4
交换机:华为2100系列,ip:192.168.1.188
Apache服务已经配置完主目录为:/usr/local/apache2/htdocs
在此目录下创建一个mrtg目录
zlib,gd,libpng,JPEG,Freetype,Fontconfig等工具包都已经安装。
#tar -zxvf mrtg-2.12.2.tar.gz
#cd mrtg-2.12.2
#./configure --prefix=/usr/local/mrtg
--with-gd=/usr/include
--with-gd-lib=/usr/lib
--with-gd-inc=/usr/include
--with-png=/usr/include
--with-png-lib=/usr/lib
--with-zlib=/usr/include
--with-zlib-lib=/usr/lib
#make
#make install
1.配置并启动snmp服务
#vi /etc/snmp/snmpd.conf
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
改为
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
#/etc/rc.d/init.d/snmpd start
2.生成cfg文件
#usr/local/mrtg/bin/cfgmaker huawei7@92.168.1.188 > /usr/local/apache2/htdocs/mrtg/mrtg.cfg
#vi /usr/local/apache2/htdocs/mrtg/mrtg.cfg
mrtg.cfg内容:
# Created by
# /usr/local/mrtg/bin/cfgmaker huawei7@192.168.1.188
### Global Config Options
# for UNIX
# WorkDir: /usr/local/apache2/htdocs/mrtg/ —>修改后路径
# or for NT
# WorkDir: c:\mrtgdata
### Global Defaults
# to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits ->提示说把#去掉但是下边的命令执行时会提示Options
附近语句有错误,加上#就没事了
# Language:Chinese ->提示说可以中文显示网页
保存并退出 执行系列语句总会报错
#env LANG=C /usr/local/mrtg/bin/mrtg /usr/local/apache2/htdocs/mrtg/mrtg.cfg
ERROR: "WorkDir" not specified in mrtg config file
我卡到这了后边的命令还没打,参照提示补全后边的命令:
#/usr/local/mrtg/bin/indexmaker --output=/usr/local/apache2/htdocs/index.html --title=标题 /usr/local/apache2/htdocs/mrtg/mrtg.cfg ->生成页面文件
#/usr/local/apache2/bin/apachectl restart ->启动apache服务
为了让数据自动刷新,还需要让程序在后台定时运行,
#crontab -e
在其中输入*/5 * * * * env LANG=C /usr/local/mrtg/bin/mrtg /var/www/html/mrtg/mrtg.cfg
该句表示让系统在后台每五分钟执行一次env LANG=C /usr/local/mrtg/bin/mrtg /var/www/html/mrtg/mrtg.cfg 即每5分钟刷新一次
请问按以上步骤配置后能生成类似于
http://www.stat.ee.ethz.ch/mrtg/的监控页面吗???
现在网上搜索linux下的mrtg配置大概就几种!完全照作但没配出!请知道的朋友指正错误所在!
[ 本帖最后由 caichang 于 2006-6-7 09:45 编辑 ] |
|