1、安装LAMP
[[email protected] ~]#yum install httpd mysql-server php php-mysql mysql-devel
2、安装rrdtool
[[email protected] ]# yum install cairo-devel libxml2-devel pango-devel rrdtool rrdtool-devel gd-devel gd
3、安装net-snmp
[[email protected] ]#yum install net-snmp net-snmp-devel net-snmp-utils php-snmp php-mbstring
加开机启动
[[email protected] ]#chkconfig snmpd on [[email protected] ]#chkconfig mysqld on [[email protected] ]#chkconfig httpd on
4.安装cacti
[[email protected] ]#wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz [[email protected] ]#tar zxvf cacti-0.8.8b.tar.gz [[email protected] ]#mv cacti-0.8.8b/* /var/www/html/cacti [[email protected] ]#chown -R apache:apache /var/www/html/
5、启动数据库
[[email protected] ]#mysqld_safe &
修改mysql密码
[[email protected] ]#mysqladmin -u root password ‘*****‘
[[email protected] ]#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 [email protected]‘localhost‘ identified by ‘cacti123‘;
将cacti数据库导入mysql
[[email protected] ]#cd /var/www/html [[email protected] ]#mysql -ucacti -pcacti123 cacti < cacti.sql
修改连接数据库参数
[[email protected] ]#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/
修改权限
[[email protected] ]#chmod -R 7744 /var/www/html/cacti/rra
加自动刷新
[[email protected] ~]# crontab -e */5 * * * * /usr/bin/php /var/www/html/cacti/poller.php
httpd使用apache身份运行,需修改/var/www/html/cacti/rra目录权限
或
[[email protected] ~]# crontab -e -u apache */5 * * * * /usr/bin/php /var/www/html/cacti/poller.php
[[email protected] ]#vim /etc/snmp/snmpd.conf access notConfigGroup "" any noauth exact all none none ## incl/excl subtree mask view all included .1 80
取消#
安装spine
[[email protected] ]#wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz [[email protected] ]#./configure --prefix=/usr/local/spine [[email protected] ]#make && make install [[email protected] ]#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
[[email protected] ]#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
cacti 搭建过程
时间: 2024-11-10 14:45:43