create zabbix network maps_step by step tutorial with examples

Create Interactive Zabbix Maps | Learn with Examples (Tutorial)

Zabbix maps are one of many tools we can use to visualize the collected data on Zabbix. Usually overlooked, because not many people know what can be done with Zabbix maps and how powerful they are. Some even use Weathermap plugin to view their network topology without knowing that the same can be done with the network maps in Zabbix. Weathermap plugin looks nice, but it’s too complicated to administer and it often breaks down after Zabbix upgrade.

Don’t complicate your administration with plugins like Weathermap – use Zabbix maps.

In this tutorial, we learn how to create interactive Zabbix network map that can show link traffic (bandwidth) and change the color of the link if there are some problems (red if link goes down or yellow if there is high utilization).

Don’t worry if you have never created a Zabbix map, because I will guide you step-by-step using various examples.

We will configure Zabbix topology map consisting of three hosts just as shown in the picture below.

example of zabbix map with two links between hosts

Check out my post “Monitor Cisco Switch or Router with SNMP template” if you are just starting with Zabbix and you need to monitor your network routers and switches.

Step 1: Create Zabbix network map

To create a network map go to “Maps” under the “Monitoring” tab and click on “Create map” option just as shown in the picture below.

Picture showing how to create a network map in Zabbix - Step 1
Picture showing how to create a network map in Zabbix – Step 1

Name your map and choose dimensions – I will set 900 to the width and 700 for height. Select “Number of problems” under “Display problems” options.

Then, under “Advance labels” select “Label” from the dropdown menu “Host Label type” and select “Nothing” from the “Image label type” dropdown menu.

You can change other things, but for now that will not be necessary. Hit the “Add” button when you are done with configuring.

Picture showing how to create a network map in Zabbix - Step 2
Picture showing how to create a network map in Zabbix – Step 2

You can always return later and change map settings using “Properties” option under “Monitoring” → “Maps” just as shown in the picture below.

Picture showing where you can create or edit Zabbix maps
Picture showing where you can create or edit Zabbix maps

Let’s put some hosts and links on our newly created maps! Click on the “Constructor” option and move to the next step.

Step 2: Add host (map element) on Zabbix map

Just for convenience’s sake we will change some options on the map editor (constructor). Set “On” for “Expand macros” and “20×20” distance for grid lines. Also, make sure that grids are shown on the map.

Picture explaining map editor (constructor) options
Picture explaining map editor (constructor) options

Now add your hosts on the map using steps from the image below.

Picture showing how to add hosts on the Zabbix network map
Picture showing how to add hosts on the Zabbix network map

If the above image is not self-explanatory, here are the steps explaining how to add a host to a Zabbix map:

  1. Click on “Add” on “Map element
  2. Select newly added element on the map
  3. Change “Type” to “Host
  4. Describe “Label” on the host using free text input, or macros or live data from items (more about this later)
  5. Select you host
  6. Select icon for your host, I will use the icon “Router_symbol_(96)”, but you can select something else or even upload a custom icon.
  7. Click on “Apply” button
  8. Update map (don’t forget this!)

Step 4 is a bit confusing so I will explain it with more details.

In my example, I m using macro “{HOSTNAME}” to display hostname that is set on Zabbix host and macro “{HOST.IP}” to display his IP address.

You can display live data from any item inside the host label on Zabbix map using the {host:key.func(param)} macro, but only with avg, last, min and max trigger functions.

In my example, I m displaying the latest value from the item called “ICMP response time” (key “icmppingsec“):

{HOSTNAME} ({HOST.IP})
Latency: {{HOSTNAME}:icmppingsec.last(0)}

Function “last()” tells Zabbix to display the latest data from the item, but you can also use avgmin and max  functions like this:

Latency (now):                   {{HOSTNAME}:icmppingsec.last(0)}
Latency (avg. in last 30 min):   {{HOSTNAME}:icmppingsec.avg(30m)}
Latency (max. in last 24h):      {{HOSTNAME}:icmppingsec.max(24h)}

If you don’t know the item key name, you can find that out using “Latest data” tool with enabled “Show details” in filter just as shown in the picture below.

Picture showing how to find out item key names in Zabbix using latest data option
Picture showing how to find out item key names in Zabbix using latest data option

Step 3: Add a link between two hosts on the Zabbix map

Now that we have our hosts on the map let’s add some links between them.

We will configure links to display current network interface inbound/outbound bandwidth and max. hardware speed.

Also, we will connect links with triggers so they will change color if there are some problems: green if everything is OK, red if the interface is down and yellow if bandwidth utilization is over 90%.

All the necessary steps to configure links are shown below.

