34,79 €
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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 344
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2011
Production Reference: 1110311
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-849513-92-0
www.packtpub.com
Cover Image by Ed Maclean (<[email protected]>)
Author
Thomas Urban
Reviewers
Michael Bouma
Mark Cutting
Acquisition Editor
Tarun Singh
Development Editor
Kartikey Pandey
Technical Editor
Kavita Iyer
Copy Editor
Neha Shetty
Indexers
Hemangini Bari
Tejal Daruwale
Editorial Team Leader
Akshara Aware
Project Team Leader
Ashwin Shetty
Project Coordinator
Poorvi Nair
Proofreader
Bernadette Watkins
Graphics
Nilesh Mohite
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
ThomasUrban is the owner of Urban-Software.de, a software and consulting services company providing add-ons, plugins, and services for the Cacti and Zenoss Network Monitoring systems. He has been programming web applications for over 15 years, building reporting interfaces, network management software, asset management sites, and more.
I would like to thank the team at Packt Publishing—most of all for giving me this opportunity to write a book and also for taking care of schedules, providing support, guidance and feedback, and keeping me on track the whole way.
I would also like to thank all of the reviewers for taking the time to read, correct, and provide valuable feedback to the book throughout the writing process.
Lastly, I want to thank Despina—for making sure I never ran out of coffee on the countless evenings I spent sitting in front of the keyboard instead of with her and the children. I dedicate this book to her.
MichaelBouma in the IT business since 1990, starting as a programmer in assembly and Pascal.
He worked for more than 10 years in satellite communications, where he developed an interest for networks and network monitoring. Michael has worked with Cacti since 2001 and has introduced Cacti as the main monitoring product in three different companies. In his last two companies, he was also involved in writing several plugins for Cacti.
Michael is currently working as a network engineer at Atos Origin in the Netherlands. Here he is developing plugins for customers and setting up tooling and monitoring.
In his spare time he is active with Sloop Rowing races.
http://www.sterkesietze.nl
MarkCutting has been working in the IT arena for the last 20 years. During this time, he has worked in a variety of areas including manufacturing, commodity-based trading, and finance.
In these positions, he has been involved in numerous network and application builds/rollouts, projects, design standards, and day-to-day operations. He currently manages a network consisting of 10 sites globally where he supports the core network infrastructure and the applications that are key to the business functions.
These technologies include SQL, Windows 2003/2008, Cisco, Juniper, Citrix, and numerous others. He also supports a wide range of global MPLS networks, and has designed and developed a network fail-over strategy that provides minimum down time for critical business applications and voice traffic.
In addition to the activities above, Mark is a member of the Cacti forums, under the name of "mcutting". He is also a keen developer, working with technologies such as PHP, MySQL, Bash, AutoIT, and of course, Cacti.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and, as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
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.
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:
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.
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:
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.
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.
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.
In this book, you will find several headings appearing frequently.
To give clear instructions of how to complete a procedure or task, we use:
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 <[email protected]>, 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 <[email protected]>.
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.
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.
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.
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 erratasubmissionform 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 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 <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Let's get right on with setting up Cacti. Take a look at what we will do next.
In this chapter, we are going to:
Here we go….
In order to install and run Cacti, we need to make sure that all system prerequisites are met. Here we'll give an overview of the different components needed.
As most of Cacti is built as a web interface, a web server is needed. This can be Apache's httpd or Microsoft's Internet Information Server (IIS) if installing on Windows, but in fact, any PHP-capable web server can be used to run the web interface. For optimal support, the use of Apache or IIS is suggested.
Cacti is built with the PHP programming language and therefore needs PHP to be installed on the system. Most Linux distributions already have a base PHP environment installed, but some might need additional packages for Cacti to function properly. In particular, the LDAP, SNMP, and MySQL extensions should be installed.
Cacti uses the freely available MySQL database engine as its database server and it is available on most operating systems. One should note that the database server does not need to be installed on the same host as Cacti. For best performance, MySQL version 5 should be used.
The NET-SNMP package provides the SNMP binaries used by Cacti and supports SNMPv1, SNMPv2c, and SNMPv3.
The NET-SNMP package also provides the SNMP daemon for Linux.
You're now going to install Cacti from source on a CentOS 5 system. You should use at least Centos 5.5 as it is 100% binary compatible with RedHat Enterprise Linux 5, but in fact you can follow most of the installation processes on other Linux distributions, such as Ubuntu or SuSe Linux, as well. By installing from source you'll get some insight into the inner workings of Cacti, and it will also provide you with a system which most Cacti and plugin developers are used to. There are differences between a source installation and a Yum/APT installation, but they will be described later on. Let's get started.
Assume that the CentOS system has been installed with only the "Server Package" selected and there is no graphical user interface installed.
This is the default installation for a CentOS system with no manual package selection.
The default CentOS installation is missing several important packages. So, we are now going to install these.
You just gave the system a location to find the remaining packages needed for the Cacti installation and then installed them; therefore, you are now ready to start the next installation phase.
Go to http://www.cacti.net and download the latest version of Cacti. In the top-left corner, under Latest Files, right-click on the tar.gz file and save the link address to the clipboard. You are going to need this link later. For simplicity we're assuming that your server has an Internet connection.
It's now time to download the latest version of Cacti to your server. You will need your system username and password to login to your CentOS installation. If you have installed your CentOS system with the default settings, you should already have an SSH server running. If you're already logged on to the machine, you can ignore the first step.
You should see the following output on your screen:
You now have the tar.gz file on your system, so let's move on and extract it. To do this, enter the following command:You downloaded the latest Cacti version to the root directory of the web server and created a symbolic link to the extracted directory. With the Cacti files in place, you are now ready for the next phase of the installation process.
The database isn't automatically created during the installation of Cacti. Therefore, you need to create it here. At the same time, a database user for Cacti should be created to allow it to access the database. It's also a good idea to secure the MySQL database server by using one of the included CentOS tools.