基于LNMP
安装依赖包
yum -y install net-snmp net-snmp-devel net-snmp-libs net-snmp-perl net-snmp-utils rrdtool rrdtool-devel perl-rrdtool
下载cacti-spine
https://www.cacti.net/downloads/spine/cacti-spine-0.8.8h.tar.gz
tar zxvf cacti-spine-0.8.8h.tar.gz
cd cacti-spine-0.8.8h
./configure
make && make install
下载cacti
https://www.cacti.net/downloads/cacti-0.8.8h.tar.gz
tar xvf cacti-0.8.8h.tar.gz
解压拷贝到web目录
mv -f cacti-0.8.8h/* /data/www/cacti/ //(cacti的web放在二级目录下,)
cd /data/www/
chown -R www:www /data/www/cacti/
mysql> create database cactidb character set utf8; //创建库cactidb
mysql> grant all privileges on cactidb.* to ‘cactiuser‘@‘localhost‘ identified by ‘cactipasswd‘; //用户名:cactiuser 密码:cactipasswd
mysql> flush privileges;
mysql> use cactidb
mysql> source /data/www/cacti/cacti.sql //导入cacti数据库文件
mysql> quit
vi /data/www/cacti/include/config.php //配置数据库连接
$database_type = "mysql";
$database_default = "cactidb"; //数据库名称
$database_hostname = "localhost"; //主机名称,默认即可
$database_username = "cactiuser"; //数据库用户名
$database_password = "cactipasswd"; //数据库密码
$database_port = "3306"; //MySQL数据库默认连接端口
$database_ssl = false;
http://192.168.1.100/install/
User Name: admin
Password: admin