Keeping alerts effective with Zabbix

It’s important to keep our alerts effective to make sure we are neither overwhelmed nor underwhelmed by notifications. To do this, we will change our trigger and the Email media type to reflect just what we want to see.

Getting ready

We will be using Trigger 1 from the first recipe and the default email media type in Zabbix 5. Furthermore, of course, we’ll also be using our Zabbix server.

How to do it…

To create effective alerts, let’s follow these steps:

  1. Let’s get started on Trigger 1, which we created in this chapter’s Setting up triggers recipe. Navigate to our lar-agent-simple host by going to Configuration | Hosts and clicking the Triggers for the host.
  2. Here, sometimes people us a different trigger name like:
    Figure 3.22 – Trigger 1 from the previous recipe

    Figure 3.22 – Trigger 1 from the previous recipe

    Even when you’ve used the macro {HOST.NAME} in the trigger it’s quite simple, so fortunately there isn’t a lot to change here. If you’ve used the hostname in the trigger name, we can change the name to reflect a message that is clearer.

  3. Change the name, as follows:
    Figure 3.23 – New trigger 1 name

    Figure 3.23 – New trigger 1 name

  4. Next, navigate to the Tags page to add some tags for keeping the triggers organized. Let’s add the following:
    Figure 3.24 – Trigger 1 tags

    Figure 3.24 – Trigger 1 tags

  5. Another great way of keeping everything organized is changing media type messages. Let’s change a media type to reflect our own structured needs. Navigate to Administrations | Media types and select our media type named Email.
  6. Select Message templates and click Edit next to our first Problem. This will bring us to the following window:
    Figure 3.25 – Standard email media type message

    Figure 3.25 – Standard email media type message

    Now, Zabbix uses the default configured message under the media type when we do not use a custom message. But if we want to change that message, we can do that here by creating a custom message. Our default under the Email media type looks like the previous screenshot.

  7. We can change the message on the media type. For instance, if we don’t want to see the Original problem ID or when we want a more customized message, simply remove that line, as shown in the following screenshot:
Figure 3.26 – Custom email media type message

Figure 3.26 – Custom email media type message

How it works…

We’ve done two things in this recipe. We’ve changed our trigger name and we’ve added a tag to our trigger.

Keeping trigger names clear and defined in a structured way is important to keeping our Zabbix environment structured. Instead of just naming our trigger Port 22 SSH down on {HOST.NAME}, we’ve added standardization to our setup and can now do cool structuration such as this with our future triggers:

Figure 3.27 – Trigger structure diagram

Figure 3.27 – Trigger structure diagram

Our triggers are all clear and we can immediately see which host, port, and service are down.

On top of that, we’ve added a tag for the service that is down, which will now immediately display our service in a clear way, alerting us to exactly what is going on:

Figure 3.28 – Trigger down, structured

Figure 3.28 – Trigger down, structured

Another thing we’ve done is remove the macro {HOST.NAME}, if you’ve used it before. As we can already see which host this trigger is on by checking the Host field, we do not need to add the {HOST.NAME} macro. We need to keep trigger names short and effective and use the Host name macro’s in Media or simply use the field already available in the frontend.

We’ve also changed our action in this recipe. Changing a message on Media types is a powerful way to keep our problem channels structured. Sometimes, we want to see less or more information on certain channels, and changing media type messages is one way to do this.

We can also create custom messages on an Action level, changing all the messages sent to the selected channels.

Related Articles

How to add swap space on Ubuntu 21.04 Operating System

How to add swap space on Ubuntu 21.04 Operating System

The swap space is a unique space on the disk that is used by the system when Physical RAM is full. When a Linux machine runout the RAM it use swap space to move inactive pages from RAM. Swap space can be created into Linux system in two ways, one we can create a...

read more

Lorem ipsum dolor sit amet consectetur

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

ten + fifteen =