1 cacti运行环境准备
cacti需要php+apache+mysql+snmp+RRDTool,以及cacti本身。cacti本体是用php开发的网站,通过snmp对远端设备信息进行采集。apache+mysql+php在以前已经做过了,链接如下:
http://www.cnblogs.com/cation/p/8882910.html
这里只对剩余的部分进行安装。
2 安装snmp
yum install -y net-snmp*
vi /etc/snmp/snmpd.conf
com2sec notConfigUser default public //将default修改为127.0.0.1
access notConfigGroup"" any noauth exact systemview none none //将systemview改为all
#view all included .1 //去掉#注释
systemctl start snmpd
systemctl enable snmpd
3 安装RRDTool
yum install libart_lgpl libart_lgpl-devel
yum install rrdtool.x86_64 rrdtool-devel.x86_64
4 安装相关lib
yum install gcc glibcglibc-common cairo pango zlib zlib-devel freetype freetype-devel gd gd-devel
5 mysql配置
mysql -uroot -p //登录mysql
create database cacti CHARSET‘utf8‘; //创建cacti用的库
GRANT ALL ON cacti.* TO cactiuser@‘127.0.0.1‘ IDENTIFIED BY‘cactipass‘; //创建cactiuser并赋权
6 下载并安装cacti
在cacti官网下载cacti-0.8.8f.tar.gz
复制到apache的www目录并解压该包
cd /var/www/html/
tar xvf cacti-0.8.8f.tar.gz
mv cacti-0.8.8f cacti //目录重命名
cd /var/www/html/cacti
mysql cacti
useradd cactiuser //创建cacti user
chown -R cactiuser:cactiuser /var/www/html/log /var/www/html/rra //修改目录的访问权限
vim /etc/php.ini
date.timezone =Asia/Shanghai //修改php时区
systemctl restart httpd //重启apache
7 浏览器中输入
http://ip/cacti 开始cacti的安装配置
按提示进行配置或包安装
参考
https://www.linuxidc.com/Linux/2017-10/147672.htm
https://www.linuxidc.com/Linux/2013-11/92797.htm
https://blog.csdn.net/lmss82/article/details/4011888
https://blog.csdn.net/m0_37313242/article/details/76607762
https://www.cnblogs.com/biboxie/p/4233256.html
原文:https://www.cnblogs.com/cation/p/8902022.html