Cacti On CentOS 4.4 Including The Plug-in Architecture

Version 1.0
Author: Shakey - shakey [at] shakeysplace [dot] com
Last edited 04/18/2007

This guide will (hopefully) step you through the process of installing a functional Cacti installation on CentOS 4.4 including the Plug-in Architecture, which will allow you to expand your monitoring solution.

There may be other methods of achieving the same results as I will present here today, but for me, this works.

NOTE: This guide assumes that you already have a working LAMP server.  If not, then I suggest having a look at “The Perfect Setup - CentOS 4.4 (32-bit) by till”.

1 Download Cacti Source

As of this guide, the most recent version of Cacti is cacti-0.8.6j, so this is the one that we will work with.  I maintain a directory for files that I download to my system called “downloads”.  You may of course use whatever directory you see fit, but for the beginner, let’s create the directory and download Cacti.

cd /
mkdir downloads
chmod 755 downloads
cd downloads
wget http://www.cacti.net/downloads/cacti-0.8.6j.tar.gz

2 Download the Plug-in Architecture

Again, we will be working in the ‘downloads’ directory, which you should still be in.  The current version of the Plug-in Architecture is v1.1.

wget http://cactiusers.org/downloads/cacti-plugin-arch.tar.gz

3 Install Some Necessary Software

Before we begin building Cacti, we will need to install some software to meet dependencies.
First, let’s add the Dag Wieers repository which is necessary for some of the software.  This assumes that you are installing Cacti on CentOS 4.4. If you are using a different version, please check this page for the proper link to use after the ‘rpm –Uvh’ command.

rpm -Uvh http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
yum install rrdtool-devel net-snmp net-snmp-utils net-snmp-devel freetype-devel libpng-devel libart_lgpl-devel

Be sure, when prompted, to answer “y” to begin the installation process.

4 Extract Cacti

In this step, we will extract Cacti, move it to a new directory and create a symlink to your web root.

tar -xvzf cacti-0.8.6j.tar.gz
cp -Rf cacti-0.8.6j /usr/local/cacti
ln -s /usr/local/cacti /var/www/html

5 Extract Plug-in Architecture and patch Cacti

Before we begin the Cacti installation process, let’s extract the Plug-in Architecture and patch the Cacti files.

tar -xvzf cacti-plugin-arch.tar.gz
cp cacti-plugin-arch/cacti-plugin-0.8.6j.diff /usr/local/cacti/
cd /usr/local/cacti/

Now, let’s test the patch to ensure that everything is set up properly by performing a dry run on the patching process.  You do this, by issuing the command:

patch -p1 -N –dry-run < cacti-plugin-0.8.6j.diff

If no errors are returned, let’s go ahead and patch Cacti.  Issue the following command to do so:

patch -p1 -N < cacti-plugin-0.8.6j.diff

6 Edit config.php to set the proper URL path and user settings

nano include/config.php

Let’s go ahead and set up our database connection information:Press CTRL-W to enter search mode. In the search window, enter:

$database_password = “cactiuser”;

Now that our search query is pasted in, hit the enter button to execute our query. Once found, replace it with:

$database_password = “cactipw”;

Now, we need to search for and replace $config[’url_path’] = ‘/’;

Press CTRL-W to enter search mode. In the search window, enter:

$config[’url_path’] = ‘/’;

Replace this line with:

$config[’url_path’] = ‘/cacti/’;

Press CTRL-O to write out your changes, press enter to save the changes and CTRL-X to exit the nano editor.

Read rest of this awesome article at Cacti On CentOS 4.4 Including The Plug-in Architecture - Page 2