Cacti 配置

yum -y install mysql mysql-server php-mysql httpd php-pdo lm_sensors net-snmp php-snmp net-snmp-utils
chkconfig mysqld on
chkconfig httpd on
service mysqld start
mysql -uroot -p
create database cacti default character set utf8;
GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';
flush privileges;
\q
mysql -u cacti -p cacti < cacti.sql
#修改配置文件
# vim /var/www/cacti/include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "passwd";
$database_port = "3306";
useradd cacti -d /var/www/cacti -s /sbin/nologin

Alias /cacti/ "/var/www/cacti/"
<Directory /var/www/cacti>
    Options Indexes
        DirectoryIndex index.php
        AllowOverride all
        Order allow,deny
        Allow from all
        AddType application/x-httpd-php .php
        php_flag magic_quotes_gpc on
        php_flag track_vars on
</Directory>
crontab -e -u cacti
*/5 * * * * /usr/local/bin/php /usr/local/apache/htdocs/cacti/poller.php > /dev/null 2>&1
注意:首次执行poller.php时请使用cacti用户,否则生成的rrd文件cacti将没有写入权限。
php /var/www/cacti/poller.php

patch -p1 -N < cacti-plugin-0.8.6j.diff
$config['url_path'] = "/cacti/";

你可能感兴趣的:(职场,休闲)