Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Zabbix 5 IT Infrastructure Monitoring Cookbook
Zabbix 5 IT Infrastructure Monitoring Cookbook

Zabbix 5 IT Infrastructure Monitoring Cookbook: Explore the new features of Zabbix 5 for designing, building, and maintaining your Zabbix setup

Arrow left icon
Profile Icon Nathan Liefting Profile Icon Baekel
Arrow right icon
AU$47.99 AU$53.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (3 Ratings)
eBook Feb 2021 428 pages 1st Edition
eBook
AU$47.99 AU$53.99
Paperback
AU$67.99
Subscription
Free Trial
Renews at AU$24.99p/m
Arrow left icon
Profile Icon Nathan Liefting Profile Icon Baekel
Arrow right icon
AU$47.99 AU$53.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (3 Ratings)
eBook Feb 2021 428 pages 1st Edition
eBook
AU$47.99 AU$53.99
Paperback
AU$67.99
Subscription
Free Trial
Renews at AU$24.99p/m
eBook
AU$47.99 AU$53.99
Paperback
AU$67.99
Subscription
Free Trial
Renews at AU$24.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Zabbix 5 IT Infrastructure Monitoring Cookbook

Chapter 2: Setting Up Zabbix Monitoring

Zabbix is built to be flexible and should be able to monitor just about anything you could ever require. In this chapter, we will learn more about working with Zabbix to build a lot of different options for monitoring. We'll go over them recipe by recipe, so you'll end up with a solid understanding of how they work. We'll cover the following recipes on the different monitoring types:

  • Setting up Zabbix agent monitoring
  • Working with SNMP monitoring
  • Creating Zabbix simple checks and Zabbix trapper
  • Working with calculated and dependent items
  • Creating external checks
  • Setting up JMX monitoring
  • Setting up database monitoring
  • Setting up HTTP agent monitoring
  • Using Zabbix preprocessing to alter item values

Technical requirements

We will need a Zabbix server capable of performing monitoring, with the following requirements:

  • A server with Zabbix server installed on a Linux distribution of your choice, such as CentOS or Ubuntu, but a distribution such as Debian or anything else will suit you just as well
  • MariaDB set up to work with your Zabbix server
  • NGINX or Apache set up to serve the Zabbix frontend

I'll be using the same server as we used in the previous chapter, but any Zabbix server should do.

Setting up Zabbix agent 2 monitoring

With the release of Zabbix 5, Zabbix also officially started support for the new Zabbix agent 2. Zabbix agent 2 brings some major improvements and is even written in another coding language, which is Golang instead of C. In this recipe, we will be exploring how to work with Zabbix agent 2 and explore some of the new features introduced by it.

You'll also need a Linux distribution of your choice running Zabbix agent 2.

Getting ready

To get started with Zabbix agent 2, all we need to do is install it to a (Linux) host that we want to monitor. Make sure you have an empty Linux (CentOS 8) host ready to monitor.

How to do it

Let's see how to install Zabbix agent 2 and then move on to actually working with it.

Installing Zabbix agent 2

Let's start by installing Zabbix agent 2 on the Linux host we want to monitor. I'll be using a CentOS 8 machine:

  1. Issue the following command to add the repository:

    For RHEL-based systems:

    rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

    For Debian-based systems:

    wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
    dpkg -i zabbix-release_5.0-1+buster_all.deb
  2. Then issue the following command to install Zabbix Agent 2:

    For RHEL-based systems:

    dnf install zabbix-agent2

    For Debian-based systems:

    apt install zabbix-agent2

Congratulations, Zabbix agent 2 is now installed and ready to use.

Using a Zabbix agent in Passive mode

