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.

We have to install following packages on our machine.

rpm -Uvh
yum install -y mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd net-snmp-utils php-snmp net-snmp-libs

Configuring the MySQL server

service mysqld start

Assign root password for MySQL

mysqladmin -u root password NEW_PASSWORD

Creating cacti database

mysql -u root -p
enter you mysql root password
mysql>create database cacti;

Creating user for cacti and assign a new password as cacti

mysql>GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';
mysql>FLUSH privileges;

Configuring snmp

Just copy my snmpd.conf file on your server, to do it

cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.original
rm -rf /etc/snmp/snmpd.conf

Copy my snmpd.file from here.

Just change the contact & network as per your requirements.

Run the following command to know wether the snmp is working or not

service snmpd restart
snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

Sample output

IP-MIB::ipAdEntIfIndex. = INTEGER: 2
IP-MIB::ipAdEntIfIndex. = INTEGER: 1

Installing cacti

yum -y install cacti

Installing cacti tables
(You need to type cacti user password in my case it is cacti)

mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7d/cacti.sql

Configuring cacti

vi /etc/cacti/db.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";

Save the file and exit

Configuring webserver

vi /etc/httpd/conf.d/cacti.conf
# Cacti: An rrd based graphing tool
Alias /cacti    /usr/share/cacti
        Order Deny,Allow
        Allow from all

Save and exit.

Restarting webserver

service httpd restart

Cronjob for cacti

Open /etc/cron.d/cacti file and uncomment the first line.

Running cacti installer

Now cacti is ready to install. Copy the following link on your webbrowser:

Just follow on screen instructions. The default username and password for cacti is admin / admin. Upon first login, you will be force to change the default password.

Cacti on CentOS
Tagged on:     

Leave a Reply

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

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recommend on Google