1 Configuring a template

Overview

Configuring a template requires that you first create a template by defining its general parameters and then you add entities (items, triggers, graphs, etc.) to it.

Creating a template

To create a template, do the following:

  1. Go to Data collectionTemplates.
  2. Click on Create template.
  3. Edit template attributes.

The Templates tab contains general template attributes.

1 Configuring a template - 图1

All mandatory input fields are marked with a red asterisk.

Template attributes:

ParameterDescription
Template nameUnique template name.
Alphanumerics, spaces, dots, dashes, and underscores are allowed.
Leading and trailing spaces are not allowed.
Visible nameIf you set this name, it will be the one visible in lists, maps, etc.
TemplatesLink one or more templates to this template. All entities (items, triggers, etc.) will be inherited from the linked templates.
To link a new template, start typing the template name in the Link new templates field. A list of matching templates will appear; scroll down to select. Alternatively, you may click on Select next to the field and select templates from the list in a pop-up window. The templates that are selected in the Link new templates field will be linked to the template when the template configuration form is saved or updated.
To unlink a template, use one of the two options in the Linked templates block:
Unlink - unlink the template, but preserve its entities (items, triggers, etc.);
Unlink and clear - unlink the template and remove all of its entities (items, triggers, etc.).
Template groupsGroups the template belongs to.
DescriptionTemplate description.
Vendor and versionTemplate vendor and version; displayed only when updating existing templates (out-of-the-box templates provided by Zabbix, imported templates, or templates modified through the Template API) if the template configuration contains such information.
Cannot be modified in Zabbix frontend.
For out-of-the-box templates, version is displayed as follows: major version of Zabbix, delimiter (“-“), revision number (increased with each new version of the template, and reset with each major version of Zabbix). For example, 6.4-0, 6.4-5, 7.0-0, 7.0-3.

The Tags tab allows you to define template-level tags. All problems of hosts linked to this template will be tagged with the values entered here.

1 Configuring a template - 图2

User macros, {INVENTORY.*} macros, {HOST.HOST}, {HOST.NAME}, {HOST.CONN}, {HOST.DNS}, {HOST.IP}, {HOST.PORT} and {HOST.ID} macros are supported in tags.

The Macros tab allows you to define template-level user macros as a name-value pairs. Note that macro values can be kept as plain text, secret text, or Vault secret. Adding a description is also supported.

1 Configuring a template - 图3

If you select the Inherited and template macros option, you may also view macros from linked templates and global macros that the template will inherit, as well as the values that the macros will resolve to.

1 Configuring a template - 图4

For convenience, links to the respective templates, as well as a link to global macro configuration is provided. It is also possible to edit a linked template macro or global macro on the template level, effectively creating a copy of the macro on the template.

The Value mapping tab allows to configure human-friendly representation of item data in value mappings.

Buttons:

1 Configuring a template - 图5Add the template. The added template should appear in the list.
1 Configuring a template - 图6Update the properties of an existing template.
1 Configuring a template - 图7Create another template based on the properties of the current template, including the entities (items, triggers, etc.) inherited from linked templates, but excluding template vendor and version.
1 Configuring a template - 图8Create another template based on the properties of the current template, including the entities (items, triggers, etc.) both inherited from linked templates and directly attached to the current template, but excluding template vendor and version.
1 Configuring a template - 图9Delete the template; entities of the template (items, triggers, etc.) remain with the linked hosts.
1 Configuring a template - 图10Delete the template and all its entities from linked hosts.
1 Configuring a template - 图11Cancel the editing of template properties.

Adding items, triggers, graphs

Items have to be added to a template first. Triggers and graphs cannot be added without the corresponding item.

To add items to the template, do the following:

  1. Go to Data collection → Hosts (or Templates).
  2. Click on Items in the row of the required host/template.
  3. Mark the checkboxes of items you want to add to the template.
  4. Click on Copy below the item list.
  5. Select the template (or group of templates) the items should be copied to and click on Copy.

All the selected items should be copied to the template.

Adding triggers and graphs is done in a similar fashion (from the list of triggers and graphs respectively), again, keeping in mind that they can only be added if the required items are added first.

Adding dashboards

To add dashboards to a template in Data collectionTemplates, do the following:

  1. Click on Dashboards in the row of the template.
  2. Configure a dashboard following the guidelines of configuring dashboards.

The widgets that can be included in a template dashboard are: classic graph, graph prototype, clock, plain text, URL.

For details on accessing host dashboards that are created from template dashboards, see the host dashboard section.

Configuring low-level discovery rules

See the low-level discovery section of the manual.

Adding web scenarios

To add web scenarios to a template in Data collectionTemplates, do the following:

  1. Click on Web in the row of the template.
  2. Configure a web scenario following the usual method of configuring web scenarios.

Creating a template group

Only Super Admin users can create template groups.

To create a template group in Zabbix frontend, do the following:

  1. Go to: Data collection → Template groups.
  2. Click on Create template group in the upper right corner of the screen.
  3. Enter the group name in the form.

1 Configuring a template - 图12

To create a nested template group, use the ‘/‘ forward slash separator, for example Linux servers/Databases/MySQL. You can create this group even if none of the two parent template groups (Linux servers/Databases/) exist. In this case creating these parent template groups is up to the user; they will not be created automatically.
Leading and trailing slashes, several slashes in a row are not allowed. Escaping of ‘/‘ is not supported.

Once the group is created, you can click on the group name in the list to edit group name, clone the group or set additional option:

1 Configuring a template - 图13

Apply permissions to all subgroups - mark this checkbox and click on Update to apply the same level of permissions to all nested template groups. For user groups that may have had differing permissions assigned to nested template groups, the permission level of the parent template group will be enforced on the nested groups. This is a one-time option that is not saved in the database.

Permissions to nested template groups:

  • When creating a child template group to an existing parent template group, user group permissions to the child are inherited from the parent (for example, when creating Databases/MySQL if Databases already exists).
  • When creating a parent template group to an existing child template group, no permissions to the parent are set (for example, when creating Databases if Databases/MySQL already exists).