Book Image

Cacti 0.8 Beginner's Guide

By : Thomas Urban
Book Image

Cacti 0.8 Beginner's Guide

By: Thomas Urban

Overview of this book

Cacti is a performance measurement tool that provides easy methods and functions for gathering and graphing system data. You can use Cacti to develop a robust event management system that can alert on just about anything you would like it to. But to do that, you need to gain a solid understanding of the basics of Cacti, its plugin architecture, and automation concepts. Cacti 0.8 Beginner's Guide will introduce you to the wide variety of features of Cacti and will guide you on how to use them for maximum effectiveness. Advanced topics like the plugin architecture and Cacti automation using the command-line interface will help you build a professional performance measurement system.Designed as a beginner's guide, the book starts off with the basics of installing and using Cacti, and also covers the advanced topics that will show you how to customize and extend the core Cacti functionalities. The book offers essential tutorials for creating advanced graphs and using plugins to create enterprise-class reports to show your customers and colleagues. From data templates to input methods and plugin installation to creating your own customized plugins, this book provides you with a rich selection of step-by-step instructions to reach your goals. It covers all you need to know to implement professional performance measurement techniques with Cacti and ways to fully customize Cacti to fit your needs. By the end of the book, you will be able to implement and extend Cacti to monitor, display, and report the performance of your network exactly the way you want.
Table of Contents (23 chapters)
Cacti 0.8Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Pop Quiz Answers
Index

Time for action – installing Spine


  1. You now need to prepare the development environment for Spine. On CentOS you can do this by issuing the following command:

    yum install gcc mysql-devel net-snmp-devel autoconf automake libtool
    
  2. Download the spine source code. For this, go to http://www.cacti.net and click on Download under the Spine (Cactid) section. Right-click on Spine Source in the tar.gz format and copy the link address.

  3. Navigate to /tmp/ and issue the following command:

    wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz
    
  4. Extract the file:

    tar –xzvf cacti-spine-0.8.7g.tar.gz
    
  5. Navigate to the newly created cacti-spine-0.8.7g directory.

  6. Prepare the directory for compilation. Please note that this step may not work on other distributions, or additional steps need to be taken to accomplish it:

    ./bootstrap
    
  7. Configure the compiling environment:

    ./configure
    
  8. Compile Spine:

    make
    
  9. Once the make command finishes, install Spine:

    make install
    
  10. You now have Spine installed, but it needs to be configured. Therefore, copy the sample configuration file to a location where Spine will find it:

    cp /usr/local/spine/etc/spine.conf.dist /etc/spine.conf
    
  11. Edit the file in vi:

    vi /etc/spine.conf
    
  12. Change the database configuration to match the settings from earlier.

  13. Create a symbolic link in /sbin to the spine binary:

    ln -s /usr/local/spine/bin/spine /sbin/spine
    

What just happened?

You just set up a basic development environment for compiling Spine, compiled it, and then installed it. You also configured Spine to use the correct database information.

Tip

Compiling Spine on other Linux distributions

When compiling Spine on other Linux distributions such as Ubuntu, you will have to go through some additional steps. Look at the following URL for more information on how to do so:

http://docs.cacti.net/manual:087:1_installation.1_install_unix.6_install_and_configure_spine.

Differences between source and APT/Yum installations

The main difference between installing Cacti from source and using APT/Yum-based installations is the location of configuration files and availability of patches. Cacti, by default, does not follow the Filesystem Hierarchy Standard (FHS) defined for the Linux operating systems. The FHS defines directories where applications should add their configuration or log files. APT/Yum-based installations usually follow this standard. Due to this, add-ons such as the Plugin Architecture may not be available on all platforms using APT/Yum.

The main advantage of using APT/Yum-based installations is the ease of installation but as we've just seen, installing Cacti isn't very difficult.

However, the disadvantage of using APT or Yum is the availability of newer Cacti versions. Source-based Cacti installations can be upgraded to the latest version as soon as it is available on the Cacti website, while APT/Yum-based installations might need to wait until the package maintainers update their repositories.

Have a go hero – remote server for database hosting

Here is a little challenge for you. It's not difficult but it will allow you to alter the installation to suit your needs. What if you want to use a remote database server? Maybe you want to use an existing dedicated MySQL server, instead of hosting the database on the same system as Cacti, or you want to separate the roles to allow more growth. Can you figure out what to change?

Solution: Create the MySQL database on the remote system using the same command as if you were installing it locally, but this time use the -h <hostname> option to specify the remote server. When creating the user and granting it permissions, use the following command, assuming the Cacti server has the IP '192.168.0.10':

GRANT ALL ON cacti.* TO cactiuser@'192.168.0.10' IDENTIFIED BY 'MyV3ryStr0ngPassword'; 
flush privileges; 
exit

This will allow the Cacti user access to the database from the Cacti server. Now change $database_hostname in config.php and DB_Host in spine.conf on the Cacti server to point to your remote database server.