jane27 发表于 2019-1-10 08:57:56

cacti 搭建过程

  1、安装LAMP
#yum install httpd mysql-server php php-mysql mysql-devel  

  2、安装rrdtool
# yum install cairo-devel libxml2-devel pango-devel rrdtool rrdtool-devel gd-devel gd  

  3、安装net-snmp
#yum install net-snmp net-snmp-devel net-snmp-utils php-snmp php-mbstring  

  加开机启动
#chkconfig snmpd on
#chkconfig mysqld on
#chkconfig httpd on  

  4.安装cacti
#wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
#tar zxvf cacti-0.8.8b.tar.gz
#mv cacti-0.8.8b/* /var/www/html/cacti
#chown -R apache:apache /var/www/html/  5、启动数据库
#mysqld_safe &  

  修改mysql密码
#mysqladmin -u root password '*****'#mysql -u root -p
#mysql>create database cacti;  

  建立用户cacti,密码cacti123
#mysql>insert into mysql.user(host,user,password) values ('localhost','cacti',password('cacti123'));  重载mysql授权表
#mysql> flush privileges;  把数据库cacti授权于用户cacti
#mysql>grant all on cacti.* to cacti@'localhost' identified by 'cacti123';  

  将cacti数据库导入mysql
#cd /var/www/html
#mysql -ucacti -pcacti123 cacti < cacti.sql  

  修改连接数据库参数
#vim include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti123";
$database_port = "3306";
$database_ssl = false;  

  浏览器打开
  http://ip地址/install/
  

  修改权限
#chmod -R 7744 /var/www/html/cacti/rra  

  加自动刷新
# crontab -e
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php  

  httpd使用apache身份运行,需修改/var/www/html/cacti/rra目录权限
  或

# crontab -e -u apache
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php#vim /etc/snmp/snmpd.conf
accessnotConfigGroup ""      any       noauth    exactallnone none
##         incl/excl subtree   mask
view all    included.1       80  取消#
  

  安装spine
#wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz
#./configure --prefix=/usr/local/spine
#make && make install
#vim /usr/local/spine/etc/spine.conf
DB_Host         localhost
DB_Database   cacti
DB_User         cacti
DB_Pass         cacti123
DB_Port         3306
DB_PreG         0#vim /etc/php.ini
date.timezone = Asia/Chongqing  

  安装插件:
  http://docs.cacti.net/media/plugin:monitor-v1.3-1.tgz
  http://docs.cacti.net/media/plugin:thold-v0.5.0.tgz
  http://docs.cacti.net/media/plugin:settings-v0.71-1.tgz
  

  下载解压到/var/www/html/cacti/plugins目录下
  登陆cacti->console->Plugin Management 安装
  

  插件汇总
  http://54im.com/monitor/cacti-scripts-down.html
  

  

  

  

  

  




页: [1]
查看完整版本: cacti 搭建过程