Cacti requires MySQL, PHP, RRDTool, net-snmp, and a webserver that supports PHP such as Apache.
sudo apt-get install rrdtool sudo apt-get install snmp snmpd sudo apt-get install php5-snmp
At first, install snmp for linux
-
wget http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz
-
tar zxvf cacti-0.8.7b.tar.gz
-
mv cacti-0.8.7b /home/netkiller/public_html/cacti
-
mysqladmin --user=root create cacti
-
mysql -uroot -p cacti < cacti.sql
-
echo "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';" | mysql -uroot -p
-
echo "flush privileges;" | mysql -uroot -p
-
vi include/config.php
例 19.1. cacti config.php
$database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "somepassword"; $database_port = "3306";
-
crontab -e
*/5 * * * * php /var/www/neo.6600.org/html/cacti/poller.php > /dev/null 2>&1
or
/etc/crontab
*/5 * * * * nobody php /home/netkiller/public_html/cacti/poller.php > /dev/null 2>&1
-
mkdir -p /var/log/cacti/
configure cacti
http://your-server/cacti/
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。