Installing Cacti On CentOS 4.4

This’s the tutorial how to install Network Monitoring Tools (Cacti)

1. Download Cacti Source
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
wget http://cactiusers.org/downloads/cacti-plugin-arch.tar.gz

3. Install Some Necessary Software
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 php-gd php-mysql

4. Extract Cacti
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
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 <>

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

patch -p1 -N <>

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

Search for

$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/’;

7. Create the MySQL Database and the Cacti user.
groupadd cacti
useradd -g cacti cactiuser

Now, we will create the database and grant permissions on it as needed.
mysql -u root -p
Enter your password and at the MySQL prompt, enter the following commands:
create database cacti;
grant all on cacti.* to root;
grant all on cacti.* to root@localhost;
grant all on cacti.* to cactiuser;
grant all on cacti.* to cactiuser@localhost;
set password for cactiuser@localhost=password(‘cactipw’);
exit

Finally, let’s import the SQL file that will create the tables (remember that you will need to use your MySQL password to complete this command):
cd /../downloads/cacti-0.8.6j
mysql -uroot -p cacti <>

8. Set permissions on Cacti directories
cd /../usr/local/cacti
chown -R cactiuser rra/ log/

9. Implement CRON job for Cacti poller
vi /etc/crontab

Add this following line on the last line of the file
*/5 * * * * cactiuser /usr/bin/php /usr/local/cacti/poller.php > /dev/null 2>&1

10. Install Cacti
Open on your browser
http://server IP address/cacti/

Default username : admin
Default password : admin

Leave a Reply