NO1:
安装环境:
执行一下命令安装所需要的包
1、
#yum install httpd php php-mysql mysql mysql-server perl-DBD-MySQL php-pdo net-snmp net-snmp-libs net-snmp-utils net-snmp-devel ruby php-snmp ruby-devel rrdtool-ruby rrdtool-perl -y
修改apache的配置文件,让他支持php
2、vim /etc/httpd/conf/httpd.conf
找到DirectoryIndex所在的位置,添加一行主页支持:
DirectoryIndex index.php
然后再找到AddType application开头的行添加一下两行扩展
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
3.重启动你的apache和mysql服务
4.创建CACTI使用的数据库,并添加用户
CREATE DATABASE cacti;
grant all on cacti.* to [email protected]‘localhost‘ identified by ‘cacti‘;
grant all on cacti.* to [email protected]‘127.0.0.1‘ identified by ‘cacti‘;
flush privileges;
NO2:
1. 安装Cacti;
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
之后解压复制到网页目录,/var/www/html/cacti下
2.导入数据库
USE mysql;
SOURCE /var/www/html/cacti/cacti.sql;
3.编辑配置文件
vim include/config.php
view source
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$database_ssl = false;
4.在crontab中加入计划任务
crontab -e
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
5.设置目录权限
chmod -R 755 ../cacti/
7.http://localhost/cacti OK.