Pages

Install Cacti on CentOS 5.2

Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

1. Before installing cacti, some package have installed first :



  • httpd
  • mysql
  • net-snmp
  • php
  • rrdtool
If those package not installed yet, type :

[root@localhost ~]# yum -y install httpd php mysql php-mysql mysql-server php-snmp net-snmp net-snmp-utils rrdtool

2. Make user and password for cacti

[root@localhost ~]# groupadd cacti
[root@localhost ~]# useradd -g cacti cactiuser
[root@localhost ~]# passwd cactiuser
Changing password for user cactiuser.
New UNIX password:  <=== type password here
Retype new UNIX password:
all authentication tokens updated successfully.

3. Download cacti package from www.cacti.net

[root@localhost ~]# wget http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz

4. Extract cacti package

[root@localhost ~]# tar -zxvf cacti-0.8.7b.tar.gz

5. Move cacti directory to /var/www/html and rename it

[root@localhost ~]# mv cacti.-0.8.7b /var/www/html
[root@localhost ~]# cd /var/www/html
[root@localhost  html]# mv cacti-0.8.7b cacti

6. Start mysql service and create database for cacti

[root@localhost  html]# /etc/init.d/mysql start
[root@localhost  html]# cd cacti
[root@localhost  cacti]# mysqladmin -u root password your_password
[root@localhost  cacti]# mysqladmin -u root -p
Enter password:
mysql> create databases cacti;
Query OK, 0 rows affected (0.00 sec)

7. Grant database cacti for cactiuser

mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘cactipassword’;
Query OK, 0 rows affected (0.00 sec)

8. Import file cacti.sql into database cacti

[root@localhost  cacti]# mysql -u cactiuser -p cactipassword < cacti.sql

9. Edit file config.php

[root@localhost  cacti]# vi include/config.php
database_type = "mysql"
database_default = "cacti"
database_hostname = "localhost"
database_username = "cactiuser"
database_password = "cactipassword"
database_port = "3306"

10. Change own user for rra/ and log/

[root@localhost  cacti]# chown -R cactiuser rra/ log/

11. Open crontab and add this line below

[root@localhost  cacti]# crontab -e

*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1

12. Restart service mysql

[root@localhost  cacti]# /etc/init.d/mysql restart

13. Continue cacti installation on your web browser http://your_ip/cacti




Click next to continue




Keep the type installation is New Install and click next




Make sure cacti can found every path. if done click next




Now login into cacti for first time. username and password is admin.




Cacti ask you to change default password for security reason




Cacti is installed on your machine. explorer all over on cacti interface to feel the new experince :). this is my graph on my localhost :


No comments:

Post a Comment