You are previewing Zabbix Network Monitoring - Second Edition.
O'Reilly logo
Zabbix Network Monitoring - Second Edition

Book Description

Gather detailed statistics and data while monitoring the performance and availability of network devices and applications using the all-new Zabbix 3.0

About This Book

  • Monitor your network and deploy impressive business solutions with Zabbix 3.0

  • Manage hosts and system maintenance to keep your network performing for the people who use it

  • A step-by-step guide to smarter network monitoring

  • Who This Book Is For

    If you're new to Zabbix look no further than this book. It will show you how to put your sysadmin knowledge to work with Zabbix 3.0 so you can experience the full impact of this useful and increasingly popular tool.

    What You Will Learn

  • Get to grips with the fundamentals of Zabbix

  • Find out how Zabbix's features let you monitor your network with confidence and precision

  • Learn how to monitor SNMP devices

  • Manage hosts, users, and permissions while acting upon monitored conditions

  • Visualize data with the help of ad-hoc graphs, custom graphs, maps, and reports

  • Simplify complex configurations and learn to automate them

  • Monitor everything from web pages to IPMI devices and Java applications to and VMware stats

  • Troubleshoot any network issue - fast

  • In Detail

    This book is a perfect starting point for monitoring with Zabbix. Even if you have never used a monitoring solution before, this book will get you up and running quickly, before guiding you into more sophisticated operations with ease. You'll soon feel in complete control of your network, ready to meet any challenges you might face.

    Beginning with installation, you'll learn the basics of data collection before diving deeper to get to grips with native Zabbix agents and SNMP devices. You will also explore Zabbix's integrated functionality for monitoring Java application servers and VMware. Beyond this, Zabbix Network Monitoring also covers notifications, permission management, system maintenance, and troubleshooting - so you can be confident that every potential challenge and task is under your control. If you're working with larger environments, you'll also be able to find out more about distributed data collection using Zabbix proxies.

    Once you're confident and ready to put these concepts into practice, you'll find out how to optimize and improve performance. Troubleshooting network issues is vital for anyone working with Zabbix, so the book is also on hand to help you work through any technical snags and glitches you might face. Network monitoring doesn't have to be a chore - learn the tricks of the Zabbix trade and make sure you're network is performing for everyone who depends upon it.

    Style and approach

    This book is a detailed and practical guide that starts from the fundamentals of Zabbix and takes you all the way to building a network monitoring solution that is capable of gathering data from range of different systems. With tips on low-level details that will boost any Zabbix users confidence and fluency, it's an unmissable resource for anyone interested in what's possible with Zabbix.

    Downloading the example code for this 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 code file.

    Table of Contents

    1. Zabbix Network Monitoring Second Edition
      1. Table of Contents
      2. Zabbix Network Monitoring Second Edition
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
      7. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
      8. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      9. 1. Getting Started with Zabbix
        1. The first steps in monitoring
        2. Zabbix features and architecture
        3. Installation
          1. Choosing the version and repository
          2. Hardware requirements
          3. Installing from the packages
            1. RHEL/CentOS
              1. EPEL
              2. The Zabbix repository
            2. OpenSUSE
          4. Installing from source
            1. The server and agent
              1. Software requirements
            2. Downloading the source
            3. Compilation
          5. Dash or underscore?
          6. Initial configuration
          7. Creating and populating the database
          8. Starting up
            1. Using systemd
            2. Verifying the service's state
          9. The web frontend
            1. Prerequisites and setting up the environment
          10. Using the web frontend configuration wizard
            1. Step 1 – welcome
            2. Step 2 – PHP prerequisites
            3. Step 3 – database access
            4. Step 4 – Zabbix server details
            5. Step 5 – summary
            6. Step 6 – writing the configuration file
            7. Step 7 – finishing the wizard
            8. Step 8 – logging in
        4. Summary
      10. 2. Getting Your First Notification
        1. Exploring the frontend
          1. The user profile
        2. Monitoring quickstart
          1. Creating a host
          2. Creating an item
          3. Introducing simple graphs
          4. Creating triggers
          5. Configuring e-mail parameters
          6. Creating an action
        3. Information flow in Zabbix
        4. Let's create some load
        5. Basic item configuration
          1. Monitoring categories
            1. Availability
            2. Performance
            3. Security
            4. Management
            5. Efficiency
          2. Item types
          3. How items can be monitored
        6. Using global search
        7. Summary
      11. 3. Monitoring with Zabbix Agents and Basic Protocols
        1. Using the Zabbix agent
          1. Passive items
            1. Cloning items
            2. Manually querying items
          2. Active items
          3. An active agent with multiple servers
          4. Supported items
          5. Choosing between active and passive items
            1. Item scheduling
        2. Simple checks
          1. Setting up ICMP checks
        3. Tying it all together
          1. Key parameter quoting
          2. Positional parameters for item names
          3. Using mass update
          4. Value mapping
          5. Units
          6. Custom intervals
            1. Flexible intervals
            2. Custom scheduling
          7. Copying items
        4. Summary
      12. 4. Monitoring SNMP Devices
        1. Using Net-SNMP
          1. Using SNMPv3 with Net-SNMP
            1. The engine ID
              1. Authentication, encryption, and context
        2. Adding new MIBs
        3. Polling SNMP items in Zabbix
          1. Translating SNMP OIDs
          2. Dynamic indexes
          3. SNMP bulk requests
        4. Receiving SNMP traps
          1. Using embedded Perl code
            1. Filtering values by received data
            2. Filtering values by originating host
            3. Debugging
            4. Handling the temporary file
            5. SNMP Trap Translator
          2. Using a custom script
            1. Filtering the traps
            2. Custom mapping
            3. Database lookups
        5. Summary
      13. 5. Managing Hosts, Users, and Permissions
        1. Hosts and host groups
          1. Host inventory
            1. Editing inventory data manually
            2. Populating inventory data automatically
          2. Host maintenance
            1. Creating maintenance periods
              1. Collecting data during maintenance
              2. Not collecting data during maintenance
            2. Maintenance period options
              1. One-time only maintenance
              2. Daily maintenance
              3. Weekly maintenance
              4. Monthly maintenance
            3. Ad-hoc maintenance
        2. Users, user groups, and permissions
          1. Authentication methods
          2. Creating a user
          3. Creating user groups
          4. Permissions and maintenance
        3. Summary
      14. 6. Detecting Problems with Triggers
        1. Triggers
          1. The trigger-and-item relationship
          2. Trigger dependencies
          3. Constructing trigger expressions
            1. Preventing trigger flapping
            2. Checking for missing data
            3. Triggers that time out
            4. Triggers with adaptable thresholds
            5. Triggers with a limited period
            6. Relative thresholds or time shift
            7. Verifying system time
            8. Human-readable constants
            9. Customizing trigger display
              1. Trigger severities
              2. Trigger display options
          4. Event details
          5. Event generation and hysteresis
        2. Summary
      15. 7. Acting upon Monitored Conditions
        1. Actions
          1. Limiting conditions when alerts are sent
            1. Additional action conditions
              1. Complex conditions
            2. Dependencies and actions
            3. Media limits for users
          2. Sending out notifications
            1. Using macros
            2. Sending recovery messages
          3. Escalating things
            1. Runner analogy
          4. Using scripts as media
          5. Integration with issue management systems
            1. Bugzilla
            2. Computer Associates Unicenter Service Desk Manager
            3. Atlassian JIRA
          6. Remote commands
        2. Global scripts
          1. Configuring global scripts
          2. Reusing global scripts in actions
        3. Summary
      16. 8. Simplifying Complex Configurations with Templates
        1. Identifying template candidates
        2. Creating a template
        3. Linking templates to hosts
          1. Handling default templates
          2. Changing the configuration in a template
          3. Macro usage
            1. User macros
        4. Using multiple templates
          1. Unlinking templates from hosts
        5. Using mass update
        6. Nested templates
        7. Summary
      17. 9. Visualizing Data with Graphs and Maps
        1. Visualize what?
        2. Individual elements
          1. Graphs
            1. Simple graphs
            2. Ad hoc graphs
            3. Custom graphs
              1. Working time and trigger line
              2. Graph item function
              3. Two y axes
              4. Item sort order
              5. Gradient line and other draw styles
              6. Custom y axis scale
              7. Percentile line
              8. Stacked graphs
              9. Pie graphs
          2. Maps
            1. Creating a map
            2. Linking map elements
              1. Selecting links
              2. Routed and invisible links
            3. Further map customization
              1. Macros in labels
              2. Link labels
              3. Reflecting problems on map elements
              4. Available map elements
              5. Map filtering
              6. Custom icons and background images
              7. Icon mapping
              8. Other global map options
              9. Displaying host group elements
              10. Numbers as icons
            4. Sharing the maps
        3. Summary
      18. 10. Visualizing Data with Screens and Slideshows
        1. Screens
          1. Dynamic screens
          2. Additional screen elements
          3. Templated screens
        2. Slide shows
        3. Showing data on a big display
          1. Challenges
            1. Non-interactive display
            2. Information overload
            3. Displaying a specific section automatically
        4. Summary
      19. 11. Advanced Item Monitoring
        1. Log file monitoring
          1. Monitoring a single file
          2. Filtering for specific strings
          3. Monitoring rotated files
          4. Alerting on log data
          5. Extracting part of the line
          6. Parsing timestamps
          7. Viewing log data
        2. Reusing data on the server
          1. Calculated items
            1. Quoting in calculated items
            2. Referencing items from multiple hosts
          2. Aggregate items
            1. Aggregating across multiple groups
        3. User parameters
          1. Just getting it to work
          2. Querying data that the Zabbix agent does not support
          3. Flexible user parameters
          4. Level of the details monitored
          5. Environment trap
          6. Things to remember about user parameters
            1. Wrapper scripts
          7. When not to use user parameters
        4. External checks
          1. Finding a certificate expiry time
          2. Determining certificate validity
        5. Sending in the data
          1. Using an agent daemon configuration file
          2. Sending values from a file
          3. Sending timestamped values
        6. SSH and Telnet items
          1. SSH items
          2. Telnet items
        7. Custom modules
        8. Summary
      20. 12. Automating Configuration
        1. Low-level discovery
          1. Network interface discovery
            1. Automatically creating calculated items
            2. Automatically creating triggers
            3. Automatically creating graphs
            4. Filtering discovery results
          2. Filesystem discovery
            1. Introducing the LLD JSON format
            2. Including discovered graphs in screens
            3. Custom thresholds with user macro context
          3. CPU discovery
          4. SNMP discovery
          5. Creating custom LLD rules
            1. Re-implementing CPU discovery
            2. Discovering MySQL databases
        2. Global regular expressions
          1. Testing global regexps
          2. Usage in the default templates
        3. Network discovery
          1. Configuring a discovery rule
          2. Viewing the results
          3. Reacting to the discovery results
          4. Uniqueness criteria
        4. Active agent autoregistration
          1. Auto-registration metadata
        5. Summary
      21. 13. Monitoring Web Pages
        1. Monitoring a simple web page
          1. Creating a web-monitoring scenario
          2. Other scenarios and step properties
          3. Alerting on web scenarios
        2. Logging in to the Zabbix interface
          1. Step 1: check the first page
          2. Step 2: log in
          3. Step 3: check login
          4. Step 4: log out
          5. Step 5: check logout
        3. Authentication options
        4. Using agent items
          1. Getting the page
          2. Checking page performance
          3. Extracting content from web pages
        5. Summary
      22. 14. Monitoring Windows
        1. Installing the Zabbix agent for Windows
        2. Querying performance counters
          1. Using numeric references to performance counters
          2. Using aliases for performance counters
          3. Averaging performance counters over time
        3. Querying WMI
        4. Monitoring Windows services
          1. Checking automatic services
          2. Service discovery
        5. Windows event log monitoring
        6. Summary
      23. 15. High-Level Business Service Monitoring
        1. Deciding on the service tree
        2. Setting up IT services
          1. Creating test items and triggers
          2. Configuring IT services
          3. Sending in the data
        3. Viewing reports
        4. Specifying uptime and downtime
        5. Summary
      24. 16. Monitoring IPMI Devices
        1. Getting an IPMI device
        2. Preparing for IPMI monitoring
        3. Setting up IPMI items
          1. Creating an IPMI item
        4. Monitoring discrete sensors
          1. Using the bitwise trigger function
        5. Summary
      25. 17. Monitoring Java Applications
        1. Setting up the Zabbix Java gateway
        2. Monitoring JMX items
          1. Querying JMX items manually
          2. What to monitor?
        3. Summary
      26. 18. Monitoring VMware
        1. Preparing for VMware monitoring
        2. Automatic discovery
        3. Available metrics
        4. The underlying operation
          1. VMware LLD configuration
            1. Host prototypes
            2. Summarizing default template interaction
            3. Server operation and configuration details
        5. Summary
      27. 19. Using Proxies to Monitor Remote Locations
        1. Active proxy, passive proxy
        2. Setting up an active proxy
          1. Monitoring a host through a proxy
        3. Proxy benefits
        4. Proxy limitations
          1. Proxy operation
        5. Proxies and availability monitoring
          1. Method 1 – Last access item
          2. Method 2 – Internal proxy buffer item
          3. Method 3 – Custom proxy buffer item
        6. Setting up a passive proxy
        7. Tweaking the proxy configuration
        8. Summary
      28. 20. Encrypting Zabbix Traffic
        1. Overview
          1. Backend libraries
        2. Pre-shared key encryption
        3. Certificate-based encryption
          1. Being our own authority
          2. Setting up Zabbix with certificates
        4. Concerns and further reading
        5. Summary
      29. 21. Working Closely with Data
        1. Getting raw data
          1. Extracting from the frontend
          2. Querying the database
            1. Using data in a remote site
        2. Diving further into the database
          1. Managing users
          2. Changing existing data
            1. Finding out when
            2. The when in computer language
            3. Finding out what
            4. Performing the change
        3. Using XML import/export for configuration
          1. Exporting the initial configuration
          2. Modifying the configuration
            1. The XML export format
            2. Scripting around the export
          3. Importing modified configuration
          4. Generating hosts
          5. Importing images
        4. Starting with the Zabbix API
          1. Simple operations
            1. Obtaining the API version
            2. Logging in
            3. Enabling and disabling hosts
            4. Creating a host
            5. Deleting a host
            6. Creating a value map
            7. Obtaining history and trends
          2. Issues with the Zabbix API
          3. Using API libraries
          4. Further reading
        5. Summary
      30. 22. Zabbix Maintenance
        1. Internal monitoring
          1. New values per second
          2. Zabbix server uptime
          3. Cache usage
          4. Internal process busy rate
          5. Unsupported items and more problems
            1. Counting unsupported items
            2. Reviewing unsupported items
            3. Internal events and unknown triggers
        2. Backing things up
          1. Backing up the database
          2. Restoring from a backup
          3. Separating configuration and data backups
        3. Upgrading Zabbix
          1. General version policy
          2. Long-term support and short-term support
          3. The upgrade process
            1. Minor version upgrade
              1. Upgrading binaries
            2. Upgrading the frontend
            3. Major-level upgrades
            4. Database versioning
            5. Gathering data during the upgrade
            6. The frontend configuration file
          4. Compatibility
        4. Performance considerations
        5. Who did that?
        6. Exploring configuration file parameters
          1. Zabbix agent daemon and common parameters
          2. Zabbix server daemon parameters
        7. Summary
      31. A. Troubleshooting
        1. Chapter introduction
        2. Common issues
          1. Installation
            1. Compilation
            2. Frontend
            3. Backend
            4. Locked out of the frontend
          2. Monitoring
            1. General monitoring
            2. Monitoring with the Zabbix agent
              1. User parameters
            3. SNMP devices
            4. IPMI monitoring
            5. ICMP checks
            6. Problems with simple checks
            7. Problems with zabbix_sender and trapper items
            8. General issues
          3. Triggers
          4. Actions
          5. Discoveries and autoregistration
        3. Troubleshooting Zabbix
          1. The Zabbix log file format
          2. Reloading the configuration cache
          3. Controlling running daemons
          4. Runtime process status
          5. Further debugging
      32. B. Being Part of the Community
        1. Community and support
          1. Chatting on IRC
          2. Using the Zabbix wiki
          3. Using the Zabbix forum
          4. Filing issues on the tracker
          5. Meeting in person
            1. The Zabbix conference
            2. Local communities
        2. Following the development
          1. Getting the source
            1. Daily snapshots
            2. Accessing the version control system
              1. Looking at the changesets
        3. Translating Zabbix
        4. Commercial support options
      33. Index