Cacti ก็เป็นเครื่องมือ web interface ใช้ในการ monitor network แสดงผลเป็น Graph ให้ผู้ดูแล ได้ทำงานง่ายขึ้น Cacti ก็ทำงานโดยอาศัยความสามารถของ RRDtoo ตอนนี้เราก็จะมา ทำการทดสอบติดตั้ง บน CentOS 5.5 กันนะครับ เริ่มกันเลยดีกว่า
เริ่มแรกหลังจาก install CentOS แล้ว เราก็ทำการปิด SELinux กันก่อนเพราะ Cacti อาจมีปัญหากับตัว SELinux ได้ขั้นตอนการปิด หรืออาจจะปิดใน คำสั่ง setup ของ Centos ก็ทำได้เหมือนกัน
#nano -w /etc/selinux/config
Edit:
SELINUX=disabled
install packet rpmforge-release for centos
#rpm - Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
install cacti and software require.
#yum install cacti httpd mysql-server net-snmp-utils
Set Mysql and httpd daemon are start at boot follow as below: #chkconfig mysqld on
#chkconfig httpd on
#service mysqld start
#service httpd start
Create password for root for mysql
mysqladmin -u root password yourpasswod
Create database for cacti name database is cacti
mysqladmin -u root -p create cacti
note: don't forget password mysql after user command.Import script cacti.sql to mysql
#mysql -u root -p cacti < /usr/share/doc/cacti-0.8.7g/cacti.sql And create user and password for cacti to use and best to limit access to our database. # mysql -u root -p mysql mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'YourPasswrd';
mysql> flush privileges;
mysql> exit
Edit file /var/www/cacti/include/config.php for connect to database.
#nano -w /var/www/cacti/include/config.php
Edit :
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "YourPassword";
Add line to /etc/crontab file for cacti run every 12 minute.
#nano -w /etc/crontabAdd to end line:
*/5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1
Edit cacti configuration file for apache to allow access to the web interface.
#nano -w /etc/httpd/conf.d/cacti.conf
Edit:
DirectoryIndex index.php
Options -Indexes
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
Open firewall port 80 for web interface in iptables.
#nano -w /etc/syconfig/iptables
Add line:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Restart the Apache web server to apply configruration.
#service httpd restart
Open browser go to http://ipserver/cacti/
Click Next and install and happy ending if no problem.
ไม่มีความคิดเห็น:
แสดงความคิดเห็น