Cacti

Cacti-LogoCacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices. The current version when I am writing this article is 0.8.8.b

Cacti main website: Cacti


Upgrade Cacti.

Preparation

Change to the root www directory.

cd /var/www/html

Download the latest Cacti version ( e.g. 0.8.8b )

wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz

Extract the file to the current directory

tar -xzvf cacti-0.8.8b.tar.gz

Backup the database

The following command creates a complete backup of the cacti database. Replace the [cactiuser] with your actual cacti database user.

mysqldump -u [cactiuser] -p --lock-tables --add-drop-table cacti > ~/cacti_backup.sql
gzip ~/cacti_backup.sql

Change the configuration

Now let’s change the configuration of the new version to match your current cacti settings:

vi include/config.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "[dbuser]";
$database_password = "[dbpassword]";
$database_port = "3306";
$database_ssl = false;

/*
   Edit this to point to the default URL of your Cacti install
   ex: if your cacti install as at http://serverip/cacti/ this
   would be set to /cacti/
*/
$url_path = "/cacti/";

Please replace the [dbuser] and [dbpassword] part and make sure to adapth the
$url_path to match your settings.

Migrate scripts and data

Let’s assume that your current Cacti installation resides at

/var/www/html/cacti

and your new files are located at

/var/www/html/cacti-0.8.8a

then execute the following:

cp -u -R /var/www/html/cacti/scripts/* /var/www/html/cacti-0.8.8a/scripts/
cp -u -R /var/www/html/cacti/resource/* /var/www/html/cacti-0.8.8a/resource/
cp- R /var/www/html/cacti/plugins/* /var/www/html/cacti-0.8.8a/plugins/

Stop the Poller

Now it’s time to stop the Cacti poller. Go to Console->Settings then hit the “Poller” tab and uncheck the “Enabled” box.

Copy RRD files

Now that the poller is stoped, we can copy the RRD files.

mv  /var/www/html/cacti/rra/* /var/www/html/cacti-0.8.8a/rra/

Change the ownership of the files. Make sure to replace [cacti] with the actual name of your cacti system user.

cd /var/www/html/cacti-0.8.8a
chown -R [cacti] log/ rra/

Now move the old directory to for example cacti-<old version> and change the new version to the name cacti. Login and see if everything is working ok.