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

Preface

Generally speaking, network management refers to the tasks associated with running a network, along with the software, tools, and technology required to support these tasks. One major part of running a network is to monitor the devices on it in order to know what is happening.

One definition of network management from the ISO Telecommunications Management Network model and framework for network management is known as FCAPS. It divides network management into five disciplines: Fault, Configuration, Accounting, Performance, and Security. Most network management tools can be assigned to one of these disciplines and, out of the box, Cacti is generally more of a performance measurement tool than a management tool, but it can be enhanced to also perform additional tasks.

What is Cacti?

Cacti is an open source performance measurement and graphing application. The first version of Cacti was published on 23rd September, 2001, and provided a complete web-based frontend to RRDtool, the high performance data logging and graphing system created by Tobias Oetiker, two years earlier. Cacti stores all of the information required to gather this data and create the graphs in a MySQL database, all of which is completely configurable via its web interface.

For data gathering, Cacti uses external scripts and commands, as well as all 3 SNMP versions.

Even in its initial release, Cacti included much of the functionality needed for an enterprise class performance measurement tool:

  • Complete web-based RRD and RRA management

  • Complete RRD Graph configuration and generation

  • With external Script/Command and SNMP support

  • With easy configuration for SNMP interface data graphing

  • With granular user rights management

System architecture of Cacti

From an architectural point of view, Cacti uses a cron/at-based poller to gather data from different sources, Round Robin Database (RRD) files to store the polled data, and a MySQL database to store the systems configuration. The primary user interface is a PHP web application that allows for easy management of all aspects of the system, as well as automatic display mechanisms for viewing the graphs.

Cacti is available for different operating systems such as Windows, Linux, and Solaris.

Cacti is more than performance measurement

Although the main area for which Cacti is used is performance measurement, it can be extended to do much more! With the introduction of the Plugin Architecture, Cacti can be extended to include tasks such as:

  • Threshold alerting

  • Real-time monitoring of specific data sources

  • Creating and sending scheduled reports

  • System logging and analysis

  • Performing network configuration backups

  • Integration of other network management software

  • Tracking network hardware

Many of these extensions or plugins are actively maintained and supported by the Cacti Group itself, while others are maintained by the Cacti community and the developer of each extension.

What this book covers

Chapter 1, Installing Cacti, will take you through the installation and configuration of Cacti. You will also learn how to upgrade an existing installation. The final part of the chapter will get you familiar with the different features of Cacti.

Chapter 2, Using Graphs to Monitor Networks and Devices, will teach you how to create graphs using RRDtool. Cacti uses RRDtool to store the polled data. In addition to storing data, RRDtool is also used to create performance graphs. This chapter also shows you how to add new devices and performance measurement graphs to them. Then you'll learn how to group devices using the Cacti tree. Cacti provides a facility to create templates for data, graphs, and hosts.

Chapter 3, Creating and Using Templates, will teach you how to create data templates and apply them to devices. You will create a threshold-based graph template and change the appearance of the graph depending on the data value. This chapter will also teach you how to create a selection of SNMP-based graphs and data queries, and how to import a template from the template repository and export our own host template.

Chapter 4, User Management, teaches you how to create a user and apply basic settings to it. Then we discuss different kinds of permissions, user authentication, and how to import a list of users through the command line interface.

Chapter 5, Data Management, will teach you about retrieving data for graphing with Cacti, which is more than just pulling SNMP data. Cacti allows several different methods for data retrieval. This chapter teaches you how to create your own data input methods and create custom scripts to gather remote data. After you complete this chapter, you will be comfortably able to manage a Cacti system.

Chapter 6, Cacti Maintenance, shows you how to create backups of your Cacti installation and how to restore it, as well as providing information on how to keep your Cacti instance clean of dead hosts and files. This chapter is dedicated to Cacti management.

Chapter 7, Network and Server Monitoring, will teach you how to set up Cisco network devices and prepare Windows systems to be monitored using the WMI interface. You will be provided with several instructions to configure your network devices, windows servers, and VMware ESX servers. Each of the different systems requires different methods and configuration tasks in order to poll the performance data.

Chapter 8, Plugin Architecture, shows you how to extend the capabilities of your Cacti instance with the available Plugin Architecture. Plugins allow end-users to implement missing features or create specific enhancements needed for internal corporate usage. At the end of this chapter, you will be able to add new features and functionality to your Cacti instance using external plugins.

Chapter 9, Plugins, provides an overview of the general plugin design based on the ntop plugin. It describes commonly used plugins and also helps you create your first plugin.

Chapter 10, Threshold Monitoring with Thold, provides an overview of the Thold plugin. It describes the different threshold types available. It shows you how to create a threshold and also helps you to build a threshold template and assign it to a data source.

Chapter 11, Enterprise Reporting, shows you how to define reports with the free Nectar and the commercially supported CereusReporting plugins.

Chapter 12, Cacti Automation for NOC, provides an overview of Cacti automation. It describes the process of using the CLI to add permissions, devices, and trees. It also guides you through the process of installation and usage of Autom8.

Appendix A, Mobile Access / Administration, gives some further information on how to access your Cacti installation with mobile devices.

Appendix B, Online Resources, gives more information on the other online resources available.

Appendix C, Further Information, gives more information on RRDtool, SNMP, and Cacti forums.

Appendix D, Pop Quiz Answers, gives answers to the pop-quizzes which appear at the end of each chapter.

What you need for this book

  • A Windows- or Linux-based system (CentOS is preferred)

  • A code or text editor

  • A browser

  • The code download for the book

Who this book is for

This book is for anyone who wants to implement performance measurement for trending, troubleshooting, and reporting purposes. The book also explains how to extend Cacti by implementing and creating your own plugins. If you are a network operator and know the basics of network management and SNMP, then this book is for you.

Conventions

In this book, you will find several headings appearing frequently.

To give clear instructions of how to complete a procedure or task, we use:

Time for action – heading

  1. Action 1

  2. Action 2

  3. Action 3

Instructions often need some extra explanation so that they make sense, so they are followed with:

What just happened?

This heading explains the working of tasks or instructions that you have just completed.

You will also find some other learning aids in the book, including:

Pop quiz – heading

These are short multiple choice questions intended to help you test your own understanding.

Have a go hero – heading

These set practical challenges and give you ideas for experimenting with what you have learned.

You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

/usr/bin/rrdtool graph -
--imgformat=PNG
--start=-86400
--end=-300

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

   $temp = array(
	"ntop_header" => array(
		"friendly_name" => "NTop",
         "method" => "spacer",
         ),

Any command-line input or output is written as follows:

perl create_rrdfile_linux.pl test.rrd

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes, for example, appear in the text like this: "Go back to the device overview page by clicking on the Devices link under the Management menu".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Tip

Downloading the example code for the book

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.