Let's start by building a Zabbix agent with passive checks:

  1. After installing Zabbix agent 2, let's open the Zabbix agent configuration file for editing:
    vim /etc/zabbix/zabbix_agent2.conf

    In this file, we edit all the Zabbix agent configuration values we could need from the server side.

  2. Let's start by editing the following values:
    Server=127.0.0.1
    Hostname=Zabbix server
  3. Change Server to the IP of the Zabbix server that will monitor this passive agent. Change Hostname to the hostname of the monitored server.
  4. Now restart the Zabbix agent 2 process:
    systemctl restart zabbix-agent2.service
  5. Now move to the frontend of your Zabbix server and add this host for monitoring.
  6. Go to Configuration | Hosts in your Zabbix frontend and click Create host in the top-right corner.
  7. To create this host in our Zabbix server, we need to fill in the values seen in the following screenshot:
    Figure 2.1 – The Zabbix host creation page for host lar-book-agent

    Figure 2.1 – The Zabbix host creation page for host lar-book-agent

    It's important to add the following:

    • Host name: To identify this host.
    • Groups: To logically group hosts.
    • Interfaces: To monitor this host on a specific interface. No interface means no communication.
  8. It is also important to add a template to this host. As this is a Linux server monitored by a Zabbix agent, let's add the correct out-of-the-box template as shown in the following screenshot:
    Figure 2.2 – The Zabbix host template page for host lar-book-agent

    Figure 2.2 – The Zabbix host template page for host lar-book-agent

  9. Click the Add button and you're done creating this agent host. Now that you've got this host, make sure the ZBX icon turns green, indicating that this host is up and being monitored with the passive Zabbix agent:
    Figure 2.3 – The Zabbix configuration hosts page, host lar-book-agent

    Figure 2.3 – The Zabbix configuration hosts page, host lar-book-agent

  10. You can now see the values received on this host by going to Monitoring | Hosts and checking the Latest data button. Please note that the values could take a while to show up:
Figure 2.4 – The Zabbix latest data page for host lar-book-agent

Figure 2.4 – The Zabbix latest data page for host lar-book-agent

Using a Zabbix agent in Active mode

Now let's check out how to configure the Zabbix agent with active checks. We need to change some values on the monitored Linux server host side:

  1. Start by executing the following command:
    vim /etc/zabbix/zabbix_agent2.conf
  2. Now let's edit the following value to change this host to an active agent:
    ServerActive=127.0.0.1
  3. Change ServerActive to the IP of the Zabbix server that will monitor this passive agent and also change Hostname to lar-book-agent:
    Hostname=lar-book-agent
  4. Now restart the Zabbix agent 2 process:
    systemctl restart zabbix-agent2.service
  5. Now move to the frontend of your Zabbix server and let's add another host with a template to do active checks instead of passive ones.
  6. First, let's rename our passive host. To do that, go to Configuration | Hosts in your Zabbix frontend and click the host we just created. Change Host name as follows:
    Figure 2.5 – The Zabbix host configuration page for host lar-book-agent_passive

    Figure 2.5 – The Zabbix host configuration page for host lar-book-agent_passive

    We are doing this because for an active Zabbix agent, the hostname in the file needs to match our Zabbix server.

  7. Go to Configuration | Hosts in your Zabbix frontend and click Create host in the top-right corner.
  8. Now let's create the host as follows:
    Figure 2.6 – The Zabbix host configuration page for host lar-book-agent

    Figure 2.6 – The Zabbix host configuration page for host lar-book-agent

  9. Also, make sure to add the correct template, named Template OS Linux by Zabbix agent active:
Figure 2.7 – The Zabbix host template page for host lar-book-agent

Figure 2.7 – The Zabbix host template page for host lar-book-agent

Please note that the ZBX icon won't turn green for an active agent. But when we navigate to Monitoring | Hosts and check Latest data, we can see our active data coming in.

Tip

As you might have noticed just now, a Zabbix agent can run in both passive and active mode. Keep this in mind when creating your Zabbix agent templates, as you might want to combine the check types.

How it works…

Now that we have configured our Zabbix agents and know how they should be set up, let's see how the different modes work.

Passive agent

The passive agent works by collecting data from our host with the Zabbix agent. Every time an item on our host reaches its interval, the Zabbix server asks the Zabbix agent what the value is now:

Figure 2.8 – Communication diagram between server and passive agent

Figure 2.8 – Communication diagram between server and passive agent

Active agent

The active agent works by sending data from the Zabbix agent to Zabbix server. Every time an item on our agent reaches its update interval, the agent will send the value to our server. We can also use this to send a notification to our server faster when something goes wrong:

Figure 2.9 – Communication diagram between server and active agent

Figure 2.9 – Communication diagram between server and active agent

As mentioned, we can use both types of checks at the same time, giving us the freedom to configure every type of check we could possibly need. Our setup would then look like this:

Figure 2.10 – Communication diagram between server and both agent types

Figure 2.10 – Communication diagram between server and both agent types

See also

There's a lot of new stuff going on under the hood of Zabbix agent 2; if you're interested in learning more about the core of Zabbix agent 2, check out this cool blog post by Alexey Petrov: https://blog.zabbix.com/magic-of-new-zabbix-agent/8460/.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Find out how you can leverage some of the most exciting features of Zabbix 5
  • Perform professional IT infrastructure and application monitoring on multiple platforms
  • Discover easy-to-follow, practical solutions to problems in network monitoring with Zabbix