Picture showing how to add link between two host on Zabbix map
Picture showing how to add link between two host on Zabbix map
  1. Click on one host, then hold the CTRL key and click on another host
  2. Click on “Add” beside “Link” menu to add a link – a new window will appear
  3. Click on “Edit” under “Links” sections
  4. Describe “Label” on the link using free text input, or macros or live data from items (more about this later)
  5. Add triggers on the link and select colors that will appear if they are in a problem state
  6. Click on “Apply” button
  7. Update map (don’t forget this!)

Remember how we displayed live data inside the host label using the “{host:key.func(param)}” macro? We can do the same with the link label, for example you can set this inside the label:

In:{re01internetgw:net.if.in[ifHCInOctets.2].last(0)} / Out:{re01internetgw:net.if.in[ifHCOutOctets.2].last(0)} [{re01internetgw:net.if.speed[ifHighSpeed.2].last(0)}]
re01internetgw:Gi0/0 <> Gi0/1 (core)

And it will resolve to this when viewed on the map:

Picture showing Zabbix map with live data on label

Step 4: Add multiple links between two hosts on the map

Unfortunately, Zabbix maps are not perfect, they can’t display labels on two or more links without overlapping and links themselves are barely visible.

Luckily there is a workaround for that. You need to upload a transparent image that we will use to route links via a different path.

Download image circle_transparent_4x4 (right click + save links as) and import in Zabbix as custom icon just as shown in the picture below.

Picture showing how to upload a custom icon to Zabbix
Picture showing how to upload a custom icon to Zabbix

Next, add new map element with “Add” button, then click on that element, select type as “Image“, set icons to “circle_transparent_4x4” and hit “Apply” and “Update” map afterwards.

Picture showing how to add additional link without overlapping between two hosts on Zabbix map - Step 1
Picture showing how to add additional link without overlapping between two hosts on Zabbix map – Step 1

Well done! Now you have a barley visable circle on the map that you can use to route links via diffrent path. Using instructions from the picture bellow add one link from that circle to the host A and another link from the circle to the host B.

Picture showing how to add additional link without overlapping between two hosts on Zabbix map – Step 2

The final outcome should look like this:

Picture showing a example of Zabbix map with live data display

You can also use more circles to draw multiple parallel links on a map like this one:

Picture showing how to set two links between hosts

CONGRATULATIONS!
Now you know how to configure Zabbix maps!

CONTINUE TO LEARN MORE
Examples of Zabbix maps (screenshots)
Configure map navigation tree on dashboard
Setting custom background image on map

Step 5: Examples, Tips and Tricks

a. Zabbix maps examples (screenshots)

Run out of ideas for Zabbix maps? Need more examples? Check out these screenshots:

b. Configure “Map navigation tree” widget on dashboard

Zabbix has a “Map navigation tree” widget that you can use on the dashboard. “Map navigation tree” widget enables you to sort and view maps hierarchically just as shown in the example below.

Example of Zabbix map navigation tree
Picture shows an example of Zabbix map navigation tree

First, create a dashboard just for maps or use the existing dashboard if you want to combine a “Map navigation tree” widget with others.

Picture showing how to configure a Zabbix map navigation tree widget - Step 1
Picture showing how to configure a Zabbix map navigation tree widget – Step 1

On your new dasboard add “Map navigation tree” widget.

Picture showing how to configure a Zabbix map navigation tree widget - Step 2
Picture showing how to configure a Zabbix map navigation tree widget – Step 2

Then add tree element (map) on the “Map navigation tree” widget.

Picture showing how to configure a Zabbix map navigation tree widget - Step 3
Picture showing how to configure a Zabbix map navigation tree widget – Step 3

Great job! Now we must define “Map” widget on the same dashboard that will render maps from “Map navigation tree” widget.

Picture showing how to configure a Zabbix map navigation tree widget - Step 4
Picture showing how to configure a Zabbix map navigation tree widget – Step 4

Add other maps in a hierarchical way or as you wish.

Picture showing how to configure a Zabbix map navigation tree widget - Step 5
Picture showing how to configure a Zabbix map navigation tree widget – Step 5

c. Custom background image in Zabbix map

You can set custom background image in Zabbix maps.

First, you need to upload the image to Zabbix image repository just as shown in the picture below.

Picture showing how to add custom background image on Zabbix for use on maps
Picture showing how to add custom background image on Zabbix for use on maps

Second, you need to open “Properties” of the map and set your newly added image file as a “Background image”.

Picture showing how to set custom background image on Zabbix map
Picture showing how to set custom background image on Zabbix map


Thank you for reading.

Scroll Up