[cacti監控] centos6.2下安裝cacti監控
1> 配置LAMP環境
a> 安裝mysql數據庫
yum -y install mysql mysql-server mysql-devel
b> 配置apache與php
yum -y install httpd php php-mysql
www.2cto.com
2> 安裝rrdtool和net-snmp
yum -y install zlib freetype libjpeg fontconfig gd libxml2 php-gd
yum -y install perl-Net-Daemon perl-PlRPC perl-DBI rrdtool perl-rrdtool perl-DBD-MySQL
yum -y install php-pdo lm_sensors net-snmp php-snmp net-snmp-utils
3> 安裝cacti
tar -zxvf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a /var/www/html/cacti/
4> 配置cacti
a> 配置httpd服務
vim /etc/httpd/conf.d/cacti.conf
[plain]
Alias /cacti /var/www/html/cacti
DirectoryIndex index.php
AllowOverride all
order deny,allow
deny from all
allow from all
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
vim /etc/httpd/conf/httpd.conf
[plain]
276 ServerName localhost:80
vim /etc/php.ini
[plain]
946 date.timezone = PRC
service httpd start
b> 配置 mysql並導入 cacti.sql
service mysqld start
mysqladmin -u root password '123456'
mysql -uroot -p123456
mysql> create database cacti;
mysql> grant all on cacti.* to cacti@'localhost' identified by '123456';
mysql> flush privileges;
mysql -u cacti -p123456 cacti < /var/www/html/cacti/cacti.sql
c> 配置snmpd服務
vim /etc/snmp/snmpd.conf
[plain]
41 com2sec notConfigUser 127.0.0.1 public
62 access notConfigGroup "" any noauth exact all none none
85 view all included .1 80
service snmpd start
d> 配置cacti目錄權限
useradd cacti -d /var/www/html/cacti -s /bin/false
chown -R root:root /var/www/html/cacti/
chown -R cacti:cacti /var/www/html/cacti/rra /var/www/html/cacti/log
e> 配置cacti連接數據庫
vim /var/www/html/cacti/include/config.php
[plain]
29 $database_username = "cacti";
30 $database_password = "123456";
f> 配置cron計劃任務
crontab -u cacti -e
[plain]
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php &>/dev/null
5> 配置完成,設置服務開機自啟動
chkconfig httpd on
chkconfig mysqld on
chkconfig snmpd on