This guide will show you how to upgrade Cacti to a newer version.

Assumptions for upgrading Cacti

  • Cacti is installed in /var/www/html/cacti
  • The “cacti” directory is a sym-link to the current version e.g “/var/www/html/cacti-0.8.8b”
  • The Operating System is CentOS/RHEL

Preparation

Change to the root www directory.

cd /var/www/html

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

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

Extract the file to the current directory

tar -xzvf cacti-0.8.8g.tar.gz

[field name=AdsWithin]

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:

cd cacti-0.8.8g
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.8g

the execute the following:

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

[field name=AdsWithin]

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.8g/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.8g
chown -R [cacti] log/ rra/

Change symbolic link

Now we can change the symbolic link from the old cacti version to the new one.

cd  /var/www/html/
rm cacti
sudo ln -fs cacti-0.8.8g cacti

Upgrade spine

The spine poller needs to be updated as well.

cd /tmp
wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8g.tar.gz
tar -xzvf cacti-spine-0.8.8g.tar.gz
cd cacti-spine-0.8.8g
./bootstrap

This should output the following:

INFO: Starting Spine build process
INFO: Removing cache directories
INFO: Running auto-tools to verify buildability
Using `AC_PROG_RANLIB' is rendered obsolete by `AC_PROG_LIBTOOL'
Putting files in AC_CONFIG_AUX_DIR, `config'.
INFO: Spine bootstrap process completed

  To compile and install Spine do the following:

  ./configure
  make
  make install

Let’s start the compilation process:

./configure
make
make install

If your spine installation is somewhere else, you can configure the final install location with e.g. ./configure --prefix=/opt/cacti/

If you have put spine into the same directory as it was installed before, then spine is ready to go. If you changed the destination dir, then you will have to create or modify the spine.cfg file.

[field name=AdsWithin]

Start the Web-Based Cacti Upgrade

Now go to your Cacti installtion ( http:///cacti ). You will be presented with a step-by-step wizard that will guide you through the update process.

Verify Cacti Version

Login to your Cacti instance and check the version displayed at the top right of the console screen.

Re-Enable the Poller and Rebuild the Poller Cache

The last step is to re-enable the poller. The Poller Cache also needs to be rebuild.

Need Commercial Support ?

Urban-Software.de offer commercial Cacti support not only for Cacti itself, but also for several of the plugins ( e.g. Thold ).
There’s going to be an on-demand solution in the future. You can contact us for more details using the contact form.

2 thoughts on “HowTo Upgrade Cacti on Centos”

Leave a Reply