介绍一个很好用的流量监控工具 CACTI ,比 MRTG 方便管理流量监控软件 ,此套软件系统资源吃很重 所以若要正式上线建议要有较佳的硬件设
备。官方网站:http://www.cacti.net,我的安装说明是参考官方的手冊:http://www.cacti.net/downloads/docs/html/
Environment :
硬件:i386 PC Intel P3 500
内存网卡:256M RAM + 一片网卡
安裝 CACTI - Installing CACTI :
安装 FreeBSD 需求的环境:
#/usr/ports/databa
#make install
#/usr/ports/net-mgmt/net-snmp4
#make install
#/usr/ports/net/rrdtool
#make install
#/usr/ports/www/apache2
#make install
#/usr/ports/lang/php4
#make install
#/usr/ports/lang/php4-extensions
#makeinstall
开始安装 cacti 套件:
#tar xzvfcacti-version.tar.gz
#mysqladmin--user=root create cacti
#mysql -p cacti< cacti.sql
#mysql -uroot -pxxxxx
mysql> GRANTALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY'somepassword';
Query OK 0rows affected (0.03 sec)
mysql> flushprivileges;
Query OK 0 rows affected (0.02 sec)
mysql>exit
Bye
#vi/usr/local/www/data-dist/cacti/include/config.php
$databa
$databa
$databa
$databa
#pw addusercactiuser
#passwd cactiuser
Changing local password for cactiuser
New Password: xxxx
Retype New Password: xxxx
#cd/usr/local/www/data-dist/cacti
#chown -Rcactiuser rra/ log/
设定http://your-domain/cacti/
初始帐户密码是:admin / admin,登入前系统会要求你更改新的登入 admin 使用者密码。
#crontab-e # 建立crontab去执行cacti
*/5 * * * * /usr/local/bin/php /usr/local/www/data-dist/cacti/poller.php >/dev/null 2>&1
#php poller.php
升级 CACTI - Upgrading CACTI :
#cd/usr/local/www/data-dist
#mysqldump -p -l--add-drop-table cacti >mysql.cacti
#mv cacticacti_old
#tar -xzvfcacti-new-version.tar.gz
#mvcacti-new-version cacti
#viinclude/config.php
$databa
$databa
$databa
$databa
#cpcacti_old/rra/* cacti/rra/
#cpcacti_old/sc
#cpcacti_old/resource/* cacti/resource/
#chown -Rcactiuser rra/ log/
http://your-domain/cacti/
补丁 CACTI - Patches CACTI
#cd/usr/local/www/data-diste/cacti
#fetchhttp://www.cacti.net/downloads/patches/0.8.6c/rrd_fetch_negative_numbers.patch
Receiving rrd_fetch_negative_numbers.patch (601 bytes): 100%
601 bytes transferred in 0.0 seconds (1.76 MBps)
#patch -p1 -N< rrd_fetch_negative_numbers.patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- cacti-0.8.6c/lib/rrd.php 2004-12-29 15:56:08.000000000-0500
|+++ cacti-0.8.6c-new/lib/rrd.php 2004-12-29 15:56:48.000000000 -0500
--------------------------
Patching file lib/rrd.php using Plan A...
Hunk #1 succeeded at 368.
done
以下个补丁做法同上:
#fetchhttp://www.cacti.net/downloads/patches/0.8.6c/no_auth_no_graphs_in_tree_bug.patch
#fetchhttp://www.cacti.net/downloads/patches/0.8.6c/device_create_multiple_graphs.diff
#patch-p1 -N