标签:nbsp usr idt chmod 数据库 def mct efault 密码
1.搭建好LAMP环境
2.登录数据库创建cacti
create database cacti default character set utf8;
创建cacti的账户密码
grant all privileges on cacti.* to cacti@localhost identified by ‘cacti‘;
3.下载cacti的文件包(安装wget yum install wget -y)
wget http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz
tar zxvf cacti-0.8.8f.tar.gz
mv cacti-0.8.8f /var/www/html/cacti
4.把cacti.sql导入数据库(注意上面解压cacti后,移动的目录位置)
mysql -ucacti -pcacti cacti < /var/www/html/cacti/cacti.sql
5.进入此目录 /var/www/html/cacti/include 下编辑修改config.php和global.php
6.安装rrdtool以生成图像
yum -y install rrdtool rrdtool-devel rrdtool-php rrdtool-perl
---rrdtool绘制图像需要的图形库
yum -y install gd gd-devel php-gd
7.安装snmp服务
yum -y install net-snmp net-snmp-utils php-snmp net-snmp-libs
编辑snmp 配置文件
vi /etc/snmp/snmpd.conf
41 com2sec notConfigUser 127.0.0.1 public
62 access notConfigGroup "" any noauth exact all none none
85 view all included .1 80
8.启动snmp
systemctl enable snmpd.service
systemctl start snmpd.service
9.授权目录权限
useradd -r -M cacti (passwd cacti 设置密码)
chown -R cacti /var/www/html/cacti/rra/
chown -R cacti /var/www/html/cacti/log/
10.修改时区
vi /etc/php.ini
date.timezone =PRC 修改时区
11.配置一个抓图的计划任务
crontab -e
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php >> /tmp/cacti_rrdtool.log
chmod 777 /var/www/html/cacti/poller.php
chmod 777 /var/www/html/cacti/rra
11.浏览器输入IP/cacti
标签:nbsp usr idt chmod 数据库 def mct efault 密码
原文地址:https://www.cnblogs.com/wzhc/p/11406295.html