Cacti Notes

Pre-Flight

I’m using CentOS-Testing to install PHP 5.2.10.

yum install \
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 \
rrdtool \
--enablerepo=c5-testing

Here’s what I have in /etc/snmp/snmp/conf:

rocommunity HOME  
syslocation "The University of Iowa"  
syscontact mail@nikhil.io

I also made sure that the SNMP daemon was running by running:

snmpwalk -v 1 -c CLCG localhost IP-MIB::ipAdEntIfIndex

Set up the MySQL database:

grant all on cacti.* to 'cactiuser'@'localhost' identified by 'Lua77hQhdnB';

Install Cacti

Make sure that the EPEL
repository

is installed.

yum -y install cacti --enablerepo=epel

Look for an SQL install file and install it:

rpm -ql cacti | grep cacti.sql  
/usr/share/doc/cacti-0.8.7f/cacti.sql  
mysql -ucactiuser -p cacti < /usr/share/doc/cacti-0.8.7f/cacti.sql

Now edit the config file (/etc/cacti/db.php) to add database
information.

Change some permissions:

chmod -R 755 /usr/share/cacti  
chown -R cacti:cacti /usr/share/cacti

Make sure that the rra/ and log/ are owned by cacti.

Now restart the httpd service and navigate to http://site/*cacti* (or
whatever you edited to be the Alias directive.) The username/password config
for the first time login is admin/admin.

Problems

You get a “Forbidden” when loading the page for the first time

No freakin’ graphs

Tailing the httpd error log produces something like:

ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': No such file or directory

There’s also nothing in /var/log/cacti/cacti.log. In this case, do
this:

chown cacti:apache /var/lib/cacti/rra  
chmod 775 cacti:apache /var/lib/cacti/rra

This is a bug that
others have encountered. I changed the permissions like above, ran the
poller and the graphs were displayed. I’m fine with this.