solaris8安装MRTG全过程

来源:互联网 发布:软件测试的阶段 编辑:程序博客网 时间:2024/04/27 16:40

 solaris8安装MRTG全过程

安装过程按照MRTG官方手册http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html指导进行

安装MRTG前,确保GCC、PERL、GD已安装。检查本机上已安装PERL。

gcc 安装过程

solaris 8,gcc包为gcc-3.4.6-sol8-sparc-local.gz

上传到/tmp下,gunzip gcc-3.4.6-sol8-sparc-local.gz
pkgadd –d gunzip gcc-3.4.6-sol8-sparc-local

手工设置root环境变量,添加PATH 、LD_LIBRARY_PATH

完毕后发现gcc -v报错:ld.so.1: gcc: fatal: libintl.so.3: open failed: No such file or directory

上网搜索后发现是类库libintl未安装。从www.sunfreeware.com下载libintl-3.4.0-sol8-sparc-local.gz

安装后,运行再报错:ld.so.1: gcc: fatal: libiconv.so.2: open failed: No such file or directory

从http://www.sunfreeware.com/programlistsparc8.html下载libiconv-1.11-sol8-sparc-local.gz

安装后gcc终于不再报错。

安装libpng、zlib、gd,全部从www.sunfreeware.com下载,采用pkgadd方式安装

安装mrtgmrtg-2.15.2.tar.gz:

 cd /usr/local/src
 gunzip -c mrtg-2.15.2.tar.gz | tar xvf -
 cd mrtg-2.15.2
 ./configure --prefix=/usr/local/mrtg-2
 
 被告知未安装GD,根据出错提示中第三点:
    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.

删除/usr/local/lib 中libgd.so.2.0.0, libgd.so and libgd.so.2这三个文件后,configure成功

执行make
执行make install

安装完成,开始配置

cfgmaker --global 'WorkDir: /usr/local/apache2/htdocs/mrtg'   --global 'Options[_]: bits,growright'  --output mrtg.cfg  public@localhost
上述命令:对localhost进行监控,public为snmp共同体,输出mrtg.cfg文件

indexmaker mrtg.cfg --output=/usr/local/apache2/htdocs/mrtg/index.html  --title="My MRTG"
生成mrtg的index.html

/usr/local/mrtg-2/bin/mrtg mrtg.cfg
每次执行都生成最新结果,保存在/usr/local/apache2/htdocs/mrtg/

原创粉丝点击