歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> 關於Unix

cacti居然是這個原因


折騰了十多天,把系統都重裝了,ports調整了幾個時間了,最後找到的問題是,模板要選用ucd/net snmp,我以前用Cisco Router的模板,最近不知道怎麼了,不行了,可能還是因為linux和freebsd的差異導致的。
把我的安裝過程貼一下吧,希望對大家有用。
前提的apache、php、mysql就不多說了,後面的是cacti等的操作。
安裝rrdtool
cd /usr/ports/net/rrdtool
make install clean;
安裝net-snmp
cd /usr/ports/net-mgmt/net-snmp
make install clean;
snmpd_enable="YES"
snmpd_flags="-a /var/run/snmpd.pid"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
mkdir /usr/local/etc/snmp
##############################
syslocation somewhere
sysservices 77
rocommunity jxtm
load 12 12 12
###############################
安裝cacti
cd /usr/ports/net/cacti
make install clean ;
cd /usr/ports/net/cactid
make install clean;
數據庫准備工作
# mysql -u root –p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 130 to server version: 4.1.15-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database cacti;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on cacti.* to root;
Query OK, 0 rows affected (0.01 sec)
mysql> grant all on cacti.* to root@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql> grant all on cacti.* to cacti;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on cacti.* to cacti@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql> set password for cacti@localhost=password('****');
Query OK, 0 rows affected (0.00 sec)
mysql> exit
導入數據庫
cp -R /usr/local/share/cacti /usr/
cd /usr/cacti
chown -R cacti:cacti rra/
chown -R cacti:cacti log/
cd scripts
chown cacti:cacti *
cd..
mysql -u root –p***** cacti < cacti.sql
ee /usr/cacti/include/db-settings.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "*****";
核對以上幾項是否正確
crontab -u cacti –e
為cactiuser用戶加入
*/5 * * * * /usr/local/bin/php /usr/www/cacti/poller.php
Copyright © Linux教程網 All Rights Reserved