作者:love_xiao奇 | 来源:互联网 | 2023-09-12 16:50
1、搭建LAMP环境yum-yinstallhttpdmariadbmariadb-servermariadb-develphpphp-mysqlphp-gdphp-peargd
1、搭建LAMP环境
yum -y install httpd mariadb mariadb-server mariadb-devel php php-mysql php-gd php-pear gd gd-devel
systemctl start httpd && systemctl enable httpd
systemctl start mariadb && systemctl enable mariadb
2、安装绘图工具和SNMP组件
yum -y install rrdtool rrdtool-devel rrdtool-perl rrdtool-php net-snmp-*
systemctl start snmpd && systemctl enable snmpd
3、数据库创建cacti用户及库
mysql -uroot -p
> create database cacti character set utf8 collate utf8_bin;
> grant all on cacti.* to cacti@localhost identified by "1234";
> flush privileges;
为保证cacti用户也可以登录数据库,若出现本地无法登录情况,解决方式如下
有空用户名称占用导致本地无法登录远程可登录
> select user,host from mysql.user;
>drop user ''@localhost;
>drop user ''@localhost.localdomain;
4、下载安装cacti并修改配置
wget https://www.cacti.net/downloads/cacti-0.8.8h.tar.gz
tar -xf cacti-0.8.8h.tar.gz
mv cacti-0.8.8h /var/www/html/cacti
chown -R root.root /var/www/html/cacti
vim /var/www/html/cacti/include/config.php
5、将cacti数据库文件导入数据库
mysql -ucacti -p
use cacti
source /var/www/html/cacti/cacti.sql;
网页初始化配置 http://192.168.11.130/cacti
登陆用户密码都是admin
首次登陆强制要求改密码