系统centos6.4mini版

下载epel的yum源:

    wget http://mirrors.aliyun.com/repo/epel-6.repo

安装必要的包:

httpd:

    yum -y install httpd

mysql

    yum -y install mysql mysql-server

php

    yum -y install php-mysql php-pear php-common php-gd php php-mbstring php-cli

    yum -y install php-snmp

yum -y install net-snmp-utils net-snmp-libs

yum -y install rrdtool


启动服务:

    service httpd start

    service mysqld start

    service snmpd start

    chkconfig httpd on

    chkconfig mysqld on

    chkconfig snmpd on


安装cacti:

    yum -y install cacti


导入cacti表数据

    mysql>grant all privileges on *.* to 'root'@'localhost' identified by 'redhat';

    mysql>flush privileges;

    mysql>create database cacti;

    mysql>grant all privileges on cacti.* to 'cacti'@'localhost' identified by 'redhat';

    mysql>flush privileges;

    rpm -ql cacti|grep cacti.sql

    mysql -ucacti -p cacti < /usr/share/doc/cacti-0.8.8h/cacti.sql


修改配置文件:

/etc/cacti/db.php将cacti数据库信息修改

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cacti";

$database_password = "redhat";

$database_port = "3306";

$database_ssl = false;


修改httpd服务对cacti网页目录的支持

配置/etc/httpd/con.d/cacti.conf

       

                # httpd 2.4

                Require host localhost

       

       

                # httpd 2.2

                Order deny,allow

                Deny from all

                Allow from 192.168.1.0/24----->对本机ip网段进行允许

                Allow from 192.168.46.0/24---->对远端节点网段进行允许

       

修改vim /etc/php.ini的时区

date.timezone = Asia/Shanghai

service httpd restart


修改cacti目录下的属主属组

cd /usr/share/cacti

chown -R cacti:cacti rra/ log/


注释掉:/etc/cron.d/cacti的#,将定时任务开启


输入浏览器http://192.168.1.110/cacti进行安装

cacti工作原理:

数据检索---》poller

数据存储---》RRDTool

数据展示


安装服务参考如下:

http://idroot.net/tutorials/how-to-install-cacti-on-centos-6/

http://www.cacti.net/downloads/docs/pdf/manual.pdf