Zabbix 7 IT Infrastructure Monitoring Cookbook - Nathan Liefting - E-Book

Zabbix 7 IT Infrastructure Monitoring Cookbook E-Book

Nathan Liefting

0,0
38,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Realize the full potential of Zabbix 7 with this updated third edition of the Zabbix 7 IT Infrastructure Monitoring Cookbook. Packed with new recipes and updated with the latest Zabbix functionalities, this guide covers everything you need, whether you’re setting up Zabbix with built-in (proxy) high availability, using LDAP JIT user provisioning, implementing low-level host discovery, or creating advanced triggers.
This hands-on guide offers easy-to-follow recipes to use Zabbix 7 to monitor the performance of devices and applications across your network. You'll start by learning how to install Zabbix and examine its most prominent features, ensuring you make the right design choices to build a scalable and easily manageable environment. Each recipe is crafted to help you build items and triggers for different types of monitoring, create templates, and use Zabbix proxies. You'll also get to grips with using the Zabbix API for customization and managing your Zabbix server and database. Finally, you'll find quick solutions to the common and not-so-common problems that you may encounter in your Zabbix monitoring work.
By the end of this book, you'll have expert insights into using Zabbix for all your monitoring needs and be able to build a solid Zabbix setup by leveraging its key functionalities.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 494

Veröffentlichungsjahr: 2024

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Zabbix 7 IT Infrastructure Monitoring Cookbook

Explore the new features of Zabbix 7 for designing, building, and maintaining your Zabbix setup

Nathan Liefting

Brian van Baekel

Zabbix 7 IT Infrastructure Monitoring Cookbook

Copyright © 2024 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 or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.

Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Khushboo Samkaria

Book Project Manager: Ashwin Dinesh Kharwa

Senior Editor: Romy Dias and Sujata Tripathi

Technical Editor: Rajat Sharma

Copy Editor: Safis Editing

Proofreader: Sujata Tripathi

Indexer: Pratik Shirodkar

Production Designer: Gokul Raj S.T

DevRel Marketing Coordinator: Rohan Dobhal

First published: February 2021

Second edition: March 2022

Third edition: July 2024

Production reference: 1280624

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK

ISBN: 978-1-80107-832-0

www.packtpub.com

To my grandparents, for supporting my education, my brother, for always being at the ready, and my mom and stepdad, for cheering me on. To my wife, for always supporting whatever new idea I get into my head. To my colleagues, throughout the years, my first mentor, Sander F., for inspiring me, and Brian, for making it all possible.

– Nathan Liefting

Foreword

Dear readers,

Brian and Nathan, the authors of this book, are well-known figures in the Zabbix community.

I met them many years ago, and I have always been impressed by their deep knowledge of the product, which would be impossible without extensive practical experience. How could it be otherwise? Brian and Nathan have been professionally working with Zabbix for many years, helping their clients with the architecture, installation, configuration, and maintenance of Zabbix. The authors of this book have earned their reputation through their vast experience and ability to continuously share this knowledge with other Zabbix users. You can find Brian and Nathan speaking at conferences and participating in various community platforms, always ready to help and answer your questions!

Zabbix allows you to quickly immerse yourself in the wonderful world of monitoring. In Zabbix development, we follow this principle: “Make simple things easy, and complex things possible.” But don’t let this simplicity and speed deceive you. Soon enough, you will start to realize that simple monitoring tasks are indeed easy to implement. However, the further you move forward, the quicker you will understand that you need to study and carefully read the documentation. You will discover that there are more complex monitoring tasks that require a deeper understanding of Zabbix’s capabilities.

This book fills the gap between the official documentation, which describes the product’s functionality, and real-life situations that require specific solutions and it does it perfectly. Especially valuable is that this book covers the new functionality of Zabbix 7.0 LTS, the latest release of Zabbix to date!

This book is a must-read for anyone who wants to learn specific techniques for solving particular monitoring and observability tasks. How great it is to have solutions to many challenges you may encounter at your fingertips!

I am grateful to the authors of the book for their work and wish everyone an enjoyable reading. You will not be disappointed!

