Mapping Zabbix problems to existing Dynatrace entities

By adding a tag to a Zabbix problem you can send problem opening events to any Dynatrace entity. This is useful for example if Zabbix monitors entities such as databases or services which are also monitored by Dynatrace. By utilizing this extension functionality, you will have the proper mapping of events between Zabbix host entities and your existing Dynatrace entities.

Enabling the mapping

  1. Configure the name of the Zabbix tag in the extension configuration in the option Zabbix tag for Dynatrace entities. This tag will be evaluated by the extension and its value will be used for mapping when Zabbix problems are synchronized. For example, use the name DT_Entity

  2. Configure the entitySelector cache value in the extension configuration in the option Dynatrace entitySelector cache timeout or leave the default value. This option specifies how long will the resolved value of each entitySelector (see below) be cached in the extension to prevent excessive API calls to Dynatrace.

  3. Save the extension configuration in Dynatrace UI

  4. Add this tag in Zabbix configuration to the desired templates or hosts. The value of the tag can have two formats

    1. Dynatrace Entity ID, such as SERVICE-95887E903BDA9175 Only a single Entity ID can be used with this format.

    2. Dynatrace entitySelector, such as type("SERVICE"),tag("MyTag")The entity selector may evaluate to any entity type or list of entities. The resolved value of entitySelector is cached in the extension.

Mapping process

When a problem is opened in Zabbix, the extension:

  1. Iterates through the tags of the Zabbix problem.

  2. For each problem tag with the key specified in the extension configuration option:

    1. if the tag value matches the Entity ID format, it will use the entity ID, otherwise

    2. considers the value as Dynatrace entitySelector. It will try to look up the resolved entitySelector in the cache. If it’s not in the cache it will query Dyantrace Entities API to resolve the entitySelector and store it in the cache

  3. If at least one Dynatrace Entity ID was found using resolved entitySelector or directly by value:

    1. extension will send the problem opening event to each entity, otherwise

    2. the problem is sent to the corresponding CUSTOM_DEVICE entity or HOST entity in Dynatrace representing the Zabbix host in Dynatrace.

Be careful with the scope when using the entitySelector. The extension will send a problem opening event to each Dynatrace entity.

Especially in combination with allowDavisMerge set to false, this may result in many separate problems in Dynatrace for a single Zabbix problem.

Configuration example

This example illustrates how to configure Zabbix to send events to Dynatrace entities using Zabbix templates. In this case database services.

Add the configured Zabbix tag to the desired template as shown in the figure. You can use any existing templates.

In this case, we are using the Dynatrace entitySelector to send any future Zabbix problems generated from triggers in this template to the corresponding database service in Dynatrace using Zabbix macro {HOST.NAME}.

 

Ensure the template is linked to your Zabbix hosts. In this case, it’s the Zabbix host named ttrss representing the database.

 

Zabbix will attach the tag to problems created by triggers in this template automatically. You can see the it in the figure, including the expanded macro.

 

As soon as the extension processes this problem, it will look up entities specified by the value of the tag and the extension will send problems to each entity in Dynatrace.

The Zabbix problem may have multiple tags - problem opening events will be sent to each entity.

In this example, the entitySelector resolved to a single MySQL database service in Dynatrace named ttrss.