CentOs5下MRTG安装配置
2008-01-29 – 5:01 pmcentos5的安装以及apache , gd ,zlib,freetype,libpng,libxml等的安装可以参考其他文章
下载mrtg包
#wget -c http://oss.oetiker.ch/mrtg/pub/mrtg-2.15.2.tar.gz
#tar -zxvf mrtg-2.15.2.tar.gz
#cd mrtg-2.15.2
#./configure –prefix=/usr/local/mrtg –with-gd=/usr/local/gd2/ –with-gd-lib=/usr/local/gd2/lib/ –with-gd-inc=/usr/local/gd2/include/ –with-z=/usr/local/zlib/ –with-z-lib=/usr/local/zlib/lib/ –with-z-inc=/usr/local/zlib/include/ –with-png=/usr/local/lib
#make && make install
安装snmp
#yum -y install net-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
保存,重起snmpd
#/usr/local/mrtg/cfgmaker public@localhost > /etc/mrtg/mrtg.cfg
mrtg.cfg配置文件生成后,会默认包含本机所有网卡的监控信息,如不需要可以删除
vi /etc/mrtg.cfg
将
# for UNIX
# WorkDir: /home/http/mrtg
修改为
# for UNIX
WorkDir: /var/www/mrtg
此处为我们的mrtg主目录
加入
Language: gb2312
Language:chinese
指定页面显示语言为中文
制作首页
#/usr/local/mrtg/bin/indexmaker /etc/mrtg/mrtg.cfg –output=/web/data/mrtg/index.html –title="My MRTG"
启动MRTG
#env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
执行三次,没有报错为止
#crontab -e
添加如下一行
*/3 * * * * env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
安装完毕
Tags: centos,mrtg
转载请注明:流年飘飘[http://www.askhua.com]
本文链接: http://www.askhua.com/html/y2008/22.html

