知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
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
例 95.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