cacti dependence php mysql cacti configure know errors
cacti dependence php
#/etc/php.inisafe_mode = Offdate.timezone = "Asia/Shanghai"
mysql
[mysqld]basedir = /opt/mysql_cacti/datadir = /opt/mysql_cacti/databind-address= 0.0.0.0port = 3333user=mysql# server_id = .....socket = /opt/mysql_cacti/mysql.sockmax_heap_table_size=1567Mmax_allowed_packet=16777216join_buffer_size=64Mtmp_table_size=64Minnodb_buffer_pool_size=7835Minnodb_doublewrite=0innodb_additional_mem_pool_size=80Minnodb_flush_log_at_timeout=3innodb_read_io_threads=32innodb_write_io_threads=16
shell> yum install net-snmp net-snmp-libs net-snmp-utils rrdtool perl-devel perl-CPAN perl-YAML#安裝依賴shell> wget http://www.cacti.net/downloads/cacti-1.1.3.tar.gzshell> tar xzf cacti-1.1.3.tar.gz -C /www/shell> ln -s /www/cacti-1.1.3/ /www/cactishell> cd /www/cacti/shell> mysql -root -pmysql> create database cacti;Query OK, 1 row affected (0.00 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || cacti || mysql || performance_schema |+--------------------+4 rows in set (0.00 sec)#建立資料庫mysql> source cacti.sql#匯入資料mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';mysql> flush privileges;mysql> exit#建立cacti帳號,賦予許可權shell> chown -R cactiuser rra/ log/#/etc/crontab*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1#將每5分鐘執行一次的資料擷取指令碼加入crontab
cacti configure
Edit “include/config.php” and specify the database type, name, host,user and password for your Cacti configuration.
$database_type = "mysql";$database_default = "cacti";$database_hostname = "127.0.0.1";$database_username = "cactiuser";$database_password = "cacti";$database_port = '3333';#修改資料庫連接配置/* 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";
重啟nginx php mysql
訪問 http://localhost/cacti
無錯誤即可,到此安裝完畢
#更多內容詳見官方手冊
http://docs.cacti.net/manual know errors
1.
ERROR:Your Cacti database login account does not have access to the
MySQL TimeZone database. Please provide the Cacti database account
“select” access to the “time_zone_name” table in the “mysql” database,
and populate MySQL’s TimeZone information before proceeding.
mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'cacti'
2.
ERROR: Your MySQL TimeZone database is not populated. Please populate
this database before proceeding.
mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root -p mysql