Alexei Vladishev

Creator of Zabbix

Contributors

About the authors

Nathan Liefting, also known as Larcorba, is an IT consultant and trainer. He has more than 9 years of professional experience in IT. His experience ranges from managing networks running EVPN/VXLAN to Linux environments and programming. Nathan started working with Zabbix in 2016, when it was still at Zabbix 2 and Zabbix 3 was just released.

He is now working for Opensource ICT Solutions BV in The Netherlands as a Zabbix trainer and consultant. Here, he designs and builds professional Zabbix environments and Zabbix components for some of the biggest and most interesting companies around the world.

Brian van Baekel quickly discovered how powerful Zabbix is during his career as a network engineer. Ever since, he has been working with Zabbix in various (large) environments, leading to him gaining his official Zabbix Certified Trainer certification in early 2017.

In 2018, Brian founded Opensource ICT Solutions BV in the Netherlands and Opensource ICT Solutions LLC in the USA. Both companies primarily focus on building Zabbix environments all over the world. In 2021, further expansion of the business was established by opening a subsidiary in the United Kingdom with a full focus on the product Zabbix. All companies provide support, training, and consultancy services, and basically, that means Brian is working with the Zabbix product 24/7.

Fun fact: even his cat is named “Zabbix” and you also should ask Brian what’s on his arm some time.

About the reviewers

Sven Putteneers got to know Zabbix more than eight years ago as part of his duties at his then-new employer, after which he swore off all other monitoring systems. He has founded a company, 7 to 7, through which he provides Zabbix consultancy and develops custom integrations with external systems. He is also an active member of the Zabbix International Community Telegram group, where he is known as @OffByOne. In his free time, he likes to swim, read science fiction, and go to conferences and meet-ups. He dislikes social media but can be found on LinkedIn.

First of all, I’d like to thank the authors of the book for providing a valuable resource to the Zabbix community. Furthermore, I’d like to give a shout-out to the Zabbix community and people who try to help each other in their free time, be it through the forums, IRC, Telegram groups, and so on …. You are awesome!

Andreas Drbal boasts a decade in tech, evolving from a self-taught frontend developer to a key figure in DevOps and CloudOps. His academic journey led him to UCLA, majoring in English with a German minor, and later acquiring a master’s in information systems management and an MBA. Andreas’s passion for monitoring began with Zabbix 3.x in 2015, integrating it with IoT devices. Currently, as a senior manager at Cloud Software Group, he’s driven by automation, streamlining the DevOps life cycle, and ensuring team productivity.

I want to thank my wife, who encouraged me to contribute to the learning community by active participation, and also for her patience during the period of reviewing of this book.

Table of Contents

Preface

1

Installing Zabbix and Getting Started Using the Frontend

Technical requirements

Installing the Zabbix server

Getting ready

How to do it…

How it works…

Setting up the Zabbix frontend

Getting ready

How to do it…

How it works…

There’s more...

Enabling Zabbix server HA

Getting ready

How to do it…

How it works...

There’s more...

Using the Zabbix frontend

Getting ready

How to do it…

Navigating the Zabbix frontend

Getting ready

How to do it…

2

Getting Things Ready with Zabbix User Management

Technical requirements

Creating user groups

Getting ready

How to do it…

There’s more...

Using Zabbix user roles

Getting ready

How to do it...

How it works...

There’s more...

Creating your first users

Getting ready

How to do it…

Azure AD SAML user authentication and JIT user provisioning

Getting ready

How to do it…

How it works…

There’s more…

OpenLDAP user authentication and JIT user provisioning

Getting ready

How to do it…

How it works…

3

Setting Up Zabbix Monitoring

Technical requirements

Setting up Zabbix agent monitoring

Getting ready

How to do it…

How it works…

See also

Working with SNMP monitoring the old way

Getting ready

How to do it…

How it works…

Setting up SNMP monitoring the new way

Getting ready

How to do it…

How it works…

Creating Zabbix simple checks and the Zabbix trapper

Getting ready

How to do it…

How it works…

Working with calculated and dependent items

Getting ready

How to do it…

How it works…

