首页 > 代码库 > cacti 搭建过程
cacti 搭建过程
1、安装LAMP
[root@cacti ~]#yum install httpd mysql-server php php-mysql mysql-devel
2、安装rrdtool
[root@cacti ]# yum install cairo-devel libxml2-devel pango-devel rrdtool rrdtool-devel gd-devel gd
3、安装net-snmp
[root@cacti ]#yum install net-snmp net-snmp-devel net-snmp-utils php-snmp php-mbstring
加开机启动
[root@cacti ]#chkconfig snmpd on [root@cacti ]#chkconfig mysqld on [root@cacti ]#chkconfig httpd on
4.安装cacti
[root@cacti ]#wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz [root@cacti ]#tar zxvf cacti-0.8.8b.tar.gz [root@cacti ]#mv cacti-0.8.8b/* /var/www/html/cacti [root@cacti ]#chown -R apache:apache /var/www/html/
5、启动数据库
[root@cacti ]#mysqld_safe &
修改mysql密码
[root@cacti ]#mysqladmin -u root password ‘*****‘
[root@cacti ]#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
[root@cacti ]#cd /var/www/html [root@cacti ]#mysql -ucacti -pcacti123 cacti < cacti.sql
修改连接数据库参数
[root@cacti ]#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/
修改权限
[root@cacti ]#chmod -R 7744 /var/www/html/cacti/rra
加自动刷新
[root@cacti ~]# crontab -e */5 * * * * /usr/bin/php /var/www/html/cacti/poller.php
httpd使用apache身份运行,需修改/var/www/html/cacti/rra目录权限
或
[root@cacti ~]# crontab -e -u apache */5 * * * * /usr/bin/php /var/www/html/cacti/poller.php
[root@cacti ]#vim /etc/snmp/snmpd.conf access notConfigGroup "" any noauth exact all none none ## incl/excl subtree mask view all included .1 80
取消#
安装spine
[root@cacti ]#wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz [root@cacti ]#./configure --prefix=/usr/local/spine [root@cacti ]#make && make install [root@cacti ]#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
[root@cacti ]#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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。