mrtg,cacti,rrdtool,nagios, zabbix安装比较
安装net-snmp
下载net-snmp-5.3.0.1-1.EL4.i386.rpm
安装mrtg
下载
mrtg-2.12.2.tar.gz
./configure --prefix=/usr/local/mrtg & make & make install cp /usr/local/mrtg/bin/* /usr/bin
- 1.
- 2.
安装rrdtool:
(以下部分可以直接copy到linux shell下 自动安装,我是分段copy,整体copy未尝试)
BUILD_DIR=/tmp/rrdbuild
INSTALL_DIR=/usr/local/rrdtool
mkdir -p $BUILD_DIR
mkdir $BUILD_DIR/lb
cd $BUILD_DIR
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
#####zlib
wget
tar zxvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR zlib*
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
#####libpng
wget
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" \
CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR libpng*
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
#########freetype
wget
tar zxvf freetype-2.1.9.tar.gz
cd freetype-2.1.9
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR freetype*
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
####### libart_lgpl
wget
tar zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR libart*
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
########cgilib
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make CC=gcc CFLAGS="-O3 -fPIC -I."
mkdir -p $BUILD_DIR/lb/include
cp *.h $BUILD_DIR/lb/include
mkdir -p $BUILD_DIR/lb/lib
cp libcgi* $BUILD_DIR/lb/lib
cd ..
rm -fR cgilib*
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
#########install rrdtool
ranlib $BUILD_DIR/lb/lib/*.a # 优化
IR=-I$BUILD_DIR/lb/include
CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
LDFLAGS="-L$BUILD_DIR/lb/lib"
CFLAGS=-O3
export CPPFLAGS LDFLAGS CFLAGS
cd $BUILD_DIR/
tar zxvf rrdtool-1.2.12.tar.gz
cd rrdtool-1.2.12
./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
make
make install
cd ..
rm -fR rrdtool*
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
***********************RRDTOOL INSTALL SUCCESSFULLY**********************
#p#
安装CACTI
cacti-0.8.6h.tar.gz
tar zxvf cacti-0.8.6h.tar.gz
cp –R cacti-0.8.6h /usr/local/cacti/
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
配置Mysql:
group-add cacti
useradd -g cacti cactiuser
/usr/local/mysql/bin/mysql – --user=root – --password=yanhannet
mysql> create database cactidb;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('yanhannet');
mysql> exit
# mysql --user=root --password=yanhannet cactidb
# chown -R cactiuser rra/ log/
# chmod –R 777 rra/ log/
# vi cacti/include/config.php
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "yanhannet";
$database_port = "3306";
vi /etc/ctrontab (crontab -u cactiuser –e)
*/5 * * * * cactiuser php /usr/local/cacti/poller.php > /dev/null 2>&1
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
配置apache
vi /usr/local/apache/conf/conf.d/cacti.conf
Alias /cacti /usr/local/cacti
Options None
AllowOverride None
Order allow,deny
Allow from all
# AuthName "XXXXX"
# AuthType Basic
# AuthUserFile /XXX/htpasswd.users
# Require valid-user
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
******************CACTI INSTALL SUCCESSFULLY ***********************
#p#
安装nagios
useradd nagios
mkdir /usr/local/nagios
chown nagios.nagios /usr/local/nagios/
./configure --prefix=/usr/local/nagios --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
注:gd库位置,如果不加,这会出现The statusmap, trends and histogram CGIs are missing or dont work!
查看3-D status map 需要在本机下载插件contvrml
在apache配置文档目录下
vi nagios.conf
scriptalias /nagios/cgi-bin /usr/local/nagios/sbin
allowoverride authconfig
options execcgi
order allow,deny
allow from all
alias /nagios /usr/local/nagios/share
options none
allowoverride authconfig
order allow,deny
allow from all
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
在nagios sbin/ share/目录下
vi .htaccess
authname "nagios access"
authtype basic
authuserfile /usr/local/nagios/etc/.nagios.users
require valid-user
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
生成用户文件
htpasswd -c /usr/local/nagios/etc/.nagios.users nagiosadmin
- 1.
- 2.
具体参数配置参考官方文档
工具插件下载
fruity 要求php5以上
下载.
直接解压复制到fruity 下 分别改名为HTML 和adodb 其他不做修改
修改 fruity/includes下的config.ifg,需要更改的地方有,路径,mysql信息
mysql 添加fruity 数据库和user,password.
*************************NAGIOS INSTALL SUCCESSFULLY*****************
#p#
安装zabbix:
tar zxvf zabbix-1.1beta6.tar.gz
mysql -u -p
> creat database zabbix;
>quit;
cd creat/mysql
mysql -u -p zabbix
cd ../data
mysql -u -p zabbix
cd ..
./configure --prefix=/usr/local/zabbix --with-mysql=/usr/local/mysql --enable-server --enable-agent
make
make install
cp misc/conf/* /etc/zabbix/conf/
cp frontends/php/* /usr/local/zabbix/php
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
修改apache添加zabbix.conf
以上就是MRTG、Cacti、Rrdtool、Nagios、Zabbix的安装比较
【编辑推荐】