Creating external checks

Getting ready

How to do it…

How it works…

Setting up JMX monitoring

Getting ready

How to do it…

How it works…

See also

Setting up database monitoring

Getting ready

How to do it…

How it works…

There’s more…

Setting up HTTP agent monitoring

Getting ready

How to do it…

How it works…

Using Zabbix browser items to simulate a web user

Getting ready

How to do it…

How it works…

Using Zabbix preprocessing to alter item values

Getting started

How to do it…

How it works…

See also

4

Working with Triggers and Alerts

Technical requirements

Setting up triggers

Getting ready

How to do it…

How it works…

There’s more…

See also

Setting up advanced triggers

Getting ready

How to do it…

How it works…

There’s more…

Setting up alerts

Getting ready

How to do it…

How it works…

There’s more…

Keeping alerts effective

Getting ready

How to do it…

How it works…

There’s more…

Customizing alerts

Getting ready

How to do it…

How it works…

5

Building Your Own Structured Templates

Technical requirements

Creating your Zabbix template

Getting ready

How to do it…

How it works…

There’s more…

Setting up template-level tags

Getting ready

How to do it…

How it works…

See also

Creating template items

Getting ready

How to do it…

How it works…

See also

Creating template triggers

Getting ready

How to do it…

How it works…

Setting up different kinds of macros

Getting ready

How to do it…

How it works…

There’s more…

Using LLD on templates

Getting ready

How to do it…

How it works…

See also

Nesting Zabbix templates

Getting ready

How to do it…

How it works…

6

Visualizing Data, Inventory, and Reporting

Technical requirements

Creating graphs to access visual data

Getting ready

How to do it…

How it works…

Creating maps to keep an eye on infrastructure

Getting ready

How to do it…

How it works…

Creating dashboards to get the right overview

Getting ready

How to do it…

How it works…

There’s more…

Templating dashboards to work at the host level

Getting ready

How to do it…

How it works…

Setting up Zabbix inventory

Getting ready

How to do it…

How it works…

Using the Zabbix Geomap widget

Getting ready

How to do it…

How it works…

Working through Zabbix reporting

Getting ready

How to do it…

Setting up scheduled PDF reports

Getting ready

How to do it…

How it works…

Setting up improved business service monitoring

Getting ready

How to do it…

How it works…

There’s more...

7

Using Discovery for Automatic Creation

Technical requirements

Setting up Zabbix agent network discovery

Getting ready

How to do it…

How it works…

There’s more…

Working with Zabbix SNMP network discovery

Getting ready

How to do it…

How it works…

Automating host creation with active agent autoregistration

Getting ready

How to do it…

How it works…

There’s more…

Using Windows performance counter discovery

Getting ready

How to do it…

How it works…

Discovering JMX objects

Getting ready

How to do it…

How it works…

There’s more…

Setting up Zabbix SNMP LLD the new way

Getting ready

How to do it…

How it works…

Creating hosts with LLD and custom JSON

Getting ready

How to do it…

How it works…

There’s more…

8

Setting Up Zabbix Proxies

Technical requirements

Setting up a Zabbix proxy

Getting ready

How to do it…

How it works…

There’s more…

Working with passive Zabbix proxies

Getting ready

How to do it…

How it works…

Working with active Zabbix proxies

Getting ready

How to do it…

How it works…

Monitoring hosts with Zabbix proxy

Getting ready

How to do it…

How it works…

There’s more…

See also

Encrypting your Zabbix proxy connection with pre-shared keys

Getting ready

How to do it…

How it works…

Setting up Zabbix proxy load balancing

Getting ready

How to do it…

How it works…

Using discovery with Zabbix proxies

Getting ready

How to do it…

How it works…

Monitoring your Zabbix proxies

Getting ready

How to do it…

How it works…

9

Integrating Zabbix with External Services

Technical requirements

Setting up Slack alerting with Zabbix

Getting ready

How to do it…

How it works…

See also

Setting up Microsoft Teams alerting with Zabbix

Getting ready

How to do it…

How it works…

See also

Using Telegram bots with Zabbix

Getting ready

