Graph Filtering Gotcha When Upgrading from Zabbix 5.0 to 6.0

The current Long Term Support (LTS) version series of Zabbix is 6.0, released in February 2022. The previous LTS version was 5.0, released in May 2020. Many of us are upgrading the Zabbix installation from 5.0 to 6.0 series these days, here is one catch to be aware of.

In 5.0, when viewing graphs of a host, you have a filter that you can use to select one or more individual graphs to be shown on the same page when need arises:

In this example above I have already selected one graph and I’m now selecting another graph. After that I can click Apply and I can see both graphs at the same time and compare them as I need:

These graphs are coming from a template that discovers the switch interfaces and creates items and graphs automatically. The graph names are using the low-level discovery (LLD) macros:

The {#IFNAME} and {#IFALIAS} LLD macros are automatically populated with appropriate data, as shown in the graph names above.

Now, let’s upgrade Zabbix to 6.0 (6.0.5 in this case), and see how the graph filtering for Switch1 looks like:

In the filtering fields there is no Graphs filter anymore. There is Name field, but that is for very coarse filtering only, it is not possible to use it to get the earlier “Switch2-PoE” and “Raspi3bplus” graphs (and only them) to be shown at the same time.

The new filtering system in Zabbix 6.0 is using tags. Basically Zabbix retrieves all tags in all items for this host, and shows the tag names and values in the Subfilter area.

In this example the tag-based filtering does no good. The only tag is the Application tag that was automatically created from the Application fields from the items as there is no application concept anymore in Zabbix since version 5.4. Clicking the Network Interfaces tag value does nothing in this case because, well, all the items (the interface metrics) were originally in the Network Interfaces application, thus they all have the same tag.

So, how can I use tags for filtering specific graphs for this host?

In graph prototype configuration there is no tagging option, but items can have tags, and Zabbix 6.0 is so clever that it knows that the graphs are created based on item data, so item tags (and in this discovery-based example, item prototype tags) can be used.

In Zabbix 5.0 there were no tag options in the item discovery configuration:

Again, that was from the old Zabbix 5.0, let’s compare it to the item prototype configuration in Zabbix 6.0:

In the Tags page there is one tag, the automatically (during the Zabbix 5.0 to 6.0 upgrade) created tag:

Now, I can create new tags. Using fixed tags (identical names or values for all discovered items) does not make the case any better, but using the LLD macros will help in filtering. Let’s create these tags:

  • Name: interface
    • Value: {#IFNAME}
  • Name: description
    • Value: {#IFALIAS}

I’m using these LLD macros because they are used in the graph names as well, and they contain the data I’m interested in filtering for.

Also, as instructed in the tag guidelines for Zabbix templates, I’ll also add the component tag:

  • Name: component
    • Value: network

I don’t need the old Application tag anymore, so I’ll delete it. The item prototype tags page looks now like this:

That was only one of the 10 item prototypes I had in this template, but there is the Mass update button in the item prototypes list to make the same tag changes to the other 9 item prototypes quickly.

Now I have to wait for the interface discovery to happen again (or reconfigure the discovery rule interval to a smaller value temporarily), and after that the Subfilter section in the graphs page looks very different:

Now there are two lists of tag values that I can use for filtering: the interface descriptions and the interface names. (By the way, in this example case only the interfaces that are in Up state are discovered, therefore this interface list is missing some of the switch interfaces: some interfaces simply do not exist in Zabbix at the moment.)

Filtering happens simply by clicking the tags I’m interested in:

Conclusion

If you are currently running Zabbix 5.0 and are planning the upgrade to Zabbix 6.0, the graphs filtering will change, as described above, and your manual actions will be required to keep graph filtering options available to your users.

Because the item prototypes don’t have tags in 5.0, you cannot prepare the tags before the upgrade. You must do the Zabbix upgrade first (with all the steps that are described in the usual upgrade instructions in the Zabbix manual), and only when you are running 6.0 you can change the tag configurations in your templates to support the new-style graph filtering.

You can also go to Zabbix template repository and download and import new templates for your specific Zabbix version there.

Updated: May 31, 2022 — 11:14

Leave a Reply