Creating maps to keep an eye on infrastructure using Zabbix

Maps in Zabbix are a great way to get an overview of infrastructure—for instance, they’re amazing for following traffic flows or seeing where something is going off in your environment. They’re not only super-useful for network overviews but also for server management overviews, and even for a lot of cool customization.

Getting ready

We will need our Zabbix server, our SNMP-monitored host, and the templates from the previous recipe.

How to do it…

  1. Let’s start this recipe off by navigating to Configuration | Template and selecting our Template OS Linux by SNMPvX template.
  2. Go to Discovery rules and then Item prototypes. Create the following item prototype by filling in the fields in the Item prototype creation page:

    Figure 5.9 – Item prototype creation page

    Figure 5.9 – Item prototype creation page

  3. Don’t forget to add the Preprocessing:
    Figure 5.10 – Item prototype Preprocessing creation page

    Figure 5.10 – Item prototype Preprocessing creation page

  4. Click on the blue Add button to finish. Next up, navigate to Monitoring | Maps. There’s already a default map here included in all Zabbix server installs, titled Local network. Feel free to check it out:
    Figure 5.11 – The default Local network map

    Figure 5.11 – The default Local network map

  5. There’s not much to see here, besides your local Zabbix server host and if it is in a problem state or not. So, let’s click on All maps.
  6. We are going to create our own map, so click the Create map button in the top-right corner. Create the map by filling in the following fields:
    Figure 5.12 – Map creation page

    Figure 5.12 – Map creation page

  7. After clicking the blue Add button, the frontend will take you back to the Map overview page. Click the newly created Templated SNMP host map map here.
  8. Click Edit map in the top-right corner to start editing the map.
  9. Now, what we want to do here is select the Add button next to Map element. This will add the following element:
    Figure 5.13 – The added element

    Figure 5.13 – The added element

  10. Click the newly added element—this will open the following screen:
    Figure 5.14 – New Map element edit window

    Figure 5.14 – New Map element edit window

  11. Now, here we can fill out our host information. Let’s add the following information to the fields:
    Figure 5.15 – Map element lar-book-templated_snmp edit window

    Figure 5.15 – Map element lar-book-templated_snmp edit window

  12. Click Apply and move the element by dragging it to X:400 and Y:200 (see Figure 5.16). Now, add another element by clicking the Add button next to Map element. Edit the new element and add the following information:

    Figure 5.16 – Map element Vswitch edit window filled with information

    Figure 5.16 – Map element Vswitch edit window filled with information

  13. After creating both elements, let’s move the new switch element to X:150 and Y:200, as seen in Figure 5.16.
  14. Now, select both elements by holding the Ctrl key (Command on a Mac) on your keyboard.
  15. Then, click Add next to Link to add a link between the two elements. It should now look like this:
    Figure 5.17 – Our newly created map

    Figure 5.17 – Our newly created map

  16. Edit the element for our server again after creating the link. Click on Edit next to the newly created link, as shown in the following screenshot:
    Figure 5.18 – Edit link in the Map element edit window

    Figure 5.18 – Edit link in the Map element edit window

  17. Add the following information to the window:

    Figure 5.19 – Edit link in the Map element edit window with our information

  18. Let’s also click Add at the Link indicators section and add the following trigger with the color red:
    Figure 5.20 – Link indicator filled with a trigger

    Figure 5.20 – Link indicator filled with a trigger

  19. Now, click Apply at the bottom of the window and then Update in the top-right corner of the page. That’s our first map created!

How it works…

Now, after creating and opening our map, we can see the following:

Figure 5.21 – Our newly created map

Figure 5.21 – Our newly created map

The map shows our switch (which is not a monitored host at the moment) and our server (which is a monitored host). This means that when something is wrong with our server, the OK status will turn into a PROBLEM status on the map.

We can also see our configured label (see Figure 5.18), which is showing us real-time information of traffic statistics. Now, when we break down the label, we get the following:

Figure 5.22 – Map label breakdown

Figure 5.22 – Map label breakdown

We can pull real-time statistics into a label by defining which statistics we want to pull into the label between {}. In this case, we collect our values for interface traffic and put them directly in the label, creating a real-time traffic analyzation map.

We also put a trigger on this link. The cool thing about putting triggers such as this on our map is that when our link goes down, we can see the following happen:

Figure 5.23 – Map showing problems

Figure 5.23 – Map showing problems

Traffic stopped flowing because the link is now down, and our line has turned red. Also, our host is now showing a PROBLEM state under the hostname.

We can even create orange lines with triggers that state 50% traffic utilization like this and trace Distributed Denial of Service (DDoS) traffic through our network.

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 *

8 + 1 =