How to do it…

How it works…

There’s more…

See also

Integrating Atlassian Opsgenie with Zabbix

Getting ready

How to do it…

How it works…

There’s more…

10

Extending Zabbix Functionality with Custom Scripts and the Zabbix API

Technical requirements

Setting up and managing API tokens

Getting ready

How to do it…

How it works…

Using the Zabbix API for extending functionality

Getting ready

How to do it…

How it works…

See also

Building a jumphost using the Zabbix API and Python

Getting ready

How to do it…

How it works…

See also

Enabling and disabling a host from Zabbix maps

Getting ready

How to do it…

How it works…

There’s more…

See also

11

Maintaining Your Zabbix Setup

Technical requirements

Setting Zabbix maintenance periods

Getting ready

How to do it…

How it works…

Backing up your Zabbix setup

Getting ready

How to do it…

How it works…

There’s more…

Upgrading the Zabbix backend from older PHP versions to PHP 8.2 or higher

Getting ready

How to do it…

How it works…

Upgrading a Zabbix database from older MariaDB versions to MariaDB 11.4

Getting ready

How to do it…

How it works…

There’s more...

Upgrading your Zabbix setup

Getting ready

How to do it…

How it works…

See also

Maintaining Zabbix performance over time

Getting ready

How to do it…

How it works…

There’s more…

12

Advanced Zabbix Database Management

Technical requirements

Setting up MySQL partitioning for your Zabbix database

Getting ready

How to do it…

How it works…

See also

Using the PostgreSQL TimescaleDB functionality

Getting ready

How to do it…

How it works…

See also

Securing your Zabbix MySQL database

Getting ready

How to do it…

How it works…

13

Bringing Zabbix to the Cloud with Zabbix Cloud Integration

Technical requirements

Setting up AWS monitoring

Getting ready

How to do it…

How it works…

There’s more…

Setting up Microsoft Azure monitoring

Getting ready

How to do it…

How it works…

There’s more…

Building your Zabbix Docker monitoring

Getting ready

How to do it…

How it works…

There’s more…

Index

Other Books You May Enjoy

Preface

Welcome to Zabbix 7 IT Infrastructure Monitoring Cookbook. IT infrastructure ranges from Windows and Linux to networking and development, and basically anything that runs on computer hardware. In this book, we will go over various subjects useful to anyone in IT who wants to use Zabbix to monitor their IT infrastructure.

Who this book is for

Monitoring systems are often overlooked within IT organizations, but they can provide an overview that will save you time, money, and headaches. This book is for IT engineers who want to learn something about Zabbix 7 and how to use it to bring their IT environments to the next level.

What this book covers

Chapter 1, Installing Zabbix and Getting Started Using the Frontend, covers how to set up Zabbix optionally with HA and work your way through its menus.

Chapter 2, Getting Things Ready with Zabbix User Management, covers how to set up your first users, user groups, and user roles.

Chapter 3, Setting Up Zabbix Monitoring, covers how to set up almost any type of monitoring within Zabbix.

Chapter 4, Working with Triggers and Alerts, covers how to set up triggers and get alerts from them.

Chapter 5, Building Your Own Structured Templates, covers how to build templates that are structured and will work wonders for keeping your Zabbix setup organized.

Chapter 6, Visualizing Data, Inventory and Reporting, covers how to visualize data in graphs, maps, and dashboards. It also covers how to use the Zabbix inventory, reporting, and business service monitoring functionality.

Chapter 7, Using Discovery for Automatic Creation, covers how to use Zabbix discovery for automatic host creation as well as items, triggers, and more with agents, SNMP, WMI, and JMX.

Chapter 8, Setting Up Zabbix Proxies, teaches how to set up Zabbix proxies correctly for use in a production environment, with the addition of the new proxy high availability.

Chapter 9, Integrating Zabbix with External Services, teaches how to integrate Zabbix with external services for alerting.

Chapter 10, Extending Zabbix Functionality with Custom Scripts and Zabbix API, covers how to extend Zabbix functionality by using custom scripts and the Zabbix API.

