Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Cacti 0.8 Beginner's Guide
Cacti 0.8 Beginner's Guide
Cacti 0.8 Beginner's Guide
Ebook909 pages8 hours

Cacti 0.8 Beginner's Guide

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Written for beginners to Cacti, this book contains step-by-step instructions and hands-on tutorials for network operators to learn how to implement and use the core Cacti functions. The book is designed in such a way that you can explore it chapter-by-chapter or skip any chapter without missing a beat. If you are a network operator and want to use Cacti for implementing performance measurement for trending, troubleshooting, and reporting purposes, then this book is for you. You only need to know the basics of network management and SNMP.
LanguageEnglish
Release dateMar 16, 2011
ISBN9781849513937
Cacti 0.8 Beginner's Guide
Author

Thomas Urban

Thomas Urban was a correspondent for the major German daily Süddeutsche Zeitung in Warsaw and Moscow from 1988 to 2012 and was an eyewitness to the great upheavals in Eastern Europe. He is the author of books on the history of this part of Europe, including the Berlin years of Russian-American novelist Vladimir Nabokov, on German and Polish footballers as objects of Nazi and Communist propaganda, and is the co-author of a biography on Pope John Paul II.

Related to Cacti 0.8 Beginner's Guide

Related ebooks

Information Technology For You

View More

Related articles

