步骤一:安装cacti依赖包
[root@localhost ~]#yum install -y wget epel-release php gcc gcc-c++ net-tools perl rrdtool net-snmp-utils net-snmp-devel perl-JSON
步骤二:查看CentOS下是否已安装mysql
yum list installed | grep mysql
步骤三:删除已安装mysql
yum -y remove mysql
步骤四:从yum库中的安装mysql
yum -y install mysql mysql-server mysql-devel php-mysql
步骤五:验证是否安装成功
rpm -qi mysql-server
步骤六:创建cacti数据库和账号
service mysqld start
mysql -u root
use mysql;
set password=password('密码');
create database cacti;
grant all on cacti.* to cacti@'localhost' identified by '密码';
enit;
步骤七:安装cacti
cd /var/www/html
wget https://www.cacti.net/downloads/cacti-0.8.8f.tar.gz
tar xvf cacti-0.8.8f.tar.gz
mv cacti-0.8.8f cacti
cd cacti
mysql -uroot -p cacti < cacti.sql
vi include/config.php 修改$database_username和$database_password 为之前新建的cacti数据库账号和密码
service httpd start
步骤八:关闭selinux和配置防火墙
setenforce 0
vi /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
步骤九:配置cacti采集时间