1.安装apache、mysql、php步骤这里省略...
2.安装net-snmp-utils
yum -y install net-snmp-utils
3.安装rrdtool
yum -y install pango pango-devel cairo cairo-devel
tar zxvf /home/rrdtool-1.4.7.tar.gz -C /usr/src/
cd /usr/src/rrdtool-1.4.7/
./configure --prefix=/usr/local/rrdtool
make
make install
4.安装cacti
tar zxvf /home/cacti-0.8.8.tar.gz -C /usr/local/apache/htdocs/
cd /usr/local/apacher/htdocs/
mv cacti-0.8.8 cacti
useradd cactiuser
chown -R cactiuser:cactiuser cacti/rra/
chown -R cactiuser:cactiuser cacti/log/
mysql -u root -p
mysql>create database cacti default character set utf8;
mysql>grant all on cacti.* to cactiuser@localhost identified by 'hello';
mysql>quit
mysql -u cactiuser -p cacti < cacti/cacti.sql
vi cacti/include/config.php
vi /usr/local/apache/conf/httpd.conf
DocumentRoot "/usr/local/apache//htdocs/cacti"
<Directory "/usr/local/apache//htdocs/cacti">
Options None
Order allow,deny
Allow from all
</Directory>
/usr/local/apacher/bin/apachectl restart
5.访问cacti
修改rrdtool路径为/usr/local/rrdtool/bin/rrdtool,若php也是源码安装的还需修改php的路径
在"设置"-"常规"中修改"rrdtool应用程序版本"为"RRDtool 1.4.x"
6.执行初始化
/usr/local/php/bin/php /usr/local/apacher/htdocs/cacti/poller.php
添加crond计划任务:
*/5 * * * * /usr/local/php/bin/php /usr/local/apacher/htdocs/cacti/poller.php &> /dev/null
7.插件安装
将settins、thold等插件解压到cacti/plugins下,然后登录cacti后找到plugin Management将插件安装、激活即可。