Reviews for Cacti 0.8 Beginner's Guide

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Cacti 0.8 Beginner's Guide - Thomas Urban

    Table of Contents

    Cacti 0.8Beginner's Guide

    Credits

    About the Author

    About the Reviewers

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    Why Subscribe?

    Free Access for Packt account holders

    Preface

    What is Cacti?

    System architecture of Cacti

    Cacti is more than performance measurement

    What this book covers

    What you need for this book

    Who this book is for

    Conventions

    Time for action – heading

    What just happened?

    Pop quiz – heading

    Have a go hero – heading

    Reader feedback

    Customer support

    Errata

    Piracy

    Questions

    1. Installing Cacti

    Preparing the system—basic prerequisites

    Web server

    PHP

    MySQL database

    NET-SNMP package

    Installing Cacti on a CentOS 5 system

    Preparing the system

    Time for action – installing the missing packages

    What just happened?

    Downloading and extracting Cacti

    Time for action – downloading Cacti

    What just happened?

    Creating the database

    Time for action – creating the database

    What just happened?

    Configuring Cacti

    Time for action – configuring Cacti

    What just happened?

    Creating the poller cron entry and Cacti's system user

    Time for action – creating the poller's cron entry and Cacti's system account

    What just happened?

    Installing the Spine poller

    Time for action – installing Spine

    What just happened?

    Differences between source and APT/Yum installations

    Have a go hero – remote server for database hosting

    Installing Cacti on a Windows system

    The community-built Windows Installer

    Time for action – starting the Windows setup

    What just happened?

    Installing the Spine poller under Windows

    Upgrading Cacti

    Time for action – upgrading Cacti

    What just happened?

    Using Cacti for the first time

    Time for action – configuring Cacti

    What just happened?

    The Cacti web interface explained

    The Console tab

    Create section

    Management section

    Collection methods section

    Templates section

    Import/export section

    Configuration section

    Utilities section

    The Graphs tab

    Before we continue

    Pop quiz – a few questions about Chapter 1

    Summary

    2. Using Graphs to Monitor Networks and Devices

    An introduction to Cacti graphs and the RRDtool

    Creating graphs with the RRDtool

    Basic RRDtool graph creation

    Advanced RRDtool graph creation

    Adding a label and title to the graph

    Adding a legend to the graph

    Adding a threshold line to the graph

    Adding threshold breaches to the graph

    Further reading

    Have a go hero – creating a yellow warning area

    Adding devices to Cacti

    Creating a device

    Time for action – creating a new device in Cacti

    What just happened?

    Selecting host templates for the device

    Time for action – adding a host template to the device

    What just happened?

    Adding graphs to the device

    Time for action – adding graphs to the device

    What just happened?

    Adding interface graphs to a device

    Time for action – adding interface graphs to a device

    What just happened?

    Adding devices to the Cacti tree

    Creating a tree

    Time for action – creating a Cacti tree

    What just happened?

    Sub-tree items

    Time for action – adding a sub-tree

    What just happened?

    Adding a device to the tree

    Time for action – adding a device to the Cacti tree

    What just happened?

    Before we continue

    Pop quiz – a few questions about Chapter 2

    Summary

    3. Creating and Using Templates

    An introduction to templates

    Data templates

    Data input methods

    Graph templates

    Host templates

    Data queries

    Defining a data template

    Time for action – defining a data template

    What just happened?

    Have a go hero – template for currently established TCP connections

    Defining a graph template

    CDEF definition

    Time for action – defining a CDEF in Cacti

    What just happened?

    Defining the graph template

    Time for action – defining the graph template

    What just happened?

    Adding the threshold line

    Time for action – defining a graph template

    What just happened?

    Adding the green, yellow, and red areas

    Time for action – adding the color areas

    What just happened?

    Adding a legend to the graph

    Time for action – adding a legend

    What just happened?

    Back to basics—rrdtool graph command

    Defining a host template

    Time for action – defining a host template

    What just happened?

    Assigning a host template to a device

    Importing/exporting templates

    Importing templates

    Time for action – importing a template

    What just happened?

    Exporting templates

    Time for action – exporting a template

    What just happened?

    The template repository

    Before we continue

    Pop quiz – a few questions about Chapter 3

    Summary

    4. User Management

    An introduction to Cacti user management

    Users

    Groups

    Permissions

    Creating a user

    Time for action – creating the first Cacti user

    What just happened?

    General user settings

    Graph Options

    Authentication Realm

    Realm and graph permissions

    Realm permissions

    Management permissions

    Collection methods permissions

    Template permissions

    Import/export permissions

    Configuration permissions

    Utilities permissions

    Time for action – setting realm permissions

    What just happened?

    Graph permissions

    Time for action – setting graph permissions

    What just happened?

    Graph settings

    The template user

    Time for action – installing the missing packages

    What just happened?

    Copying permissions – the Batch Copy mode

    Time for action – the Batch Copy

    What just happened?

    Integrate LDAP/Active Directory authentication

    External user management

    Time for action – setting up Active Directory authentication

    What just happened?

    Managing users with the Cacti CLI

    Importing a list of users

    Time for action – importing users from the CLI

    What just happened?

    Input validation

    Check the existence of the template user

    Reading the import file

    Before we continue

    Pop quiz – a few questions about Chapter 4

    Summary

    5. Data Management

    An introduction to Cacti data management

    Data input methods

    Data queries

    Creating data input methods

    Preparation—creating the script

    Gathering the data

    Preparing the data for output

    Installation of the script

    Time for action – creating a data input method – Step 1

    What just happened?

    Time for action – creating a data input method – Step 2

    What just happened?

    The data template

    Creating data queries

    Building the XML data file

    XML header

    XML input

    XML output

    Installing the XML file

    Creating the data query within Cacti

    Time for action – creating a data query – Step 1

    What just happened?

    Time for action – creating a data query – Step 2

    What just happened?

    Create a remote SSH data input method

    Preparation

    The remote script

    The local script

    Input variables

    The SSH command execution

    Preparing the data

    SSH public key authentication

    Time for action – create SSH keys with PuTTY Key Generator

    What just happened?

    Creating the data input method

    Time for action – creating the data input method

    What just happened?

    Creating the data template

    Creating the graph template

    Adding the graph to the device

    Alternative methods

    Have a go hero – remote command execution using SNMP

    Before we continue

    Pop quiz – a few questions about Chapter 5

    Summary

    6. Cacti Maintenance

    An introduction to Cacti maintenance

    Database

    RRD files

    The Cacti directory structure

    docs

    include

    install

    log

    resource

    rra

    scripts

    Backup and restore procedures

    The MySQL database

    Time for action – backup your Cacti database

    What just happened?

    Enhancing the database backup

    Automatic file naming

    Removing old backup files

    The database backup

    Compressing the backup

    The whole script

    The Cacti files

    Building the backup file list

    Time for action – backup your Cacti files

    What just happened?

    Enhancing the database backup script

    Time for action – enhancing the backup script

    What just happened?

    Creating the cronjob—automating the backup

    Time for action – creating a cronjob

    What just happened?

    Restoring from a backup

    Restoring the Cacti database

    Time for action – restoring the Cacti database

    What just happened?

    Restoring the Cacti files

    Restoring all Cacti files

    Time for action – restoring all Cacti files

    What just happened?

    Restoring a single file from the backup

    Time for action – restoring the Cacti config.php file

    What just happened?

    Log file management

    Time for action – configuring Logrotate

    What just happened?

    Cacti maintenance

    List RRD files with no associated host

    Time for action – finding orphaned RRD files

    What just happened?

    Automating the orphaned RRD file check

    A short overview of the Cacti CLI functionality

    Repairing templates

    Repairing the database

    Pop Quiz – a few questions about Chapter 6

    Summary

    7. Network and Server Monitoring

    An introduction to network and server monitoring

    Network devices

    VMware ESX

    Linux server

    Windows WMI monitoring

    Monitoring a network device

    Configuring SNMP access on a Cisco switch

    Time for action – set up SNMP on Cisco devices

    What just happened?

    Adding Cisco switch to Cacti

    Time for action – adding a Cisco switch to Cacti

    What just happened?

    Configuring SNMP access on a Cisco PIX firewall

    Time for action – set up SNMP access on Cisco PIX

    What just happened?

    Adding Cisco PIX Firewall to Cacti

    Time for action – adding a Cisco PIX Firewall to Cacti

    What just happened?

    Monitoring VMware ESX servers

    Set up SNMP access for VMware ESXi 4

    Time for action – set up SNMP access on an ESXi 4 server

    What just happened?

    Set up SNMP access to VMware ESX 3.5

    Time for action – set up SNMP access on an ESX 3.5 server

    What just happened?

    Adding VMware ESX servers to Cacti

    Time for action – adding a VMware ESX host to Cacti

    Windows monitoring

    Windows SNMP setup

    Time for action – enabling the SNMP server feature

    What just happened?

    Configuration of the Windows SNMP service

    Time for action – configuring the Windows SNMP service

    What just happened?

    WMI setup

    Time for action – setting up a Windows WMI user

    What just happened?

    Installing the CactiWMI add-on

    Installing the wmi.php Cacti interface

    Time for action – installing the CactiWMI add-on – Part 1

    What just happened?

    Installing the wmic command

    Time for action – installing the CactiWMI add-on – Part 2

    What just happened?

    Performance measurement with CactiWMI

    Time for action – performance measurement with CactiWMI

    What just happened?

    Pop quiz – a few questions about Chapter 7

    Summary

    8. Plugin Architecture

    Introduction to the Plugin Architecture

    Why plugins?

    Plugin features

    Common plugins

    MAC Track plugin

    Network WeatherMap

    Thold

    Installing the Plugin Architecture

    Time for action – installing the Plugin Architecture

    What just happened?

    Upgrading the Plugin Architecture

    Time for action – upgrading the Plugin Architecture

    What just happened?

    Configuring the Plugin Architecture

    Time for action – configuring the Plugin Architecture

    What just happened?

    Downloading and installing plugins

    PIA directory structure

    Pre-PIA 2.x plugins

    PIA 2.x plugins

    The plugin repository

    The settings plugin

    Time for action – installing the settings plugin

    What just happened?

    Removing a plugin

    Time for action – removing the settings plugin

    What just happened?

    Updating a plugin

    Adding plugin permissions

    Pop Quiz – a few questions about Chapter 8

    Summary

    9. Plugins

    Plugin design

    Plugin hooks

    Plugin settings

    The ntop_config_settings function

    Display plugin data within Cacti

    The ntop_show_tab function

    Commonly used plugins

    The settings plugin

    Functionality

    The superlinks plugin

    Functionality

    Installation

    Configuration and usage

    Time for action – adding an external page to Cacti

    What just happened?

    Creating a new plugin

    File structure

    Concept and design

    PIA hooks

    The tree_after hook

    The draw_navigation_text hook

    The config_arrays hook

    The config_settings hook

    The config_form hook

    The api_device_save hook

    The plugin setup

    The plugin_cbEnhancedInfo_install function

    Time for action – adding the realm permission functions

    What just happened?

    The cbEnhancedInfo_draw_navigation_text function

    The cbEnhancedInfo_config_form function

    The cbEnhancedInfo_api_device_save function

    The cbEnhancedInfo_setup_table_new function

    Time for action – adding additional fields to the host table

    What just happened?

    The cbEnhancedInfo_config_settings function

    The cbEnhancedInfo_config_arrays function

    Data presentation

    Retrieve data from the database

    Time for action – retrieve data from the database

    What just happened?

    Presenting data on the tree view page

    Time for action – presenting data on the tree view page

    What just happened?

    Creating the table list web page

    The action section

    Time for action – deleting data

    What just happened?

    The data retrieval section

    Time for action – sorting and retrieving data

    What just happened?

    The data presentation section

    Time for action – presenting the data

    What just happened?

    Creating the add items form

    The form_display function

    The data retrieval section

    The data presentation section

    The form_save function

    Time for action – retrieving data from the form post

    What just happened?

    Time for action – creating a new database item

    What just happened?

    Time for action – updating an existing item

    What just happened?

    Installing the plugin

    Publishing

    Pop Quiz – a few questions about Chapter 9

    Summary

    10. Threshold Monitoring with Thold

    Threshold monitoring

    Thold

    Installing Thold

    Downloading and installing Thold

    Time for action – installing Thold

    What just happened?

    Configuring Thold

    General options

    Default Alerting Options

    Default Emailing Options

    Default Baseline Options

    Using Thold

    Assigning permissions and setting up an e-mail address

    Time for action – give permission to a user

    What just happened?

    Creating a threshold

    Time for action – creating your first threshold – Part 1

    The threshold creation page

    Basic and mandatory settings section

    Threshold setup section

    Alert setup section

    What just happened?

    Time for action – creating your first threshold – Part 2

    What just happened?

    Testing the threshold

    Time for action – installing the stress tool

    Viewing threshold breaches

    Time for action – viewing breached thresholds

    What just happened?

    Creating threshold templates

    Time for action – creating your first threshold template

    What just happened?

    Assigning threshold templates

    Time for action – assigning a threshold template

    What just happened?

    Pop Quiz – A few questions about Chapter 10

    Summary

    11. Enterprise Reporting

    Overview of Nectar and CereusReporting

    Nectar

    CereusReporting

    Nectar

    Time for action – installing Nectar

    What just happened?

    Report generation

    Time for action – create your first Nectar report

    What just happened?

    Time for action – adding report items

    What just happened?

    CereusReporting

    Installation

    Time for action – installing CereusReporting

    What just happened?

    Plugin configuration

    Time for action – configure CereusReporting

    What just happened?

    Report generation

    On-demand report generation

    Time for action – creating an on-demand report

    What just happened?

    Pre-defined report generation

    Time for action – creating a pre-defined report

    What just happened?

    Scheduling a report

    Time for action – scheduling a pre-defined report

    What just happened?

    Report Backup and Restore

    Time for action – Backup and Restore a pre-defined report

    What just happened?

    Report scheduling and polling performance

    Time for action – setup of a cron-based report generation

    What just happened?

    Advanced reporting features of CereusReporting

    mPDF Report Engine

    DSSTATS Reports

    Availability reports

    Smokeping reports

    Mobile client support

    Report templates

    Pop Quiz – a few questions about Chapter 11

    Summary

    12. Cacti Automation for NOC

    Overview of Cacti automation

    The Cacti CLI

    Users

    Permissions

    Trees

    Devices

    Graphs

    Overview of Autom8

    Trees

    Graphs

    Using the Cacti CLI

    Adding permissions

    Time for action – adding permissions to a user

    What just happened?

    Adding a Cacti tree

    Time for action – adding a Cacti tree

    What just happened?

    Adding a device

    Time for action – adding a single device to Cacti

    What just happened?

    Importing a list of devices into Cacti

    Adding a graph to a device

    Autom8 – true Cacti automation

    Installation

    Time for action – installing the Autom8 plugin

    What just happened?

    Patching the Cacti files

    Time for action – patching the Cacti files

    What just happened?

    Autom8 rules

    Tree rules

    Time for action – adding a new Tree Rule

    What just happened?

    Time for action – applying an Autom8 rule to devices

    What just happened?

    Graph rules

    Time for action – adding a Graph Rule

    What just happened?

    Further information

    Pop Quiz – Let's test your knowledge about Chapter 12

    Summary

    A. Mobile Access / Administration

    Overview of mobile solutions for Cacti

    iCacti—the iPhone/iPad client

    BBCacti—the BlackBerry client

    nmidMobileClient—the Windows mobile client

    The mobile plugin—mobile enhanced Cacti web page

    The iPhone/iPad client

    Requirements

    Advantages

    Disadvantages

    Support

    BBCacti—the BlackBerry client

    Requirements

    Advantages

    Disadvantages

    The nmidWebService plugin

    Time for action – installing the WSO2 WebService framework

    What just happened?

    Installing the nmidWebService plugin

    Time for action – installing the nmidWebService plugin

    What just happened?

    BBCacti installation

    Time for action – installing the BBCacti client

    What just happened?

    BBCacti configuration

    Time for action – configuration of BBCacti

    What just happened?

    Time for action – using the BBCacti client

    What just happened?

    The mobile plugin

    Time for action – installing the mobile plugin

    What just happened?

    Summary

    B. Online Resources

    Cacti website

    Spine

    Plugin Architecture

    Cacti documentation

    Cacti forum

    Cacti bug reporting

    Cacti plugin hooks overview

    Cacti Users' site

    Howie's stuff

    RRDTool

    Tobi Oetiker

    RRDTool, Cacti, and time zones

    Xing German Cacti group

    LinkedIn Cacti Group

    NMID plugins and CereusReporting

    C. Further Information

    The Round Robin Database Tool

    The RRD file architecture

    SNMP: The Simple Network Management Protocol

    The Management Information Base

    SNMPv1

    Security

    SNMPv2 / SNMPv2c

    Security

    SNMPv3

    SNMP support in Cacti

    MRTG – Multi Router Traffic Grapher

    Where to get support?

    Cacti forums

    Mailing list

    Commercial support

    D. Pop Quiz Answers

    Index

    Cacti 0.8Beginner's Guide


    Cacti 0.8Beginner's Guide

    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 (<edmaclean@gmail.com>)

    Credits

    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

    About the Author

    Thomas Urban 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.

    About the Reviewers

    Michael Bouma 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

    Mark Cutting 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.

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    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

    Enjoying the preview?
    Page 1 of 1