centos部署cacti 1.X

来源:互联网 发布:淘宝电商怎么注册 编辑:程序博客网 时间:2024/05/17 07:45

  • 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
1 0
原创粉丝点击