Cacti on CentOS 4.4 Including The Plug-in Architecture

Version 1.3
author: Shakey - shakey [at] shakeysplace [dot] com
Updated: 06/15/07

This guide will 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”. 

If your system was not setup using the guide from till, then I would suggest that you look at the following sections to ensure that you have the proper software installed to make this guide work for you:

  • Section 6 - Install Some Software
  • Section 11 - Apache2 With PHP

Update: I have been contacted and informed that the version of Net-SNMP being installed by YUM may not be working properly, so I have updated my guide. Now, both RRDTool and Net-SNMP will be installed from source.

Update: Updated to correct some issues with directory permissions, place the cron job under the cactiusers cron entry and also to eliminate an issue that some people reported when trying to compile RRDtool.

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


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.



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
yum install freetype-devel libpng-devel libart_lgpl-devel php-gd php-mysql

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


4 Compile RRDtool

In this step, we will download and compile RRDTool.

tar -xvzf rrdtool.tar.gz
cd rrdtool-1.2.23/
./configure --disable-tcl
make install

Create a symlink for RRDTool.

ln -s /usr/local/rrdtool-1.2.23/bin/rrdtool /usr/local/bin/rrdtool


5 Compile Net-SNMP

In this step, we will download and compile RRDTool.

tar -xvzf net-snmp-5.2.4.tar.gz
cd net-snmp-5.2.4

At this point, you will be prompted to answer a few questions. You can either accept the defaults or use the examples below as a guide:

SNMP version to use = "1";

Contact = "Your name";

Location = "Your location";

Location to write logfile to = "Hit enter for the default";

Location of write persistant iinformation = "Hit enter for the default";

make install


6 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


7 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


8 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.

Share this page:

0 Comment(s)

Add comment