You are previewing Mastering Zabbix.
O'Reilly logo
Mastering Zabbix

Book Description

Learn how to refine and organize your IT monitoring systems using your existing working knowledge of Zabbix. This step-by-step tutorial will help you unleash the full capabilities of the system.

  • Create the perfect monitoring configuration based on your specific needs

  • Extract reports and visualizations from your data

  • Integrate monitoring data with other systems in your environment

  • Learn the advanced techniques of Zabbix to monitor networks and performances in large environments

  • In Detail

    Monitoring systems are a crucial part of any IT environment. They can be extremely useful not only to identify specific problems, but also to measure your system’s performance and find the best way to improve it. However, they can be misleading and confusing if not correctly configured and managed. False alarms and missing data can undermine a monitoring system's contribution to a healthy IT department. Zabbix 2.2 allows you to customize and implement ideas by extending, adding, or customizing functionality, giving an added value to that technology.

    This comprehensive guide will help you to make both strategic and practical decisions about the Zabbix monitoring system, so that it will fit your environment and monitoring needs like a glove. From choosing the correct size and configurationto what you should actually monitor, including exporting and integrating your data with other systems, this book will leave you with no doubts about the crucial role of a well configured monitoring system.

    Introducing you to methods to configure and choose between high availability and distributed Zabbix architectures for your largeenvironment, this guide will proceed to show you how to gather monitoring data, visualize, and act on it. Next, the guide explores how you can extend Zabbix and connect it to trouble ticketing systems or data mining solutions. You will also learn how to choose the ideal database backend, monitor appliances that only talk SNMP and application servers that talk JMX, and organize your charts and maps in screens that can be visualized on big screens. It shows you how to leverage Zabbix's discovery capabilities to track your ever changing environment and build complex, intelligent alarms that won't distract you with trivial problems. Finally, you will learn to expand Zabbix's capabilities through its scripting facilities, protocol and powerful API.

    Table of Contents

    1. Mastering Zabbix
      1. Table of Contents
      2. Mastering Zabbix
      3. Credits
      4. About the Authors
      5. About the Reviewers
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. Who this book is for
        3. What you need for this book
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Deploying Zabbix
        1. Defining the environment size
        2. Zabbix architectures
          1. Zabbix installation
            1. Prerequisites
          2. Setting up the server
            1. Setting up the agent
            2. Installing and creating the package
            3. Configuring the server
          3. Installing the database
          4. Starting up with Daemon
          5. Some considerations about the database
          6. Sizing of the database
          7. Some considerations about housekeeping
          8. The web interface
            1. The web wizard – frontend configuration
          9. Capacity planning with Zabbix
            1. The observer effect
            2. What to monitor
            3. Define a baseline
            4. Load testing
            5. Forecasting the trends
        3. Summary
      9. 2. Distributed Monitoring
        1. Zabbix proxies
          1. Deploying a Zabbix proxy
          2. Understanding the flow of monitoring data with proxies
        2. Zabbix nodes
          1. Understanding the flow of data with nodes
          2. Deploying a node
        3. Proxies versus nodes
          1. Disadvantages of nodes
          2. Choosing between proxies and nodes
        4. Security considerations
          1. No network configuration
          2. Network isolation
          3. Simple tunnels
            1. Secure Shell
            2. Stunnel
          4. A full-blown VPN
        5. Summary
      10. 3. High Availability and Failover
        1. Understanding high availability
        2. Understanding the levels of IT service
        3. Some consideration about high availability
          1. Automating the switchover/the failover with a resource manager
          2. Replicating the filesystem with DRBD
        4. Implementing high availability on a web server
          1. Configuring HTTPD HA
            1. Understanding Pacemaker and STONITH
            2. Pacemaker – is Quorum really needed?
            3. Pacemaker – the stickiness concepts
            4. Pacemaker – the Apache/HTTPD configuration
        5. Configuring the Zabbix Server for high availability
        6. Database high availability
          1. Clustering of PostgreSQL
          2. Mirrored logical volume with LVM and DRBD
            1. Prerequisite tasks to start with DRBD on LVM
            2. Creating a DRBD device on top of the LVM partition
            3. Enabling resource in DRBD
            4. Defining a primary device in DRBD
            5. Creating a filesystem on a DRBD device
          3. Pacemaker cluster – integrating DRBD
            1. Enabling the DRBD configuration
            2. Pacemaker – the LVM configuration
            3. Pacemaker – configuring PostgreSQL
            4. Pacemaker – the network configuration
            5. Pacemaker – the final configuration
            6. Cluster configuration – the final test
          4. DRBD performance and optimizations
            1. Efficient synchronization by DRBD
            2. Enabling online verification through DRDB
            3. DRBD – some networking consideration
        7. Summary
      11. 4. Collecting Data
        1. Gathering items as raw data
        2. Understanding the data flow for Zabbix items
          1. Understanding Zabbix trapper items
          2. The data flow overview
        3. Database monitoring with Zabbix
          1. Delving into ODBC
            1. Installing database drivers
            2. MySQL ODBC drivers
            3. PostgreSQL ODBC drivers
            4. Oracle ODBC drivers
            5. UnixODBC configuration files
            6. Compiling Zabbix with ODBC
            7. Database monitor items
            8. Some considerations about the ODBC SQL query
        4. Zabbix JMX monitoring
          1. Considering some JMX security aspects
          2. Installing a Zabbix Java gateway
          3. Configuring Zabbix JMX
            1. JMX keys in detail
            2. Issues and considerations about JMX
        5. Zabbix SNMP monitoring
          1. SNMP queries
          2. SNMP traps
            1. The snmptrapd process
            2. The Perl trap handler
        6. Web pages monitoring
          1. Authenticating on web pages
          2. Logging out
        7. Aggregated and calculated items
          1. Aggregated items
          2. Calculated items
        8. Summary
      12. 5. Visualizing Data
        1. Graphs
          1. Analyzing simple graphs
          2. Analyzing custom graphs
            1. Reviewing all the combinations of graph properties
        2. Visualizing the data through maps
          1. Creating your first Zabbix Map
          2. Some important considerations about macros and URLs
          3. Finally inside the map
          4. Selecting elements
          5. Playing with macros inside maps
        3. Visualizing through screens
          1. Creating a screen
          2. Dynamic elements
        4. Visualizing the data through a slide show
        5. Controlling centre slides and the big display challenge
          1. Some consideration about slides on a big display
          2. Automated slide show
        6. IT services
          1. Configuring an IT service
        7. Summary
      13. 6. Managing Alerts
        1. Understanding trigger expressions
          1. Selecting items and functions
            1. Choosing between seconds or number of measurements
            2. Date and time functions
            3. Trigger severity
            4. Choosing between absolute values and percentages
          2. Understanding operations as correlations
        2. Managing the trigger dependencies
        3. Taking action
          1. Defining an action
            1. The {EVENT.DATE} and {EVENT.TIME} macros
            2. The {INVENTORY.SERIALNO.A} and friends macros
            3. The {NODE.ID} and {NODE.NAME} macros
          2. Defining the action conditions
          3. Choosing the action operations
            1. Steps and escalations
            2. Messages and media
            3. Remote commands
        4. Summary
      14. 7. Managing Templates
        1. Creating templates
        2. Adding entities to a template
          1. Using macros
            1. User-defined macros
        3. Linking templates to hosts
          1. Nesting templates
          2. Combining templates
        4. Discovering hosts
        5. Low-level discovery
        6. Summary
      15. 8. Handling External Scripts
        1. External checks
          1. The script's placement
          2. Going deep into external checks
          3. Inside the script
          4. General script writing rules
            1. Some consideration about external checks
        2. The UserParameter
          1. The flexible UserParameter
          2. Some considerations about UserParameters
        3. Sending data using zabbix_sender
          1. The new script
          2. Writing a wrapper script for check_ora_sendtrap
          3. Pros and cons of a dedicated script server
        4. Working with Zabbix protocols
          1. The Zabbix get protocol
          2. The Zabbix sender protocol
            1. An interesting undocumented feature
            2. Using clock properties in JSON items
          3. The Zabbix Agent protocol
            1. Some more possible responses
        5. Communicating with Zabbix
          1. Implementing Zabbix sender in Java
          2. Implementing Zabbix sender in Python
          3. Some considerations about agent development
        6. Summary
      16. 9. Extending Zabbix
        1. Exploring the Zabbix API
          1. Authenticating through the API
          2. Using the PyZabbix library
        2. Synchronizing templates across different nodes
        3. Mass operations
          1. Redistributing hosts to proxies
          2. Adding or updating users
        4. Exporting data
          1. Extracting tabular data
          2. Creating graphs from data
            1. The Graphviz suite of programs
            2. Creating a trigger dependency graph
        5. Summary
      17. 10. Integrating Zabbix
        1. An overview of Request Tracker
        2. Setting up RT to better integrate with Zabbix
          1. Creating a custom queue for Zabbix
          2. Customizing tickets – the links section
          3. Customizing tickets – ticket priority
          4. Customizing tickets – the custom fields
          5. Connecting to the Request Tracker API
        3. Setting up Zabbix to integrate with Request Tracker
        4. Creating RT tickets from the Zabbix events
        5. Summary
      18. Index