Saturday, 28 April 2012

Configuring Cacti on RHEL 6

This is the Cacti installation from EPEL so enable the EPEL repo.
Also enable the rhel-6-server-optional channel in redhat.repo as it's required for php-snmp.

Install the packages cacti, mysql-server, httpd, net-snmp-utils

Turn on and chkconfig mysqld and httpd
(Amend ServerName in httpd.conf if hostname is not resolvable)

 Set cacti passwords and create the cacti database

mysqladmin -u root password rootsecretpassword
mysql -u root -p -e 'create database cacti'
mysql -u root -p
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cactisecretpassword';
mysql> FLUSH privileges;

Replace the default /etc/snmp/snmpd.conf with this as it's too secure.
com2sec local     localhost           public
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
view all    included  .1                     80
access MyRWGroup ""  any  noauth  exact   all    all    none
syslocation My House
syscontact Me

Turn on and chkconfig snmpd

Walk the snmp mib and verify it returns active interfaces; otherwise it's not configured right.
snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

Configure the cacti database
mysql -u cacti -p  cacti < /usr/share/doc/cacti-0.8.7i/cacti.sql

 Edit /etc/cacti/db.php
$database_username = "cacti";
$database_password = "cactisecretpassword";

Edit /etc/httpd/conf.d/cacti.conf

Alias /cacti    /usr/share/cacti

<Directory /usr/share/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from all
</Directory>


Restart httpd

Uncomment poller cron job in /etc/cron.d/cacti

Your Cacti server awaits:

http://yourserver/cacti  & login as admin / admin

No comments:

Post a Comment