Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cacti Beginner's Guide

You're reading from   Cacti Beginner's Guide Leverage Cacti to design a robust network operations center

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher
ISBN-13 9781788299183
Length 420 pages
Edition 2nd Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Thomas Urban Thomas Urban
Author Profile Icon Thomas Urban
Thomas Urban
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Installing Cacti FREE CHAPTER 2. Using Graphs to Monitor Networks and Devices 3. Creating and Using Templates 4. User Management 5. Data Management 6. Cacti Maintenance 7. Network and Server Monitoring 8. Plugin Architecture 9. Plugins 10. Threshold Monitoring with Thold 11. Enterprise Reporting 12. Cacti Automation for NOC 13. Migrating Cacti to a New Server 14. Multiple Poller with Cacti 15. Online Resources 16. Further Information 17. Pop Quiz Answers

Upgrading Cacti

Upgrading Cacti involves several steps, one of which is backing up the database. Since you created a symbolic link to the Cacti directory, you don't need to backup any files but instead we copy or move them from the old version over to the new one.

Time for action - upgrading Cacti

  1. Create a backup of the database. The following command will back up the Cacti database to a file called cacti_backup.sql. You will be asked for the MySQL root password:
    mysqldump -u root -p --lock-tables --add-drop-table cacti > /root/cacti_backup.sql
  
  1. Change to the /var/www/html directory. From http://www.cacti.net, download the source for the version you want to upgrade to.
  2. Create the CACTIVERSION variable and set it to the current Cacti version:
    export NEWCACTIVERSION=1.1.28  
  1. Extract the file. This will create a new directory named cacti-1.1.28:
    cd /var/www/html
    wget https://www.cacti.net/downloads/spine/cacti-
spine-$NEWCACTIVERSION.tar.gz
tar -xzvf cacti-spine-$NEWCACTIVERSION.tar.gz
  1. Change to the newly-created directory and edit include/config.php. Change the database entries in there to match your installation.
  2. Before copying any files, you should stop the poller using the web interface. Go to Configuration | Settings and change to the Poller tab. Disable the poller by unchecking it:
  1. Copy some files from your existing installation to the new one:
cp /var/www/html/cacti/rra/* /var/www/html/cacti-$NEWCACTIVERSION/rra/ 
cp -u /var/www/html/cacti/scripts/* /var/www/html/cacti-$NEWCACTIVERSION/scripts/ 
cp -u -R /var/www/html/cacti/resource/* /var/www/html/cacti-$NEWCACTIVERSION /resource/ 
  1. Set the permissions on the log and rra folders:
cd /var/www/html/cacti-$NEWCACTIVERSION/ 
chown -R cactiuser.apache /var/www/html/cacti-$NEWCACTIVERSION/ 
chmod -R 775 rra/ log/ resource/ scripts/ cache/ 
setfacl -d -m group:apache:rw /var/www/html/cacti/rra 
setfacl -d -m group:apache:rw /var/www/html/cacti/log 
  1. Change the symbolic link to point to the new directory:
cd /var/www/html/ 
ln -fs cacti-$NEWCACTIVERSION cacti 
  1. As Cacti 1.x requires the timezone data to be present in the MySQL/MariaDB database, you will have to import it here as well when upgrading from the 0.8.8 version of Cacti:
mysql_tzinfo_to_sql /usr/share/zoneinfo > /tmp/mysql_timezone.sql 
mysql -u root -p mysql < /tmp/mysql_timezone.sql 
  1. You will also have to grant access to the timezone tables using the following SQL statement:
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'MyV3ryStr0ngPassword'; 
  1. The final upgrade process is done using the web interface. Point your browser to http://<yourserver>/cacti/install and follow the steps. Make sure you select Upgrade on the second page.
  2. If you are upgrading from 0.8.8 to 1.x, the upgrade process will take some time to complete depending on your Cacti installation size.
  3. You can now enable the poller again using the Cacti web interface.
  4. Once you have checked that everything is working fine, you can remove or archive the original Cacti directory.

What just happened?

You upgraded Cacti to a newer version. As a safety net, you created a backup of the database so you can revert back to the old version in case of an error. You copied the RRD files and other resources to the new installation and switched over by changing the symbolic link to point to the new location. You finished the upgrade process by going to the install URL, which provides the final web-based upgrade process.

You have been reading a chapter from
Cacti Beginner's Guide - Second Edition
Published in: Dec 2017
Publisher:
ISBN-13: 9781788299183
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime