Cacti 0.8 Beginner's Guide

Book description

Learn Cacti and design a robust Network Operations Center

  • A complete Cacti book that focuses on the basics as well as the advanced concepts you need to know for implementing a Network Operations Center
  • A step-by-step Beginner's Guide with detailed instructions on how to create and implement custom plugins
  • Real-world examples, which you can explore and make modifications to as you go
  • Written by Thomas Urban - creator of the "Network Management Inventory Database" plugins for Cacti

In Detail

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.

A comprehensive guide to learning Cacti and using it to implement performance measurement and reporting within a Network Operations Center

Table of contents

  1. Cacti 0.8Beginner's Guide
    1. Table of Contents
    2. Cacti 0.8Beginner's Guide
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What is Cacti?
        1. System architecture of Cacti
        2. Cacti is more than performance measurement
      2. What this book covers
      3. What you need for this book
      4. Who this book is for
      5. Conventions
      6. Time for action – heading
        1. What just happened?
        2. Pop quiz – heading
        3. Have a go hero – heading
      7. Reader feedback
      8. Customer support
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Installing Cacti
      1. Preparing the system—basic prerequisites
        1. Web server
        2. PHP
        3. MySQL database
        4. NET-SNMP package
      2. Installing Cacti on a CentOS 5 system
        1. Preparing the system
      3. Time for action – installing the missing packages
        1. What just happened?
        2. Downloading and extracting Cacti
      4. Time for action – downloading Cacti
        1. What just happened?
        2. Creating the database
      5. Time for action – creating the database
        1. What just happened?
        2. Configuring Cacti
      6. Time for action – configuring Cacti
        1. What just happened?
        2. Creating the poller cron entry and Cacti's system user
      7. Time for action – creating the poller's cron entry and Cacti's system account
        1. What just happened?
        2. Installing the Spine poller
      8. Time for action – installing Spine
        1. What just happened?
        2. Differences between source and APT/Yum installations
        3. Have a go hero – remote server for database hosting
      9. Installing Cacti on a Windows system
        1. The community-built Windows Installer
      10. Time for action – starting the Windows setup
        1. What just happened?
        2. Installing the Spine poller under Windows
      11. Upgrading Cacti
      12. Time for action – upgrading Cacti
        1. What just happened?
      13. Using Cacti for the first time
      14. Time for action – configuring Cacti
        1. What just happened?
      15. The Cacti web interface explained
        1. The Console tab
          1. Create section
          2. Management section
          3. Collection methods section
          4. Templates section
          5. Import/export section
          6. Configuration section
          7. Utilities section
        2. The Graphs tab
      16. Before we continue
        1. Pop quiz – a few questions about Chapter 1
      17. Summary
    9. 2. Using Graphs to Monitor Networks and Devices
      1. An introduction to Cacti graphs and the RRDtool
        1. Creating graphs with the RRDtool
          1. Basic RRDtool graph creation
          2. Advanced RRDtool graph creation
            1. Adding a label and title to the graph
            2. Adding a legend to the graph
            3. Adding a threshold line to the graph
            4. Adding threshold breaches to the graph
        2. Further reading
        3. Have a go hero – creating a yellow warning area
      2. Adding devices to Cacti
        1. Creating a device
      3. Time for action – creating a new device in Cacti
        1. What just happened?
        2. Selecting host templates for the device
      4. Time for action – adding a host template to the device
        1. What just happened?
        2. Adding graphs to the device
      5. Time for action – adding graphs to the device
        1. What just happened?
        2. Adding interface graphs to a device
      6. Time for action – adding interface graphs to a device
        1. What just happened?
      7. Adding devices to the Cacti tree
        1. Creating a tree
      8. Time for action – creating a Cacti tree
        1. What just happened?
        2. Sub-tree items
      9. Time for action – adding a sub-tree
        1. What just happened?
        2. Adding a device to the tree
      10. Time for action – adding a device to the Cacti tree
        1. What just happened?
      11. Before we continue
        1. Pop quiz – a few questions about Chapter 2
      12. Summary
    10. 3. Creating and Using Templates
      1. An introduction to templates
        1. Data templates
          1. Data input methods
        2. Graph templates
        3. Host templates
          1. Data queries
      2. Defining a data template
      3. Time for action – defining a data template
        1. What just happened?
        2. Have a go hero – template for currently established TCP connections
      4. Defining a graph template
        1. CDEF definition
      5. Time for action – defining a CDEF in Cacti
        1. What just happened?
        2. Defining the graph template
      6. Time for action – defining the graph template
        1. What just happened?
        2. Adding the threshold line
      7. Time for action – defining a graph template
        1. What just happened?
        2. Adding the green, yellow, and red areas
      8. Time for action – adding the color areas
        1. What just happened?
        2. Adding a legend to the graph
      9. Time for action – adding a legend
        1. What just happened?
        2. Back to basics—rrdtool graph command
      10. Defining a host template
      11. Time for action – defining a host template
        1. What just happened?
        2. Assigning a host template to a device
      12. Importing/exporting templates
        1. Importing templates
      13. Time for action – importing a template
        1. What just happened?
        2. Exporting templates
      14. Time for action – exporting a template
        1. What just happened?
      15. The template repository
      16. Before we continue
        1. Pop quiz – a few questions about Chapter 3
      17. Summary
    11. 4. User Management
      1. An introduction to Cacti user management
        1. Users
        2. Groups
        3. Permissions
      2. Creating a user
      3. Time for action – creating the first Cacti user
        1. What just happened?
      4. General user settings
        1. Graph Options
        2. Authentication Realm
      5. Realm and graph permissions
        1. Realm permissions
          1. Management permissions
          2. Collection methods permissions
          3. Template permissions
          4. Import/export permissions
          5. Configuration permissions
          6. Utilities permissions
      6. Time for action – setting realm permissions
        1. What just happened?
        2. Graph permissions
      7. Time for action – setting graph permissions
        1. What just happened?
        2. Graph settings
      8. The template user
      9. Time for action – installing the missing packages
        1. What just happened?
        2. Copying permissions – the Batch Copy mode
      10. Time for action – the Batch Copy
        1. What just happened?
      11. Integrate LDAP/Active Directory authentication
        1. External user management
      12. Time for action – setting up Active Directory authentication
        1. What just happened?
      13. Managing users with the Cacti CLI
        1. Importing a list of users
      14. Time for action – importing users from the CLI
        1. What just happened?
          1. Input validation
          2. Check the existence of the template user
          3. Reading the import file
      15. Before we continue
        1. Pop quiz – a few questions about Chapter 4
      16. Summary
    12. 5. Data Management
      1. An introduction to Cacti data management
        1. Data input methods
        2. Data queries
      2. Creating data input methods
        1. Preparation—creating the script
          1. Gathering the data
          2. Preparing the data for output
          3. Installation of the script
      3. Time for action – creating a data input method – Step 1
        1. What just happened?
      4. Time for action – creating a data input method – Step 2
        1. What just happened?
        2. The data template
      5. Creating data queries
        1. Building the XML data file
          1. XML header
          2. XML input
          3. XML output
          4. Installing the XML file
        2. Creating the data query within Cacti
      6. Time for action – creating a data query – Step 1
        1. What just happened?
      7. Time for action – creating a data query – Step 2
        1. What just happened?
      8. Create a remote SSH data input method
        1. Preparation
          1. The remote script
          2. The local script
            1. Input variables
            2. The SSH command execution
            3. Preparing the data
          3. SSH public key authentication
      9. Time for action – create SSH keys with PuTTY Key Generator
        1. What just happened?
        2. Creating the data input method
      10. Time for action – creating the data input method
        1. What just happened?
        2. Creating the data template
        3. Creating the graph template
        4. Adding the graph to the device
        5. Alternative methods
        6. Have a go hero – remote command execution using SNMP
      11. Before we continue
        1. Pop quiz – a few questions about Chapter 5
      12. Summary
    13. 6. Cacti Maintenance
      1. An introduction to Cacti maintenance
        1. Database
        2. RRD files
      2. The Cacti directory structure
        1. docs
        2. include
        3. install
        4. log
        5. resource
        6. rra
        7. scripts
      3. Backup and restore procedures
        1. The MySQL database
      4. Time for action – backup your Cacti database
        1. What just happened?
        2. Enhancing the database backup
          1. Automatic file naming
          2. Removing old backup files
          3. The database backup
          4. Compressing the backup
          5. The whole script
        3. The Cacti files
          1. Building the backup file list
      5. Time for action – backup your Cacti files
        1. What just happened?
        2. Enhancing the database backup script
      6. Time for action – enhancing the backup script
        1. What just happened?
        2. Creating the cronjob—automating the backup
      7. Time for action – creating a cronjob
        1. What just happened?
        2. Restoring from a backup
          1. Restoring the Cacti database
      8. Time for action – restoring the Cacti database
        1. What just happened?
          1. Restoring the Cacti files
            1. Restoring all Cacti files
      9. Time for action – restoring all Cacti files
        1. What just happened?
          1. Restoring a single file from the backup
      10. Time for action – restoring the Cacti config.php file
        1. What just happened?
      11. Log file management
      12. Time for action – configuring Logrotate
        1. What just happened?
      13. Cacti maintenance
        1. List RRD files with no associated host
      14. Time for action – finding orphaned RRD files
        1. What just happened?
          1. Automating the orphaned RRD file check
      15. A short overview of the Cacti CLI functionality
        1. Repairing templates
        2. Repairing the database
        3. Pop Quiz – a few questions about Chapter 6
      16. Summary
    14. 7. Network and Server Monitoring
      1. An introduction to network and server monitoring
        1. Network devices
        2. VMware ESX
        3. Linux server
        4. Windows WMI monitoring
      2. Monitoring a network device
        1. Configuring SNMP access on a Cisco switch
      3. Time for action – set up SNMP on Cisco devices
        1. What just happened?
        2. Adding Cisco switch to Cacti
      4. Time for action – adding a Cisco switch to Cacti
        1. What just happened?
        2. Configuring SNMP access on a Cisco PIX firewall
      5. Time for action – set up SNMP access on Cisco PIX
        1. What just happened?
        2. Adding Cisco PIX Firewall to Cacti
      6. Time for action – adding a Cisco PIX Firewall to Cacti
        1. What just happened?
      7. Monitoring VMware ESX servers
        1. Set up SNMP access for VMware ESXi 4
      8. Time for action – set up SNMP access on an ESXi 4 server
        1. What just happened?
        2. Set up SNMP access to VMware ESX 3.5
      9. Time for action – set up SNMP access on an ESX 3.5 server
        1. What just happened?
        2. Adding VMware ESX servers to Cacti
      10. Time for action – adding a VMware ESX host to Cacti
      11. Windows monitoring
        1. Windows SNMP setup
      12. Time for action – enabling the SNMP server feature
        1. What just happened?
          1. Configuration of the Windows SNMP service
      13. Time for action – configuring the Windows SNMP service
        1. What just happened?
        2. WMI setup
      14. Time for action – setting up a Windows WMI user
        1. What just happened?
        2. Installing the CactiWMI add-on
          1. Installing the wmi.php Cacti interface
      15. Time for action – installing the CactiWMI add-on – Part 1
        1. What just happened?
          1. Installing the wmic command
      16. Time for action – installing the CactiWMI add-on – Part 2
        1. What just happened?
        2. Performance measurement with CactiWMI
      17. Time for action – performance measurement with CactiWMI
        1. What just happened?
        2. Pop quiz – a few questions about Chapter 7
      18. Summary
    15. 8. Plugin Architecture
      1. Introduction to the Plugin Architecture
        1. Why plugins?
        2. Plugin features
        3. Common plugins
          1. MAC Track plugin
          2. Network WeatherMap
          3. Thold
      2. Installing the Plugin Architecture
      3. Time for action – installing the Plugin Architecture
        1. What just happened?
      4. Upgrading the Plugin Architecture
      5. Time for action – upgrading the Plugin Architecture
        1. What just happened?
      6. Configuring the Plugin Architecture
      7. Time for action – configuring the Plugin Architecture
        1. What just happened?
      8. Downloading and installing plugins
        1. PIA directory structure
        2. Pre-PIA 2.x plugins
        3. PIA 2.x plugins
        4. The plugin repository
          1. The settings plugin
      9. Time for action – installing the settings plugin
        1. What just happened?
        2. Removing a plugin
      10. Time for action – removing the settings plugin
        1. What just happened?
      11. Updating a plugin
      12. Adding plugin permissions
        1. Pop Quiz – a few questions about Chapter 8
      13. Summary
    16. 9. Plugins
      1. Plugin design
        1. Plugin hooks
        2. Plugin settings
          1. The ntop_config_settings function
        3. Display plugin data within Cacti
          1. The ntop_show_tab function
      2. Commonly used plugins
        1. The settings plugin
          1. Functionality
        2. The superlinks plugin
          1. Functionality
          2. Installation
          3. Configuration and usage
      3. Time for action – adding an external page to Cacti
        1. What just happened?
      4. Creating a new plugin
        1. File structure
        2. Concept and design
          1. PIA hooks
            1. The tree_after hook
            2. The draw_navigation_text hook
            3. The config_arrays hook
            4. The config_settings hook
            5. The config_form hook
            6. The api_device_save hook
        3. The plugin setup
          1. The plugin_cbEnhancedInfo_install function
      5. Time for action – adding the realm permission functions
        1. What just happened?
          1. The cbEnhancedInfo_draw_navigation_text function
          2. The cbEnhancedInfo_config_form function
          3. The cbEnhancedInfo_api_device_save function
          4. The cbEnhancedInfo_setup_table_new function
      6. Time for action – adding additional fields to the host table
        1. What just happened?
          1. The cbEnhancedInfo_config_settings function
          2. The cbEnhancedInfo_config_arrays function
        2. Data presentation
          1. Retrieve data from the database
      7. Time for action – retrieve data from the database
        1. What just happened?
          1. Presenting data on the tree view page
      8. Time for action – presenting data on the tree view page
        1. What just happened?
        2. Creating the table list web page
          1. The action section
      9. Time for action – deleting data
        1. What just happened?
          1. The data retrieval section
      10. Time for action – sorting and retrieving data
        1. What just happened?
      11. The data presentation section
      12. Time for action – presenting the data
        1. What just happened?
        2. Creating the add items form
          1. The form_display function
            1. The data retrieval section
            2. The data presentation section
          2. The form_save function
      13. Time for action – retrieving data from the form post
        1. What just happened?
      14. Time for action – creating a new database item
        1. What just happened?
      15. Time for action – updating an existing item
        1. What just happened?
        2. Installing the plugin
        3. Publishing
        4. Pop Quiz – a few questions about Chapter 9
      16. Summary
    17. 10. Threshold Monitoring with Thold
      1. Threshold monitoring
        1. Thold
      2. Installing Thold
        1. Downloading and installing Thold
      3. Time for action – installing Thold
        1. What just happened?
      4. Configuring Thold
        1. General options
        2. Default Alerting Options
        3. Default Emailing Options
        4. Default Baseline Options
      5. Using Thold
        1. Assigning permissions and setting up an e-mail address
      6. Time for action – give permission to a user
        1. What just happened?
        2. Creating a threshold
      7. Time for action – creating your first threshold – Part 1
        1. The threshold creation page
          1. Basic and mandatory settings section
          2. Threshold setup section
          3. Alert setup section
        2. What just happened?
      8. Time for action – creating your first threshold – Part 2
        1. What just happened?
          1. Testing the threshold
      9. Time for action – installing the stress tool
        1. Viewing threshold breaches
      10. Time for action – viewing breached thresholds
        1. What just happened?
        2. Creating threshold templates
      11. Time for action – creating your first threshold template
        1. What just happened?
        2. Assigning threshold templates
      12. Time for action – assigning a threshold template
        1. What just happened?
        2. Pop Quiz – A few questions about Chapter 10
      13. Summary
    18. 11. Enterprise Reporting
      1. Overview of Nectar and CereusReporting
        1. Nectar
        2. CereusReporting
      2. Nectar
      3. Time for action – installing Nectar
        1. What just happened?
        2. Report generation
      4. Time for action – create your first Nectar report
        1. What just happened?
      5. Time for action – adding report items
        1. What just happened?
      6. CereusReporting
        1. Installation
      7. Time for action – installing CereusReporting
        1. What just happened?
        2. Plugin configuration
      8. Time for action – configure CereusReporting
        1. What just happened?
        2. Report generation
          1. On-demand report generation
      9. Time for action – creating an on-demand report
        1. What just happened?
          1. Pre-defined report generation
      10. Time for action – creating a pre-defined report
        1. What just happened?
        2. Scheduling a report
      11. Time for action – scheduling a pre-defined report
        1. What just happened?
        2. Report Backup and Restore
      12. Time for action – Backup and Restore a pre-defined report
        1. What just happened?
      13. Report scheduling and polling performance
      14. Time for action – setup of a cron-based report generation
        1. What just happened?
      15. Advanced reporting features of CereusReporting
        1. mPDF Report Engine
        2. DSSTATS Reports
        3. Availability reports
        4. Smokeping reports
        5. Mobile client support
        6. Report templates
        7. Pop Quiz – a few questions about Chapter 11
      16. Summary
    19. 12. Cacti Automation for NOC
      1. Overview of Cacti automation
        1. The Cacti CLI
          1. Users
          2. Permissions
          3. Trees
          4. Devices
          5. Graphs
        2. Overview of Autom8
          1. Trees
          2. Graphs
      2. Using the Cacti CLI
        1. Adding permissions
      3. Time for action – adding permissions to a user
        1. What just happened?
        2. Adding a Cacti tree
      4. Time for action – adding a Cacti tree
        1. What just happened?
        2. Adding a device
      5. Time for action – adding a single device to Cacti
        1. What just happened?
        2. Importing a list of devices into Cacti
        3. Adding a graph to a device
      6. Autom8 – true Cacti automation
        1. Installation
      7. Time for action – installing the Autom8 plugin
        1. What just happened?
        2. Patching the Cacti files
      8. Time for action – patching the Cacti files
        1. What just happened?
        2. Autom8 rules
          1. Tree rules
      9. Time for action – adding a new Tree Rule
        1. What just happened?
      10. Time for action – applying an Autom8 rule to devices
        1. What just happened?
          1. Graph rules
      11. Time for action – adding a Graph Rule
        1. What just happened?
          1. Further information
        2. Pop Quiz – Let's test your knowledge about Chapter 12
      12. Summary
    20. A. Mobile Access / Administration
      1. Overview of mobile solutions for Cacti
        1. iCacti—the iPhone/iPad client
        2. BBCacti—the BlackBerry client
        3. nmidMobileClient—the Windows mobile client
        4. The mobile plugin—mobile enhanced Cacti web page
      2. The iPhone/iPad client
        1. Requirements
        2. Advantages
        3. Disadvantages
        4. Support
      3. BBCacti—the BlackBerry client
        1. Requirements
        2. Advantages
        3. Disadvantages
      4. The nmidWebService plugin
      5. Time for action – installing the WSO2 WebService framework
        1. What just happened?
        2. Installing the nmidWebService plugin
      6. Time for action – installing the nmidWebService plugin
        1. What just happened?
        2. BBCacti installation
      7. Time for action – installing the BBCacti client
        1. What just happened?
        2. BBCacti configuration
      8. Time for action – configuration of BBCacti
        1. What just happened?
      9. Time for action – using the BBCacti client
        1. What just happened?
      10. The mobile plugin
      11. Time for action – installing the mobile plugin
        1. What just happened?
      12. Summary
    21. B. Online Resources
      1. Cacti website
      2. Spine
      3. Plugin Architecture
      4. Cacti documentation
      5. Cacti forum
      6. Cacti bug reporting
      7. Cacti plugin hooks overview
      8. Cacti Users' site
      9. Howie's stuff
      10. RRDTool
      11. Tobi Oetiker
      12. RRDTool, Cacti, and time zones
      13. Xing German Cacti group
      14. LinkedIn Cacti Group
      15. NMID plugins and CereusReporting
    22. C. Further Information
      1. The Round Robin Database Tool
        1. The RRD file architecture
      2. SNMP: The Simple Network Management Protocol
        1. The Management Information Base
        2. SNMPv1
          1. Security
        3. SNMPv2 / SNMPv2c
          1. Security
        4. SNMPv3
        5. SNMP support in Cacti
      3. MRTG – Multi Router Traffic Grapher
      4. Where to get support?
        1. Cacti forums
        2. Mailing list
        3. Commercial support
    23. D. Pop Quiz Answers
    24. Index

Product information

  • Title: Cacti 0.8 Beginner's Guide
  • Author(s): Thomas Urban
  • Release date: March 2011
  • Publisher(s): Packt Publishing
  • ISBN: 9781849513920