一、搭建magios监控所需安装的所有软件包
1.GD库相关
zlib-1.2.3.tar.gz、jpegsrc.v6b.tar.gz、libpng-1.2.8-config.tar.gz、freetype-2.1.10.tar.gz、curl-7.15.0.tar.gz、gd-2.0.33.tar.gz
2.Apache相关
httpd-2.2.8.tar.gz
3.mysql相关
ncurses-5.6.tar.gz
4.将nagios监控信息存入mysql里的插件
ndoutils-1.4b7.tar.gz
5.nagios相关
nagios-3.0.5.tar.gz、nagios-plugins-1.4.11.tar.gz
nrpe-2.12.tar.gz(需在监控端和被监控端linux服务器上安装)
NSClient++-Win32-0.3.5.msi(需在被监控端windows服务器上安装)
6.PHP5相关
libxml2-2.6.31.tar.gz、php-5.2.5.tar.gz、ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz
7.飞信机器人
fetion20091117-linux.tar.gz、fetion文件
二、安装GD库
安装GD库(让PHP支持GIF,PNG,JPEG)
A-安装zlib
# cd /tmp/
#tar -zxvf zlib-1.2.3.tar.gz
#cd zlib.1.2.3
# ./configure
# make;make install
(注:安装zlib时,不要用--prefix自定义安装目录,否则可能会影响后面安装,可能出现的错误:configure: error: zlib not installed)
B.安装 jpeg6
建立目录:(安装jpeg6之前一定要先创建以下目录,否则无法成功安装)
# mkdir -p /usr/local/jpeg6
# mkdir -p /usr/local/jpeg6/bin
# mkdir -p /usr/local/jpeg6/lib
# mkdir -p /usr/local/jpeg6/include
# mkdir -p /usr/local/jpeg6/man
# mkdir -p /usr/local/jpeg6/man1
# mkdir -p /usr/local/jpeg6/man/man1
# cd /home/tmp/
# tar -zvxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make
# make install
(注:新建目录man1时,因字体问题,看不清是1还是l,以至于安装错误提示找不到目录,一时半会儿还真找不到问题所在呢。——正确目录名应是man1(是数字而非L))
C.安装libpng
# cd /home/tmp/
# tar -zvxf libpng-1.2.8-config.tar.gz
# cd libpng-1.2.8-config
# mkdir -p /usr/local/libpng
# ./configure --prefix=/usr/local/libpng
# make
# make install
(注:安装libpng时,必须先安装zlib,否则编译不成功)
D.安装 freetype
# cd /home/xiutuo/software/
# tar -zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make
# make install
(编译过程中出现过错误,原因不明,但执行make clean后,重新make,成功)
E、安装Curl库
# cd /home/tmp/
# tar -zxvf curl-7.15.0.tar.gz
# mkdir -p /usr/local/curl
# cd /curl-7.15.0
# ./configure --prefix=/usr/local/curl
# make; make install
F、安装gd2
# cd /home/tmp/
# tar -zvxf gd-2.0.33.tar.gz
# mkdir -p /usr/local/gd2
# cd gd-2.0.33
#./configure --prefix=/usr/local/libgd --with-jpeg=/usr/local/jpeg6/ --with-png=/usr/local/lib/ --with-zlib=/usr/local/lib/ --with-freetype=/usr/local/freetype/
#cp /usr/local/libpng/include/pngconf.h /home/tmp/gd-2.0.34
#cp /usr/local/libpng/include/png.h /home/tmp/gd-2.0.34
注:一定要指定jpeg、png、zlib、freetupe的安装目录,否则编辑时会报错
(多次试验,make时都会出现
make[2]: *** [gd_png.lo] Error 1
make[2]: Leaving directory `/tmp/gd-2.0.26gif'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/gd-2.0.26gif'
make: *** [all] Error 2
需要复制/usr/local/libpng/include/目录下两个文件,再进行编译,可成功)
# make
# make install