Introduction:
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data
in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.
Cacti requirement:
MySQL Server : Store cacti data.
NET-SNMP server - SNMP for network management.
PHP with net-snmp module - Access SNMP data using PHP.
Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL.
Step1: Install required dependencies
#yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel 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 mysql-devel make patch openssl-devel openssl net-snmp-devel gcc gcc+ libtool
Step2: Download and install RRDTool
#wget http://people.ee.ethz.ch/~ oetiker/webtools/rrdtool/pub/ rrdtool.tar.gz
#tar -zxvf rrdtool-1.4.5.tar.gz
#cd rrdtool-1.4.5
#./configure
#make
# make install
Step3: Configure MySQL
#useradd cactiuser
#/sbin/service mysqld start
#mysqladmin --user=root password password _of_ root
#mysqladmin --user=root --password reload
# mysql -u root -p
Enter password:
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('
# wget http://www.cacti.net/ downloads/cacti-0.8.7g.tar.gz
#tar -zxvf cacti-0.8.7g.tar.gz
#mv cacti-0.8.7g.tar.gz cacti
#cp -rf cacti /var/www/html/
#vi /var/www/html/cacti/include/ config.php
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "password_of_cactiuser";
(save & exit)
#cd /var/www/html/cacti
#mysql --user=root --password=rootpw cactidb < cacti.sql
#chown -R cactiuser rra/ log/
#vi /etc/etc/crontab
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
# service crond restart
#chkconfig crond on
#service httpd restart
#chkconfig httpd on
#service mysqld restart
#chkconfig mysqld on
open browser:- http://localhost/cacti
username/password- admin/admin
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data
in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.
Cacti requirement:
MySQL Server : Store cacti data.
NET-SNMP server - SNMP for network management.
PHP with net-snmp module - Access SNMP data using PHP.
Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL.
Step1: Install required dependencies
#yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel 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 mysql-devel make patch openssl-devel openssl net-snmp-devel gcc gcc+ libtool
Step2: Download and install RRDTool
#wget http://people.ee.ethz.ch/~
#tar -zxvf rrdtool-1.4.5.tar.gz
#cd rrdtool-1.4.5
#./configure
#make
# make install
Step3: Configure MySQL
#useradd cactiuser
#/sbin/service mysqld start
#mysqladmin --user=root password password _of_ root
#mysqladmin --user=root --password reload
# mysql -u root -p
Enter password:
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('
password_of_ cactiuser');
mysql> flush privileges;
mysql> exit
Step4: Install and Configure Cacti
mysql> flush privileges;
mysql> exit
Step4: Install and Configure Cacti
# wget http://www.cacti.net/
#tar -zxvf cacti-0.8.7g.tar.gz
#mv cacti-0.8.7g.tar.gz cacti
#cp -rf cacti /var/www/html/
#vi /var/www/html/cacti/include/
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "password_of_cactiuser";
(save & exit)
#cd /var/www/html/cacti
#mysql --user=root --password=rootpw cactidb < cacti.sql
#chown -R cactiuser rra/ log/
#vi /etc/etc/crontab
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
# service crond restart
#chkconfig crond on
#service httpd restart
#chkconfig httpd on
#service mysqld restart
#chkconfig mysqld on
open browser:- http://localhost/cacti
username/password- admin/admin
*******************************************************************************
With the help of Mohit Kumar