Cacti是一套基于PHP,MySQL,SNMP及RRDTool開發(fā)的網(wǎng)絡(luò)流量監(jiān)測圖形分析工具。
【安裝方法】
一、安裝rrdtool
CentOS-5:
rpm -ivh http://apt.sw. be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
yum install rrdtool -y
CentOS-6:
rpm -ivh http://apt.sw. be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
yum install rrdtool -y
二、安裝配置net-snmp
1、安裝net-snmp
yum install net-snmp net-snmp-libs net-snmp-utils
2、配置net-snmp
修改:
view systemview included .1.3.6.1.2.1.1
為:
view systemview included .1.3.6.1.2.1
3、測試net-snmp
# service snmpd start
# snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux cronos 2.4.28 #2 SMP ven jan 14 14:12:01 CET 2005 i686
三、安裝LAMP
yum install httpd php php-mysql php-snmp php-xml php-gd mysql mysql-server
service httpd start
service mysqld start
mysqladmin -uroot password yourpassword
mysqladmin --user=root --password reload
四、安裝cacti
1、下載cacti
cd /tmp
wget http://www.cacti. net/downloads/cacti-0.8.8a.tar.gz
tar xzf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a /var/www/html/cacti
cd /var/www/html/cacti
2、創(chuàng)建數(shù)據(jù)庫
mysqladmin --user=root -p create cacti
3、導(dǎo)入數(shù)據(jù)庫
mysql -uroot -p cacti < cacti.sql
4、創(chuàng)建數(shù)據(jù)庫用戶
shell> mysql -uroot -p mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword';
mysql> flush privileges;
5、配置include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipassword";
/* load up old style plugins here */
$plugins = array();
//$plugins[] = 'thold';
/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
$url_path = "/cacti/";
/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";
6、設(shè)置目錄權(quán)限
chown -R cactiuser rra/ log/
cactiuser為系統(tǒng)存在的用戶,為了收集數(shù)據(jù)。
7、配置計劃任務(wù)
echo "*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1">>/etc/crontab
service crond restart
8、完成cacti的安裝
1) 在瀏覽器中輸入:http://www.yourdomain. com/cacti/
默認(rèn)用戶名:admin 密碼:admin
2) 更改密碼
3)設(shè)置cacti用到的命令路徑
- PC官方版
- 安卓官方手機版
- IOS官方手機版