rhel5.5上安装cacti注意事项
基本环境
os:rhel5.5 i386
rpm:lamp
cacti:0.8.8a
rrdtool:1.4.5
注意点如下:
一,安装cacti所需要的环境(mysql、mysql-server、httpd、php、php-mysql)-此部署环境并没有默认安装mysql,php,httpd等
yum install mysql ##同时会下载安装perl-DBI
yum install mysql-server ##同时会下载安装perl-DBD-MySQL
yum install httpd
yum install php ##会同时下载安装php-cli ,php-common
yum install php-mysql ##会同时下载安装php-pdo
二,安装rrdtoll
#yum -y install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
源码包安装rrdtool
#wget http://down1.chinaunix.net/distfiles/rrdtool-1.4.5.tar.gz
您需要设置PKG_CONFIG_PATH,请输入
#export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
#./configure –prefix=/usr/local/rrdtool
#make
#make install
#cd /usr/local/rrdtool/share/rrdtool/examples/
#./stripes.pl
#ls -l
#cp stripes.png /var/www/html/ (这一步骤的前提是你本机是个WWW服务器器)
在浏览器中输入http://IP/stripes.png ,能看到rrd的示例图说明安装成功;
安装snmp的支持工具
#yum install net-snmp
#yum install net-snmp-utils
三,安装cacti所需要的大量的库
zlib: yum install zib
libpng: yum install libpng
freetype: yum install freetype
jpeg: yum install libjpeg
fontconfig: yum install fontconfig
gd: yum install gd
libxml: yum install libxml2
源码包安装cacti
#wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
#tar -zxvf cacti-0.8.8a.tar.gz -C /opt
#mv /opt/cacti-0.8.8a /var/www/html/cacti
#cd /var/www/html/cacti
#vim include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
添加一个cacti用户,并将cacti的安装目录所属用户改为cacti用户
#useradd cacti -d /var/www/html/cacti
#chown -R cacti /var/www/html/cacti
#chgrp -R cacti /var/www/html/cacti
#chmod 755 /var/www/html/cacti
配置cacti数据库
#mysqladmin -uroot password "123456"
#mysql –uroot –p
mysql> create database cacti;
mysql> use mysql;
mysql> grant all privileges on cacti.* to 'cacti'@'localhost' identified by 'cacti';
mysql> flush privileges;
mysql> exit
导入cacti的sql文件
#mysql -uroot -p cacti < /var/www/html/cacti/cacti.sql
#service httpd restart
四,后续操作
http://ip/cacti
1,
2,
3,
出现上面错误
#cd /usr/local/bin
#ln –s /usr/local/rrdtool/bin/rrdtool rrdtool
按F5刷新浏览器即可,后双击Finish完成安装
4,
初始用户名和密码都是admin,第一次登录要更改密码
如下图
5,