Cacti Configuration on Centos 6.4

Cacti is very excellent and effective monitoring tool across all open source based monitoring tools in market. Cacti provide you graphical view of IT infrastructure resource like server, network & other (memory, disk utilization, network ping response, load & bandwidth utilization. To install follow the below process.

Step 1:  Cacti Packages Installation

Step 2:  Start all the Services

Step 3:  Download and Install

Step 4:  Change version and create User

Step 5 :  Set Permissions

Step 6:  MySQL Configuration

Step 7:  Set database Credentials

Step 8:  Edit cron job file in cacti

Step 9:  Web-based Installer

Start the installation process by downloading all the packages required:

Step 1: Cacti Packages Installation

Using yum the following packages had to install:

#yum -y install mysql-server php php-cli php-mysql net-snmp-utils rrdtool php-snmp gcc mysql-devel net-snmp-devel autoconf automake libtool dos2unix

Step 2 :  Start all the Services

Now let’s make sure that our webserver and the database are automatically starting up after a reboot. Use the following commands to enable these:

#/etc/init.d/httpd start

#chkconfig httpd on

#/etc/init.d/mysqld start

#chkconfig mysqld on

#chkconfig crond on

#/etc/init.d/crond start

Step 3: Download and Install

Download the cacti by using the below command

#cd /var/www/html/

#yum install cacti -y

Step 4: Change version and create User

If required change cacti version using below command:

#ln -s cacti-0.8.8a cacti

Create the system “cacti” user now:

#adduser cacti

#passwd cacti

Step 5:  Set Permissions 

We also need to make sure that the permissions on the log and rra directories are set:

#cd /var/www/html/cacti

#chown -R cacti.apache rra log 

#chmod 775 rra log

Step 6: MySQL Configuration

#mysql -u root -p

#create database cacti;         #GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY ‘techmark’; #flush privileges; #exit

Copy cacti sql dump file to new cacti database

#mysql -u cacti cacti  < cacti.sql -p

Step 7:  Set database Credentials 

setting the database credentials and iptables

i. Before going to the web-based installer set the database credentials within the Cacti config file in both the file path it should be modified:

#vi /var/www/html/cacti/include/config.php

#vi /usr/share/cacti/include/config.php

Change the $database_ lines to fit your new settings

#database_type = "mysql";
#database_default = "root";
#database_hostname = "localhost";
#database_username = "root";
#database_password = "Password";
#database_port = "3306";
#database_ssl = false;

you should also uncomment the following line in the above file

#$url_path = “/cacti/”; save and exit ii.

#vi /etc/sysconfig/iptables

add these lines

-A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT 

save and exit.

iii. provide server ipaddress in this file

#vi /etc/httpd/conf.d/cacti.conf

<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
 Require host localhost
 <IfModule !mod_authz_core.c>
 # httpd 2.2
 Order deny,allow
 Deny from all
 Allow from

#service httpd restart

Step 8: Edit cron job file in cacti

cron entry to your system can be given as per your requirement i have given 5 minute polling interval by uncomment the command in file

#vi /etc/cron.d/cacti

  echo “*/5 * * * * cacti php /var/www/html/cacti/poller.php &>/dev/null” >> /etc/cron.d/cacti

Step 9: Web-based Installer

Let’s move on to the web-based installation

For more details on cacti you can also watch the Video :


Leave a Reply

Your email address will not be published. Required fields are marked *

− 6 = 3