cacti也安裝部署了不少次,而每次部署完以後,卻都沒有作一個總結,當再次部署之時,又有些遺忘,還得查找一些有用的資料,此次部署了一次,順便也寫個總結文檔,方便之後再次須要!!!!本次部署按照最簡潔要求部署。php
Cacti版本:cacti-
1、安裝cacti所須要的環境(mysql、mysql-server、httpd、php、php-snmp、php-mysql、net-snmp)-此部署環境並沒有默認安裝mysql,php,httpd等mysql
- yum install mysql ##同時會下載安裝perl-DBI
- yum install mysql-server ##同時會下載安裝perl-DBD-MySQL
- yum install httpd
- yum install php ##會同時下載安裝php-cli ,php-common
- yum install php-mysql ##會同時下載安裝php-pdo
2、 安裝cacti所須要的大量的庫web
- zlib: yum install zib
- libpng: yum install libpng
- freetype: yum install freetype
- jpeg: yum install libjpeg
- fontconfig: yum install fontconfig
- gd: yum install gd
- libxml: yum install libxml2
- #wget http://www.express.org/~wrl/rrdtool/rrdtool-1.2.30-1.el5.wrl.i386.rpm
- #wget http://www.express.org/~wrl/rrdtool/rrdtool-perl-1.2.30-1.el5.wrl.i386.rpm
- #rpm -ivh rrdtool-1.2.30-1.el5.wrl.i386.rpm rrdtool-perl-1.2.30-1.el5.wrl.i386.rpm
添加一個cacti用戶,並將cacti的安裝目錄所屬用戶改成cacti用戶
- #wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
- #tar -xvzf cacti-0.8.7g.tar.gz -C /usr/local/cacti
- #cd /usr/local/cacti
- #vim include/config.php
- $database_type = "mysql";
- $database_default = "cacti";
- $database_hostname = "localhost";
- $database_username = "cacti";
- $database_password = "cacti";
- $database_port = "3306";
- $config['url_path'] = '/cacti/';
配置cacti數據庫
- #useradd cacti -d /usr/local/cacti
- #chown –R cacti /usr/local/cacti
- #chgrp –R cacti /usr/local/cacti
- #chmod –R 755 /usr/local/cacti
- #chkconfig mysqld on ##設置爲開機啓動
- #/etc/init.d/mysqld start
- #/usr/bin/mysqladmin -uroot -p password "jiuzhou"
- #/usr/bin/mysql –uroot –p
- mysql> create database cacti;
- mysql> use mysql;
- mysql> grant all privileges on cacti.* to 'cacti'@'localhost' identified by 'cacti';
- mysql> flush privileges;
- mysql> exit
(注意必定要查看是否成功返回mysql信息。)sql
啓動snmp服務#service snmpd start首先監控本機的流量,點擊devices,選擇主機,左上角出現如下信息表示成功,若爲紅色的error,則表示爲能成功。數據庫
至於cacti如何添加設備使用能夠參考地址: http://blog.sina.com.cn/s/blog_4e424e2101000b6o.htmlexpress
完畢,下節將監控路由器信息apache
(題外話,不知道51cto怎麼弄的,如今這個發佈文章的編輯器,排版格式愈來愈很差弄了,也許是我太笨,怎麼弄都弄不到像之前的那種格式了。嗨~~~~~~~)vim