分类: LINUX
2010-09-15 14:07:01
源码安装cacti依赖关系多比较麻烦,今天试了下rpm安装步骤如下:
首先要安装EPEL
[root@localhost ~]# rpm -Uvh
[root@localhost ~]#yum repolist
Loading "skip-broken" plugin
Loading "fastestmirror" plugin
repo id repo name status
addons CentOS-5 - Addons enabled
base CentOS-5 - Base enabled
epel Extra Packages for Enterprise Linux 5 - enabled (有这个说明EPEL安装成功)
extras CentOS-5 - Extras enabled
updates CentOS-5 - Updates enabled
安装依赖包
[root@localhost ~]#yum install mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd
安装Cacti
[root@localhost ~]#yum install cacti
MySQL准备
[root@localhost ~]#mysqladmin -u root password NEWPASSWORD
[root@localhost ~]#mysql -u root -p -e 'create database cacti'
[root@localhost ~]#mysql -u root -p
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'zYn95ph43zYtq';
mysql> FLUSH privileges;
mysql> \q
[root@localhost ~]#rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.7d/cacti.sql
[root@localhost ~]#mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7d/cacti.sql
[root@localhost ~]#vi /etc/cacti/db.php
/* make sure these values refect your actual database/host/user/password */ $database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "zYn95ph43zYtq";
$database_port = "3306";
配置Apache
[root@localhost ~]#vi /etc/httpd/conf.d/cacti.conf
[root@localhost ~]#Cacti: An rrd based graphing tool
[root@localhost ~]#Alias /cacti /usr/share/cacti
Order Deny,Allow Deny from all
Allow from 192.168.1.0/24
[root@localhost ~]#service httpd restart
[root@localhost ~]#crontab -e
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
安装配置SNMP
[root@localhost ~]#yum install net-snmp-utils php-snmp net-snmp-libs
[root@localhost ~]#vi /etc/snmp/snmpd.conf
com2sec notConfigUser 192.168.1.0/24 public
access notConfigGroup "" any noauth exact all none none
view all included .1 80
安装