Chapter 11, Maintaining Your Zabbix Setup, covers how to maintain a Zabbix setup and keep its performance up over time.

Chapter 12, Advanced Zabbix Database Management, teaches how to manage Zabbix databases for an advanced setup.

Chapter 13, Bringing Zabbix to the Cloud with Zabbix Cloud Integration, covers how to use Zabbix in the cloud with services such as AWS, Azure, Docker, and Kubernetes.

To get the most out of this book

You should have a good basis in IT to understand the terminology used in this book. This book is best for people with at least basic knowledge of monitoring systems, Linux, and network engineering.

Software/hardware covered in the book

Operating system requirements

Zabbix 7

Linux (any)

Python 3

MariaDB (MySQL)

PostgreSQL

NGINX

VIM

Make sure you have a virtualization environment ready to create virtual machines for use with the recipes. VirtualBox, VMware, or any other type of client/hypervisor will do.

Throughout the book, we will make use of Vim to edit files, so make sure to install it. If you do not feel comfortable using Vim, you can substitute this for Nano or anything else you prefer.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Zabbix-7-IT-Infrastructure-Monitoring-Cookbook. If there’s an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “The log_bin_trust_function_creators function is set to 1 here to allow the initial database data to be imported.

A block of code is set as follows:

# listen 8080; # server_name example.com;

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

# MariaDB Server# To use a different major version of the server, or to pin to a specific minor version, change URI below. deb [arch=amd64,arm64] https://dlm.mariadb.com/repo/mariadbserver/11.4/repo/ubuntu jammy main

Any command-line input or output is written as follows:

systemctl start mariadb

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: “We will also need a virtual IP (VIP) address for our cluster nodes.”

Tips or important notes

Appear like this.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it..., How it works..., There’s more..., and See also).

To give clear instructions on how to complete a recipe, use these sections as follows:

Getting ready

This section tells you what to expect in the recipe and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There’s more…

This section consists of additional information about the recipe in order to make you more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, select your book, click on the Errata Submission Form link, and enter the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Before we get started

Whether you are a real Zabbix guru or you’ve just started working with Zabbix, this book will include some recipes for everyone. We will go over most of the Zabbix basics and even do some cool stuff with the Zabbix API and databases in the book.

We decided to write this book because we think it’s important to be part of the community and want to supply you with the Zabbix information available online and in the official Zabbix training materials in a clear and straightforward way from a reliable source. We’ve all been through the process of bookmarking all those amazing community blog posts, community guides, and even official documentation. Sometimes it can be a bit much, which is where this book will help. See it as your guide with something for everyone without the need to Google until your fingers fall off.

Now even when you have gained experience, finished this and maybe other books, and you’ve bookmarked every useful page about Zabbix, you might still not know everything. This is where we come in. Zabbix is a free product built on an amazing open source community, but besides that, there are some real Zabbix gurus out there that decided to make a living out of it. Our company, Opensource ICT Solutions, comes from these humble beginnings, and we are there to provide our customers with everything they need when it comes to Zabbix. As a Premium Zabbix partner, we provide the following:

Official Zabbix trainingOfficial Zabbix supportZabbix consultancyTurnkey solutionsCustom integrations24/7-available service desk

As providing services on Zabbix is our core business, we see different environments, different customers, and different use cases of the product every day, while working out the best solutions we can for our worldwide customer base. As an official training partner, it’s not only about building environments but also about sharing knowledge and teaching others how to get the most out of the product.

So, if you’ve enjoyed this book, please do think about us and others in our amazing Zabbix community. Give us a follow on LinkedIn (and other social media) and whenever you need help, give us a call! We will definitely be ready to help you out with any questions you might run into.

United Kingdom

The Netherlands

United States

Opensource ICT Solutions LTD

Opensource ICT Solutions B.V.

Opensource ICT Solutions LLC

Phone: +44 20 4551 1827

Phone: +31 (0)72 743 65 83

Phone: +1-929-377-1232

https://oicts.com

[email protected]

Share Your Thoughts

Once you’ve read Zabbix 7 IT Infrastructure Monitoring Cookbook, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/978-1-80107-832-0

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly