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 http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
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
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;
mysql>exit;
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.192.168.213.128 = INTEGER: 2
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
Installing 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
/* 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
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:
http://you_server_ip/cacti/
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.