Description

Zabbix offers useful insights into your infrastructure performance and issues and enables you to enhance your monitoring setup with its variety of powerful features. This book covers hands-on, easy-to-follow recipes for using Zabbix 5 for effectively monitoring the performance of devices and applications over networks. The book starts by guiding you through the installation of Zabbix and using the Zabbix frontend. You'll then work your way through the most prominent features of Zabbix and make the right design choices for building a scalable and easily manageable environment. The book contains recipes for building items and triggers for different types of monitoring, building templates, and using Zabbix proxies. As you advance, you’ll learn how to use the Zabbix API for customization and manage your Zabbix server and database efficiently. Finally, you'll find quick solutions to the common and not-so-common problems that you may encounter in your everyday Zabbix monitoring work. By the end of this Zabbix book, you’ll have learned how to use Zabbix for all your monitoring needs and be able to build a solid Zabbix setup by leveraging its key functionalities.

Who is this book for?

This book is for IT engineers who want to get started with Zabbix and anyone with an intermediate understanding of Zabbix looking to extend their knowledge. Although not necessary, prior experience with Zabbix will help you to make the most of this book.

What you will learn

  • Explore the different types of monitoring available in Zabbix 5
  • Find out how to build your own Zabbix templates
  • Use Zabbix proxies for effective load balancing/scaling
  • Work with custom integrations and the Zabbix API
  • Set up triggers and alerting with Zabbix 5
  • Maintain your Zabbix setup for scaling, backups, and upgrades
  • Discover how to perform advanced Zabbix database management
  • Monitor cloud-based products such as Amazon Web Services (AWS), Azure, and Docker

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 26, 2021
Length: 428 pages
Edition : 1st
Language : English
ISBN-13 : 9781800208452
Vendor :
Zabbix
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 26, 2021
Length: 428 pages
Edition : 1st
Language : English
ISBN-13 : 9781800208452
Vendor :
Zabbix
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
AU$24.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
AU$249.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts
AU$349.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total AU$ 203.97
Zabbix 5 IT Infrastructure Monitoring Cookbook
AU$67.99
Mastering Linux Administration
AU$60.99
Zabbix 6 IT Infrastructure Monitoring Cookbook
AU$74.99
Total AU$ 203.97 Stars icon

Table of Contents

13 Chapters
Chapter 1: Getting Started with Zabbix and User Management Chevron down icon Chevron up icon
Chapter 2: Setting Up Zabbix Monitoring Chevron down icon Chevron up icon
Chapter 3: Working with Triggers and Alerts Chevron down icon Chevron up icon
Chapter 4: Building Your Own Structured Templates Chevron down icon Chevron up icon
Chapter 5: Visualizing Data, Inventory, and Reporting Chevron down icon Chevron up icon
Chapter 6: Using Discovery for Automatic Creation Chevron down icon Chevron up icon
Chapter 7: Setting Up Zabbix Proxies Chevron down icon Chevron up icon
Chapter 8: Integrating Zabbix with External Services Chevron down icon Chevron up icon
Chapter 9: Extending Zabbix Functionality with Custom Scripts and the Zabbix API Chevron down icon Chevron up icon
Chapter 10: Maintaining Your Zabbix Setup Chevron down icon Chevron up icon
Chapter 11: Advanced Zabbix Database Management Chevron down icon Chevron up icon
Chapter 12: Bringing Zabbix to the Cloud with Zabbix Cloud Integration Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(3 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Amazon Customer Mar 08, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent book. Highly recommended for IT infrastructure monitoring. I was in the need for server and network devices monitoring so i tried Zabbix. Learning Zabbix advances features using this book is a great advance for my work.
Amazon Verified review Amazon
Donald A. Tevault Mar 07, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you're looking for a network monitoring solution, Zabbix is a great choice. In this book, the authors do a great job of explaining Zabbix, and provide many hands-on procedures that will help get you going. In addition to showing you how to do the normal Zabbix procedures, they also show you how to create your own custom Zabbix extensions. So, if you need to learn Zabbix, you won't go wrong with this book.Full disclosure: I'm also an author for Packt Publishing.
Amazon Verified review Amazon
Lalit Agarwal Mar 11, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I found book this book a great resource for my network monitoring needs. It has everything I needed. The authors do a fantastic job at explaining Zabbix. It has tons of hands on recipes guide you step by step how to set up your network monitoring. well written and easy to read.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.