centos部署cacti 1.X

xiaoxiao2021-02-27  267

cacti dependence phpmysql cacti configureknow errors

cacti dependence

php

#/etc/php.ini safe_mode = Off date.timezone = "Asia/Shanghai"

mysql

[mysqld] basedir = /opt/mysql_cacti/ datadir = /opt/mysql_cacti/data bind-address= 0.0.0.0 port = 3333 user=mysql # server_id = ..... socket = /opt/mysql_cacti/mysql.sock max_heap_table_size=1567M max_allowed_packet=16777216 join_buffer_size=64M tmp_table_size=64M innodb_buffer_pool_size=7835M innodb_doublewrite=0 innodb_additional_mem_pool_size=80M innodb_flush_log_at_timeout=3 innodb_read_io_threads=32 innodb_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.gz shell> tar xzf cacti-1.1.3.tar.gz -C /www/ shell> ln -s /www/cacti-1.1.3/ /www/cacti shell> cd /www/cacti/ shell> mysql -root -p mysql> 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
转载请注明原文地址: https://www.6miu.com/read-8540.html

最新回复(0)