Book Image

Zabbix Network Monitoring - Second Edition

By : Rihards Olups, Rihards Olups, Rihards Olups
Book Image

Zabbix Network Monitoring - Second Edition

By: Rihards Olups, Rihards Olups, Rihards Olups

Overview of this book

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.
Table of Contents (32 chapters)
Zabbix Network Monitoring Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
6
Detecting Problems with Triggers
7
Acting upon Monitored Conditions
Index

Preface

Imagine you're celebrating the start of the weekend with Friday-night drinks with a few friends. And then suddenly, your phone rings—one of the servers you administer has gone down, and it needs to be back up before tomorrow morning. So you drag yourself back to the office, only to discover that some logfiles have been growing more than usual over the past few weeks and have filled up the hard drive. While this scenario is very simplistic, something similar has happened to most IT workers at one or another point in their careers. To avoid such situations, this book will teach you to monitor your network's hardware, servers, and web performance using Zabbix, an open source system monitoring and reporting solution.

This book will guide you through setting up almost every feature in Zabbix. With step-by-step instructions, anybody should be able to configure monitoring. You could even say that this is an idiot's guide to Zabbix—but only because we all have had moments of not understanding something. In order to not leave you confused, throughout this book, I will try to hold your hand, push you forward, and explain everything in so much detail that you won't get frustrated at all.

What this book covers

Chapter 1, Getting Started with Zabbix, covers Zabbix installation from scratch, including the initial database, server and agent daemons, and web frontend, all running on the same machine. We will also configure the Zabbix web frontend, using PHP to access the database.

Chapter 2, Getting Your First Notification, covers configuring Zabbix using the frontend to set up data gathering, triggering upon specified conditions, and informing us by sending an e-mail for a single data source.

Chapter 3, Monitoring with Zabbix Agents and Basic Protocols, takes you through setting up the most widely used and basic data-gathering methods—Zabbix agents and simple checks, such as ICMP ping and direct TCP service checking.

Chapter 4, Monitoring SNMP Devices, teaches you how to set up the industry-standard monitoring protocol, SNMP. We will explore both polling by Zabbix and receiving SNMP traps, which will allow us to monitor a large variety of devices, including printers, switches, UPSes, and routers.

Chapter 5, Managing Hosts, Users, and Permissions, covers hosts, users, and permissions, including host and user group functionality and their impact on permissions. We will also explore related topics, including host and host group maintenance.

Chapter 6, Detecting Problems with Triggers, looks at ways to define which conditions are noteworthy by crafting expressions to detect values outside of the normal range, and other cases.

Chapter 7, Acting upon Monitored Conditions, helps you figure out how to react to triggers firing by sending an e-mail, launching an external script, opening a report in a separate bug tracker, or even restarting a faulty service. We will also learn to configure escalations in Zabbix and figure out how hysteresis works.

Chapter 8, Simplifying Complex Configuration with Templates, tells us how we did it all wrong before and teaches us to improve our configuration using templates that allow us to apply uniform configuration to a bunch of hosts while customizing thresholds per host with user macros. We'll also explore template nesting, which allows creating very flexible configuration in a large and mixed environment.

Chapter 9, Visualizing the Data with Graphs and Maps, explains how to create visual elements to display gathered data, including several types of graphs and interactive network maps.

Chapter 10, Visualizing the Data with Screens and Slideshows, helps you configure screens that collect various types of elements to display and slideshows that allow cycling through several screens in an automated fashion.

Chapter 11, Advanced Item Monitoring, explores more advanced ways to gather information using external, calculated, aggregate, and custom item types to retrieve any information.

Chapter 12, Automating Configuration, teaches us how to discover filesystems, network interfaces, and other entities on hosts with low-level discovery. On a higher level, we will explore the ability to automatically manage hosts via network discovery and active agent autoregistration.

Chapter 13, Monitoring Web Pages, takes us through monitoring the accessibility, performance, and availability of web pages using the built-in web scenario feature of Zabbix.

Chapter 14, Monitoring Windows, covers Windows monitoring by installing Zabbix agents, using performance counters, and retrieving data over WMI.

Chapter 15, High Level Business Service Monitoring, demonstrates the "IT services" feature, which allows aligning monitored services in a tree and calculating SLA conformity. We will fake some data to see how this feature actually looks.

Chapter 16, Monitoring IPMI Devices, teaches us how to set up yet another industry-standard protocol, IPMI. Monitoring both analog and discrete IPMI sensors will be covered.

Chapter 17, Monitoring Java Applications, a separate daemon called Zabbix Java gateway is set up and used to retrieve basic information over JMX.

Chapter 18, Monitoring VMware, covers the built-in VMware monitoring support. We will explore the ability to automatically discover and monitor hypervisors and virtual machines.

Chapter 19, Using Proxies to Monitor Remote Locations, explores the usage of passive and active Zabbix proxies that collect the data on behalf of the Zabbix server and then transmit it back to the server, which helps with remote locations that can't be accessed directly because of firewall concerns and also reduces the load on the Zabbix server.

Chapter 20, Encrypting Zabbix Traffic, looks into one of the major new features in Zabbix 3.0: the ability to encrypt traffic between the Zabbix server, proxies, agents, and the get and sender utilities.

Chapter 21, Working Closely with Data, helps us figure out some details about how data is stored in the Zabbix database and how we can interact with it directly as well as using Zabbix's native XML import and export functionality to more easily create large amounts of configuration. We will also get started with the Zabbix API for more advanced automation needs.

Chapter 22, Zabbix Maintenance, teaches us about the Zabbix upgrade procedure, how different components of various versions can interact, and what database patching between versions involves. We will also explore the internal monitoring options available, discuss backup strategies, and talk in detail about all the configuration parameters Zabbix daemons have.

Appendix A, Troubleshooting, covers common pitfalls with installation, connectivity, configuration, and other areas.

Appendix B, Being Part of the Community, tells us how we are not alone and there's a community around the Zabbix monitoring solution, which we can reach via IRC, forums, and the community wiki.

What you need for this book

You will need at least one Linux system, which could be a virtual machine as well. Depending on specific features discussed, you might also benefit from the following:

  • Access to an SMTP (e-mail) server

  • More Linux systems

  • A device with SNMP support

  • A Windows system

  • A device with IPMI support

  • A Java virtual machine

  • A VMware instance

Some of these can be replicated on the same Linux box—for example, running snmpd or a Java VM will allow you to try out all the monitoring solutions without a separate system.

Who this book is for

This book is perfect for system admins who are new to Zabbix and are interested in creating simple monitoring reports. This book assumes knowledge of basic system administration tasks. Zabbix has added quite a lot of new features over the years, and many features new to 3.0 will be covered, so even experienced users of previous versions should be able to find new information.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows: "One of the first monitoring solutions most administrators implement is a simple shell script invoked from a crontab that checks some basic parameters such as disk usage or some service state, such as an Apache server."

A block of code is set as follows:

memory_limit = 128M
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
upload_max_filesize = 2M

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

memory_limit = 128M
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
upload_max_filesize = 2M

Any command line input or output is written as follows:

# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "This screen doesn't offer us much to configure, so just click on Next step."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

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 at www.packtpub.com/authors.

Customer support

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

You can download the example code files for this book 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.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's web page at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Zabbix-Network-Monitoring-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ZabbixNetworkMonitoringSecondEdition_ColorImages.pdf.

Errata

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 could 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/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted 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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.