以下資料參考至:
(1) Cacti官方網頁 - http://www.cacti.net/index.php
(2) chris's Blog - http://blog.linuxchris.com/?p=38
# 安裝基本的packages
yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server \
cairo-devel libxml2-devel pango-devel pango libpng-devel freetype \
freetype-devel libart_lgpl-devel net-snmp-utils gcc wget man make \
perl-CPAN perl-ExtUtils-MakeMaker perl-ExtUtils-MakeMaker-Coverage \
crontabs xorg-x11-fonts-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi \
ntp
# Disable SELinux
# 若有做更新SELinux的設定,要先Reboot,如下
vim /etc/selinux/config
----------------------------------------------------
SELINUX=disabled
----------------------------------------------------
# Disable fireware
service iptables stop
service ip6tables stop
chkconfig ip6tables off
chkconfig iptables off
# 啟動並預設cacti要使用的service
service httpd start
service mysqld start
service ntpd start
service snmpd start
chkconfig httpd on
chkconfig mysqld on
chkconfig ntpd on
chkconfig snmpd on
# Add the fonts we installed to the font cache for Apache to use
fc-cache -vfs
# Install rrdtool and store in /opt
cd /opt
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar -zxvf rrdtool.tar.gz
cd rrdtool-1.4.7
# Install rrdtool
./configure --prefix=/usr/local
make
make install
cd /usr/local
ln -s /opt/rrdtool-1.4.7 rrdtool
# 更改extension_dir的value,如下:
vim /etc/php.ini
----------------------------------------------------
extension_dir = /usr/lib64/php/modules/
----------------------------------------------------
# Set a password for the root user
mysqladmin --user=root password mypassword
mysqladmin --user=root --password reload
# Install and Configure Cacti
mkdir -p /var/www/html/cacti
cd /var/www/html/
wget http://www.cacti.net/downloads/cacti-0.8.7i-PIA-3.1.tar.gz
tar zxvf cacti-0.8.7i-PIA-3.1.tar.gz
mv cacti-0.8.7i-PIA-3.1 cacti
cd cacti
#import Cacti SQL
mysqladmin -u root -pmypassword create cacti
mysql -u root -pmypassword cacti < cacti.sql
mysql -u root -pmypassword
# MySQL command
mysql> GRANT ALL ON cacti.* TO admin@localhost IDENTIFIED BY 'adminpassword';
mysql> flush privileges;
# 更改config.php成我們MySQL的username, password與url path,如下:
vim include/config.php
----------------------------------------------------
$database_username = "admin";
$database_password = "adminpassword";
$url_path = "/cacti/";
----------------------------------------------------
# 更改目錄權限
chown -R apache:apache /var/www/html/cacti
chown -R admin rra/ log/
# 我們每五秒鐘要polling一次,如下:
vim /etc/crontab
----------------------------------------------------
*/5 * * * * root php /var/www/html/cacti/poller.php > /dev/null 2>&1
----------------------------------------------------
最後,開啟您的browser進入http://localhost/cacti/ 就可以使用了!
帳號密碼是我們設定的admin與adminpassword
留言列表