DESCRIPTION MRTG comes to you in Source Code. This means that you have to compile parts of it before you can use it on a Unix machine. These instructions help you to do so.
PREPARATION
GCC http://gcc.gnu.org/
Perl http://www.perl.com/
gd http://www.boutell.com/gd/
libpng http://www.libpng.org/pub/png/libpng.html
zlib http://www.gzip.org/zlib
mrtg http://oss.oetiker.ch/mrtg/pub
LIBRARY COMPILATION 查询系统是否安装有这些软件包: rpm -qa|grep gd 如果有没有安装的软件包,可参见相应软件包的安装说明。
Apache的安装 tar xvfz httpd-2.9.17.tar.gz cd httpd-2.9.17 ./configure --prefix=/usr/local/httpd make make install 运行Apache /usr/local/httpd/bin/apachectl start
MRTG COMPILATION tar xvfz mrtg-2.9.17.tar.gz cd mrtg-2.9.17 ./configure --prefix=/usr/local/mrtg2 make make install
Otherwise you may have to give some hints on where to find the various libraries required to compile mrtg: ./configure --prefix=/usr/local/mrtg2 \ --with-gd=/usr/local/src/gd \ --with-z=/usr/local/src/zlib \ --with-png=/usr/local/src/libpng
All the software required by MRTG is now installed under the /usr/local/mrtg2 subdirectory.
CONFIGURATION You can find the script in the bin subdirectory(/usr/local/mrtg2/bin).
./cfgmaker --global 'Options[_]:bits,transparent,nobanner,unknaszero,nolegend' \ --global 'WorkDir:/usr/local/httpd/htdocs/mrtg' \ --output /etc/mrtg/mrtg.cfg \ --global 'language:chinese' \ aaa@abc.com
RUNNING MRTG Once you have created a configuration file, try the following:
/usr/local/mrtg2/bin/mrtg /etc/mrtg/mrtg.cfg
if you live in Linux Land the line may look like this if you are using crontab -e
*/5 * * * * /usr/local/mrtg2/bin/mrtg /etc/mrtg/mrtg.cfg
制作监控中心 /usr/local/mrtg2/bin/indexmaker /etc/mrtg/mrtg.cfg > /usr/local/httpd/htdocs/mrtg/index.htm |