一、安装基础软件包
要安装MRTG软件包必须首先安装gcc, perl, gd, libpng, zlib, freetype等软件包
测试服务器就少装三个。都放在ftp压缩包里了。服务器上可以用命令:rpm -qa | grep jpeg监测下装了没。装过就不用装了
先装jgcc, perl, gd, libpng, zlib, freetype等再装gd-2.0.33.tar.gz这个。
1.安装zlib
tar zxvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
./configure
make
make install
2.安装libpng
tar zxvf libpng-1.2.7.tar.tar
cd libpng-1.2.7
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个
3.安装freetype
tar zxvf freetype-2.1.9.tar.gz
cd freetype-2.1.9
./configure
make
make install
4.安装Jpeg
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库
5.安装GD
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --with-png --with-freetype --with-jpeg
make install
二、安装配置net-snmp
执行命令 yum install net-snmp net-snmp-libs
安装成功后配置:
配置/etc/snmp/snmpd.conf文件,使其能配合MRTG工作。
把下面的#号去掉
#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服务:
#/etc/rc.d/init.d/snmpd start
(最好把它的启动加到开机自动启动。省的以后服务器重启了。在手动启动)
三、安装配置MRTG
#mkdir /var/www/html/mrtg
(权限最好不让ftp用户有删除修改权限)
# tar zvxf mrtg-2.9.28.tar.gz
# cd mrtg-2.9.28
#cp images/ /var/www/html/mrtg
#./configure --prefix=/usr/local/mrtg --with-gd=/usr/include --with-gd-lib=/usr/lib --with-gd-inc=/usr/include --with-png=/usr/include --with-zlib=/usr/include
# make &&make install
② 生成配置文件
# mkdir /usr/local/mrtg/cfg
#cd /usr/local/mrtg/bin
#./cfgmaker --global 'WorkDir: /var/www/html/mrtg' --global 'Options[_]: bits,growright' --global 'Language: en_US.UTF8' --output /usr/local/mrtg/cfg/mrtgconf.cfg public@116.255.145.130
③ 设置MRTG定期执行方式
执行“crontab-e”,加入如下行:
*/5 * * * * /bin/env LANG=en_US /usr/local/mrtg/bin/mrtg /usr/local/mrtg/cfg/mrtgconf.cfg
④ 建立索引页面
执行以下命令还可以生成一个索引页面:
#cd /usr/local/mrtg/bin
#./indexmaker --output="/var/www/html/mrtg/index.html" --title="图片服务器带宽监控" /usr/local/mrtg/cfg/mrtgconf.cfg
到此为止,配置完毕,重新启动snmp和httpd服务,访问http://ip地址/mrtg/index.html,就能看到网络流量图了。
#./indexmaker --output="/var/www/html/mrtg/cpu/index.html" --title="图片服务器cpu监控" /usr/local/mrtg/cfg/cpu.cfg
效果图:
分享到:
相关推荐
Centos7.9安装配置vsftpd
centos安装配置hadoop超详细过程.docx
centos安装配置confluence.docx
centos 安装配置centos 安装配置centos 安装配置centos 安装配置centos 安装配置centos 安装配置centos 安装配置centos 安装配置centos 安装配置centos 安装配置
centos7安装配置mysql5.7教程全
CentOS安装配置分布式文件系统-FastDFS5.11,本文详细介绍了CentOS安装配置分布式文件系统-FastDFS5.11的安装以及配置过程,非常全
Centos5.5下Qt的安装配置
CentOS Apache配置详解CentOS Apache配置详解
centos安装Nginx配置 视频讲解: https://www.bilibili.com/video/BV1Zp4y1X71T?vd_source=7ba09b63e46a5f7eccd25c865fcd09b8#reply117266227680
centos6.3下如何安装和配置nagios。
centos安装配置hadoop Hadoop是Apache软件基金会旗下的一个开源分布式计算平台。以Hadoop分布式文件系统(HDFS,Hadoop Distributed Filesystem)和MapReduce(Google MapReduce的开源实现)为核心的Hadoop为用户...
centOS完全配置手册 centOS完全配置手册 centOS完全配置手册 centOS完全配置手册 centOS完全配置手册
记录的关于在centos上安装memcached的文档,给有需要的朋友
CentOS上配置LVS DR集群.docx CentOS上配置LVS DR集群.docx
Centos 6安装配置图解 Centos 6安装配置手册 Centos 6安装配置图解Centos 6安装配置图解Centos 6安装配置图解Centos 6安装配置图解Centos 6安装配置图解Centos 6安装配置图解Centos 6安装配置图解
CentOS7配置本地yum源(超详细过程)
centos安装和配置Cobbler
Centos 下 netflow安装配置--安装nfsen
在centos7中安装配置Samba服务器,主要介绍Samba服务涉及的配置文件以及安装过程,以及防火墙、senlinux的设置
CentOS安装MySQL5.7,带部分截图