1、安装配置Cacti
(1)安装rrdtool、net-snmp以及相关依赖包(使用CentOS yum 命令安装)
yum install rrdtool net-snmp rrdtool-devel net-snmp-devel net-snmp-utils net-snmp-python net-snmp-perl lm_sensors-devel file-devel rpm-devel file intltool libart_lgpl libart_lgpl-devel elfutils pango-devel* cairo-devel* mysql-devel Mod_auth_mysql php-mysql cairo dejavu-fonts-common.noarch dejavu-lgc-sans-mono-fonts.noarch dejavu-sans-mono-fonts.noarch fontpackages-filesystem.noarch libXft libXrender libthai pango pixman perl-rrdtool net-snmp net-snmp-utils tcp_wrappers-devel
chkconfig snmpd on #设置snmpd开机启动
service snmpd start #启动snmpd服务
(2)下载安装Cacti
Cacti下载地址:http://www.cacti.net/downloads/cacti-0.8.7i.tar.gz
cd /usr/local/src
tar zxvf cacti-0.8.7i.tar.gz
cd cacti-0.8.7i
cp -r * /usr/local/nginx/html
chown www.www /usr/local/nginx/html/ -R #设置目录所有者
chmod 700 /usr/local/nginx/html/ -R #设置目录权限
(3)、配置Cacti数据库
mysql -u root -p #输入密码进入MySQL控制台
create database cactidb; #创建数据库cactidb
insert into mysql.user(Host,User,Password) values('localhost','cactiuser',password('passwrod')); #创建数据库用户cactiuser 密码 password
grant all on cactidb.* to 'cactiuser'@'%' identified by 'passwrod' with grant option; #授权用户cactiuser对数据库cactidb完全访问
flush privileges; #刷新系统授权表,使设置生效
use cactidb
source /usr/local/nginx/html/cacti.sql #导入cacti数据库文件
exit; #退出MySQL控制台
vi /usr/local/nginx/html/include/config.php #配置数据库连接
$database_type = "mysql";
$database_default = "cactidb"; #数据库名称
$database_hostname = "localhost"; #主机名称,默认即可
$database_username = "cactiuser"; #数据库用户名
$database_password = "password"; #数据库密码
$database_port = "3306"; #MySQL数据库默认连接端口
$database_ssl = false;
打开http://ip