[comment]: # ({adaceae4-e8fbaf7c})
# 3 Templates

[comment]: # ({/adaceae4-e8fbaf7c})

[comment]: # ({8456e9da-02fec82c})
#### Overview

Templates are [exported](/manual/xml_export_import) with many related objects and object relations.

Template export contains:

-   Linked template groups
-   Linked host groups (if used in [host prototype](/manual/discovery/low_level_discovery/host_prototypes) configuration)
-   Template data
-   Linkage to other templates
-   Linkage to template groups
-   Directly linked items
-   Directly linked triggers
-   Directly linked graphs
-   Directly linked dashboards
-   Directly linked discovery rules with all prototypes
-   Directly linked web scenarios
-   Value maps

[comment]: # ({/8456e9da-02fec82c})

[comment]: # ({9a909adc-ca3e35f8})
#### Exporting

To export templates, do the following:

1. Go to *Data collection* → *Templates*.
2. Mark the checkboxes of the templates to export.
3. Click *Export* below the list.

![](../../../assets/en/manual/xml_export_import/export_templates.png)

Depending on the selected format, templates are exported to a local file with a default name:

-   `zabbix_export_templates.yaml` - in YAML export (default option for export);
-   `zabbix_export_templates.xml` - in XML export;
-   `zabbix_export_templates.json` - in JSON export.

[comment]: # ({/9a909adc-ca3e35f8})

[comment]: # ({4c282ebe-78f6f939})
#### Importing

To import templates, do the following:

1. Go to *Data collection* → *Templates*.
2. Click *Import* in the top right corner.
3. Select the import file.
4. Click *Import* in the bottom right corner of the configuration form.

![](../../../assets/en/manual/xml_export_import/import_templates.png){width="600"}

If you mark the *Advanced options* checkbox, a detailed list of all importable elements will be displayed - mark or unmark each import rule as required.

If you click the checkbox in the *All* row, all elements below it will be marked/unmarked.

Import rules:

|Rule|Description|
|----|-----------|
|*Update existing*|Existing elements will be updated using data from the import file. Otherwise, they will not be updated.|
|*Create new*|New elements will be created using data from the import file. Otherwise, they will not be created.|
|*Delete missing*|Existing elements not present in the import file will be removed. Otherwise, they will not be removed.<br>If *Delete missing* is marked for *Template linkage*, current template linkage not present in the import file will be unlinked. Entities (items, triggers, graphs, etc.) inherited from the unlinked templates will not be removed (unless the *Delete missing* option is selected for each entity as well).|

On the next screen, you will be able to view the content of a template being imported.
If this is a new template, all elements will be listed in green.
If updating an existing template, new template elements will be highlighted in green; removed template elements will be highlighted in red; elements that have not changed will be listed on a gray background.

![](../../../assets/en/manual/xml_export_import/import_templates_details.png){width="600"}

The menu on the left can be used to navigate through the list of changes.
The *Updated* section highlights all changes made to existing template elements.
The *Added* section lists new template elements.
The elements in each section are grouped by element type; click the gray arrow to expand or collapse the group of elements.

![](../../../assets/en/manual/xml_export_import/import_templates_menu.png)

Review template changes and then click *Import* to perform the template import.
A success or failure message of the import will be displayed in the frontend.

[comment]: # ({/4c282ebe-78f6f939})

[comment]: # ({a7446e09-c04b1514})
#### Export format

Export format in YAML:

```yaml
zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
  host_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Applications
  templates:
    - uuid: 56079badd056419383cc26e6a4fcc7e0
      template: VMware
      name: VMware
      description: |
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/

        Template tooling version used: 0.41
      groups:
        - name: Templates/Applications
      items:
        - uuid: 5ce209f4d94f460488a74a92a52d92b1
          name: 'VMware: Event log'
          type: SIMPLE
          key: 'vmware.eventlog[{$VMWARE.URL},skip]'
          history: 7d
          trends: '0'
          value_type: LOG
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          description: 'Collect VMware event log.'
          tags:
            - tag: component
              value: log
        - uuid: ee2edadb8ce943ef81d25dbbba8667a4
          name: 'VMware: Full name'
          type: SIMPLE
          key: 'vmware.fullname[{$VMWARE.URL}]'
          delay: 1h
          history: 7d
          trends: '0'
          value_type: CHAR
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          description: 'VMware service full name.'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
        - uuid: a0ec9145f2234fbea79a28c57ebdb44d
          name: 'VMware: Version'
          type: SIMPLE
          key: 'vmware.version[{$VMWARE.URL}]'
          delay: 1h
          history: 7d
          trends: '0'
          value_type: CHAR
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          description: 'VMware service version.'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
      discovery_rules:
        - uuid: 16ffc933cce74cf28a6edf306aa99782
          name: 'Discover VMware clusters'
          type: SIMPLE
          key: 'vmware.cluster.discovery[{$VMWARE.URL}]'
          delay: 1h
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          description: 'Discovery of clusters'
          item_prototypes:
            - uuid: 46111f91dd564a459dbc1d396e2e6c76
              name: 'VMware: Status of "{#CLUSTER.NAME}" cluster'
              type: SIMPLE
              key: 'vmware.cluster.status[{$VMWARE.URL},{#CLUSTER.NAME}]'
              history: 7d
              username: '{$VMWARE.USERNAME}'
              password: '{$VMWARE.PASSWORD}'
              description: 'VMware cluster status.'
              valuemap:
                name: 'VMware status'
              tags:
                - tag: cluster
                  value: '{#CLUSTER.NAME}'
                - tag: component
                  value: cluster
        - uuid: 8fb6a45cbe074b0cb6df53758e2c6623
          name: 'Discover VMware datastores'
          type: SIMPLE
          key: 'vmware.datastore.discovery[{$VMWARE.URL}]'
          delay: 1h
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          item_prototypes:
            - uuid: 4b61838ba4c34e709b25081ae5b059b5
              name: 'VMware: Average read latency of the datastore {#DATASTORE}'
              type: SIMPLE
              key: 'vmware.datastore.read[{$VMWARE.URL},{#DATASTORE},latency]'
              history: 7d
              username: '{$VMWARE.USERNAME}'
              password: '{$VMWARE.PASSWORD}'
              description: 'Amount of time for a read operation from the datastore (milliseconds).'
              tags:
                - tag: component
                  value: datastore
                - tag: datastore
                  value: '{#DATASTORE}'
            - uuid: 5355c401dc244bc588ccd18767577c93
              name: 'VMware: Free space on datastore {#DATASTORE} (percentage)'
              type: SIMPLE
              key: 'vmware.datastore.size[{$VMWARE.URL},{#DATASTORE},pfree]'
              delay: 5m
              history: 7d
              value_type: FLOAT
              units: '%'
              username: '{$VMWARE.USERNAME}'
              password: '{$VMWARE.PASSWORD}'
              description: 'VMware datastore space in percentage from total.'
              tags:
                - tag: component
                  value: datastore
                - tag: datastore
                  value: '{#DATASTORE}'
            - uuid: 84f13c4fde2d4a17baaf0c8c1eb4f2c0
              name: 'VMware: Total size of datastore {#DATASTORE}'
              type: SIMPLE
              key: 'vmware.datastore.size[{$VMWARE.URL},{#DATASTORE}]'
              delay: 5m
              history: 7d
              units: B
              username: '{$VMWARE.USERNAME}'
              password: '{$VMWARE.PASSWORD}'
              description: 'VMware datastore space in bytes.'
              tags:
                - tag: component
                  value: datastore
                - tag: datastore
                  value: '{#DATASTORE}'
            - uuid: 540cd0fbc56c4b8ea19f2ff5839ce00d
              name: 'VMware: Average write latency of the datastore {#DATASTORE}'
              type: SIMPLE
              key: 'vmware.datastore.write[{$VMWARE.URL},{#DATASTORE},latency]'
              history: 7d
              username: '{$VMWARE.USERNAME}'
              password: '{$VMWARE.PASSWORD}'
              description: 'Amount of time for a write operation to the datastore (milliseconds).'
              tags:
                - tag: component
                  value: datastore
                - tag: datastore
                  value: '{#DATASTORE}'
        - uuid: a5bc075e89f248e7b411d8f960897a08
          name: 'Discover VMware hypervisors'
          type: SIMPLE
          key: 'vmware.hv.discovery[{$VMWARE.URL}]'
          delay: 1h
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          description: 'Discovery of hypervisors.'
          host_prototypes:
            - uuid: 051a1469d4d045cbbf818fcc843a352e
              host: '{#HV.UUID}'
              name: '{#HV.NAME}'
              group_links:
                - group:
                    name: Applications
              group_prototypes:
                - name: '{#CLUSTER.NAME}'
                - name: '{#DATACENTER.NAME}'
              templates:
                - name: 'VMware Hypervisor'
              macros:
                - macro: '{$VMWARE.HV.UUID}'
                  value: '{#HV.UUID}'
                  description: 'UUID of hypervisor.'
              custom_interfaces: 'YES'
              interfaces:
                - ip: '{#HV.IP}'
        - uuid: 9fd559f4e88c4677a1b874634dd686f5
          name: 'Discover VMware VMs'
          type: SIMPLE
          key: 'vmware.vm.discovery[{$VMWARE.URL}]'
          delay: 1h
          username: '{$VMWARE.USERNAME}'
          password: '{$VMWARE.PASSWORD}'
          description: 'Discovery of guest virtual machines.'
          host_prototypes:
            - uuid: 23b9ae9d6f33414880db1cb107115810
              host: '{#VM.UUID}'
              name: '{#VM.NAME}'
              group_links:
                - group:
                    name: Applications
              group_prototypes:
                - name: '{#CLUSTER.NAME} (vm)'
                - name: '{#DATACENTER.NAME}/{#VM.FOLDER} (vm)'
                - name: '{#HV.NAME}'
              templates:
                - name: 'VMware Guest'
              macros:
                - macro: '{$VMWARE.VM.UUID}'
                  value: '{#VM.UUID}'
                  description: 'UUID of guest virtual machine.'
              custom_interfaces: 'YES'
              interfaces:
                - ip: '{#VM.IP}'
      tags:
        - tag: class
          value: software
        - tag: target
          value: vmware
      macros:
        - macro: '{$VMWARE.PASSWORD}'
          description: 'VMware service {$USERNAME} user password'
        - macro: '{$VMWARE.URL}'
          description: 'VMware service (vCenter or ESX hypervisor) SDK URL (https://servername/sdk)'
        - macro: '{$VMWARE.USERNAME}'
          description: 'VMware service user name'
      valuemaps:
        - uuid: 3c59c22905054d42ac4ee8b72fe5f270
          name: 'VMware status'
          mappings:
            - value: '0'
              newvalue: gray
            - value: '1'
              newvalue: green
            - value: '2'
              newvalue: yellow
            - value: '3'
              newvalue: red
```

[comment]: # ({/a7446e09-c04b1514})

[comment]: # ({d8918da6-2c61d3f8})
## Exported elements

Exported elements are explained in the tables below.

|Element|<|Type|Description|
|-|---|---|-----------------------|
|template_groups|<| |(required) Root element for template groups.|
|<|uuid|string|(required) Unique identifier for this template group.|
|^|name|string|(required) Template group name.|
|host_groups|<| |(required) Root element for host groups that are used by host prototypes.|
|<|uuid|string|(required) Unique identifier for this host group.|
|^|name|string|(required) Host group name.|
|templates|<| |Root element for [templates](#templates).|

[comment]: # ({/d8918da6-2c61d3f8})

[comment]: # ({a0f1ac47-bdfd38fc})
### Templates

|Element|<|Type|Description|
|-|---|---|-----------------------|
|uuid|<|string|(required) Unique identifier for this template.|
|template|<|string|(required) Unique template name.|
|name|<|string|Visible template name.|
|description|<|text|Template description.|
|vendor|<| |Root element for template vendor (present if the exported template contains vendor data).|
|<|name|string|(required) Template vendor name.|
|^|version|string|(required) Template version.<br>For [out-of-the-box templates](/manual/config/templates_out_of_the_box), 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-3, 7.0-0, 7.0-3.|
|templates|<| |Root element for linked templates.|
| |name|string|(required) Template name.|
|groups|<| |Root element for template groups.|
| |name|string|(required) Template group name.|
|items|<| |Root element for [template items](#template-items).|
|discovery_rules|<| |Root element for [template low-level discovery rules](#template-low-level-discovery-rules).|
|httptests|<| |Root element for [template web scenarios](#template-web-scenarios).|
|tags|<| |Root element for template tags.|
|<|tag|string|(required) Tag name.|
|^|value|string|Tag value.|
|macros|<| |Root element for template user macros.|
|<|macro|string|(required) User macro name.|
|^|type|string|User macro type.<br>Possible values:^[1](#footnotes)^ TEXT (0, default), SECRET\_TEXT (1), VAULT (2).<br>See also: [User macro object](/manual/api/reference/usermacro/object) (`type`).|
|^|value|string|User macro value.|
|^|description|string|User macro description.|
|dashboards|<| |Root element for [template dashboards](#template-dashboards).|
|valuemaps|<| |Root element for [template value maps](#template-value-maps).|

[comment]: # ({/a0f1ac47-bdfd38fc})

[comment]: # ({8700d81a-18631c1b})
#### Template items

|Element|<|Type|Description|
|-|---|---|-----------------------|
|uuid|<|string|(required) Unique identifier for this item.|
|name|<|string|(required) Item name.|
|type|<|string|Item type.<br>Possible values:^[1](#footnotes)^ ZABBIX\_PASSIVE (0, default), TRAP (2), SIMPLE (3), INTERNAL (5), ZABBIX\_ACTIVE (7), EXTERNAL (10), ODBC (11), IPMI (12), SSH (13), TELNET (14), CALCULATED (15), JMX (16), SNMP\_TRAP (17), DEPENDENT (18), HTTP\_AGENT (19), SNMP\_AGENT (20), ITEM\_TYPE\_SCRIPT (21), ITEM\_TYPE\_BROWSER (22).|
|snmp\_oid|<|string|(required for SNMP\_AGENT items) SNMP object ID.|
|key|<|string|(required) Item key.|
|delay|<|string|Update interval of the item.<br>Default: 1m. The value will always be 0 for TRAP items.|
|history|<|string|Time period (using [time suffix](/manual/appendix/suffixes#time-suffixes), [user macro](/manual/config/macros/user_macros) or [LLD macro](/manual/config/macros/lld_macros)) of how long the history data should be stored.<br>Default: 31d.|
|trends|<|string|Time period (using [time suffix](/manual/appendix/suffixes#time-suffixes), [user macro](/manual/config/macros/user_macros) or [LLD macro](/manual/config/macros/lld_macros)) of how long the trends data should be stored.<br>Default: 365d.|
|status|<|string|Item status.<br>Possible values:^[1](#footnotes)^ ENABLED (0, default), DISABLED (1).|
|value\_type|<|string|Received value type.<br>Possible values:^[1](#footnotes)^ FLOAT (0), CHAR (1), LOG (2), UNSIGNED (3, default), TEXT (4), BINARY (5).|
|allowed\_hosts|<|string|List of comma-delimited IP addresses of hosts allowed to send data for the item.<br>Supported for TRAP and HTTP\_AGENT items.|
|units|<|string|Received value units (bps, B, etc.).|
|params|<|text|Additional parameters depending on the type of the item (executed script for SSH and TELNET items; SQL query for ODBC items; formula for CALCULATED items; the script for ITEM\_TYPE\_SCRIPT and ITEM\_TYPE\_BROWSER items).|
|ipmi\_sensor|<|string|IPMI sensor.<br>Supported for IPMI items.|
|authtype|<|string|Authentication type.<br>Supported for SSH and HTTP\_AGENT items.<br>Possible values for SSH items:^[1](#footnotes)^ PASSWORD (0, default), PUBLIC\_KEY (1).<br>Possible values for HTTP\_AGENT items:^[1](#footnotes)^ NONE (0, default), BASIC (1), NTLM (2), Kerberos (3), or Digest (4).|
|username|<|string|(required for SSH and TELNET items) Username for authentication.<br>Supported for SIMPLE, ODBC, JMX and HTTP\_AGENT items.<br>When used for JMX items, `password` (see below) should also be specified or both elements should be left blank.|
|password|<|string|(required for SSH and TELNET items) Password for authentication.<br>Supported for SIMPLE, ODBC, JMX and HTTP\_AGENT items.<br>When used for JMX items, `username` (see above) should also be specified or both elements should be left blank.|
|publickey|<|string|(required for SSH items) Name of the public key file.|
|privatekey|<|string|(required for SSH items) Name of the private key file.|
|description|<|text|Item description.|
|inventory\_link|<|string|Host inventory field that is populated by the item.<br>Possible values:^[1](#footnotes)^ NONE (0), ALIAS (4), etc. (see [Host inventory](/manual/api/reference/host/object#host-inventory) for supported fields).|
|valuemap|<| |Root element for item value maps.|
| |name|string|(required) Name of the value map to use for the item.|
|logtimefmt|<|string|Format of the time in log entries.<br>Supported for items of LOG value type.|
|preprocessing|<| |Root element for item value preprocessing.|
| |step| |Root element for [template item value preprocessing steps](#template-item-value-preprocessing-steps).|
|jmx\_endpoint|<|string|JMX endpoint.<br>Supported for JMX items.|
|master_item|<| |(required for DEPENDENT items) Root element for dependent item's master item.|
| |key|string|(required) Dependent item's master item key.|
|timeout|<|string|Item data polling request timeout.<br>Supported for [Timeouts](/manual/web_interface/frontend_sections/administration/general#timeouts) list of item types.|
|url|<|string|(required for HTTP\_AGENT items) URL string.|
|query_fields|<| |Root element for query parameters.<br>Supported for HTTP\_AGENT items.|
|<|name|string|(required for HTTP\_AGENT items) Query parameter name.|
|^|value|string|Query parameter value.<br>Supported for HTTP\_AGENT items.|
|parameters|<| |Root element for user-defined parameters.<br>Supported for ITEM\_TYPE\_SCRIPT and ITEM\_TYPE\_BROWSER items.|
|<|name|string|(required for ITEM\_TYPE\_SCRIPT and ITEM\_TYPE\_BROWSER items) User-defined parameter name.|
|^|value|string|User-defined parameter value.<br>Supported for ITEM\_TYPE\_SCRIPT and ITEM\_TYPE\_BROWSER items.|
|posts|<|string|HTTP(S) request body data.<br>Supported for HTTP\_AGENT items.|
|status\_codes|<|string|Ranges of required HTTP status codes, separated by commas.<br>Supported for HTTP\_AGENT items.|
|follow\_redirects|<|string|Follow response redirects while polling data.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ NO (0), YES (1, default).|
|post\_type|<|string|Type of post data body.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ RAW (0, default), JSON (2), XML (3).|
|http\_proxy|<|string|HTTP(S) proxy connection string.<br>Supported for HTTP\_AGENT items.|
|headers|<| |Root element for HTTP(S) request headers.<br>Supported for HTTP\_AGENT items.|
|<|name|string|(required for HTTP\_AGENT items) Header name.|
|^|value|string|(required for HTTP\_AGENT items) Header value.|
|retrieve\_mode|<|string|What part of response should be stored.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ BODY (0, default), HEADERS (1), BOTH (2).|
|request\_method|<|string|Request method type.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ GET (0, default), POST (1), PUT (2), HEAD (3).|
|output\_format|<|string|How to process response.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ RAW (0, default), JSON (1).|
|allow\_traps|<|string|Allow to populate value similarly to the trapper item.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|ssl\_cert\_file|<|string|Public SSL Key file path.<br>Supported for HTTP\_AGENT items.|
|ssl\_key\_file|<|string|Private SSL Key file path.<br>Supported for HTTP\_AGENT items.|
|ssl\_key\_password|<|string|Password for SSL Key file.<br>Supported for HTTP\_AGENT items.|
|verify\_peer|<|string|Whether to validate that the host's certificate is authentic.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|verify\_host|<|string|Whether to validate that the host name for the connection matches the one in the host's certificate.<br>Supported for HTTP\_AGENT items.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|tags|<| |Root element for item tags.|
|<|tag|string|(required) Tag name.|
|^|value|string|Tag value.|
|triggers|<|<|Root element for [template item triggers](#template-item-triggers).|

::: noteclassic
See also: [Item object](/manual/api/reference/item/object) (refer to the relevant property with a matching name).
:::

[comment]: # ({/8700d81a-18631c1b})

[comment]: # ({b0814e0a-497cb193})
##### Template item value preprocessing steps

|Element|<|Type|Description|
|-|---|---|-----------------------|
|type|<|string|(required) The item value preprocessing step type.<br>Possible values:^[1](#footnotes)^ MULTIPLIER (1), RTRIM (2), LTRIM (3), TRIM (4), REGEX (5), BOOL\_TO\_DECIMAL (6), OCTAL\_TO\_DECIMAL (7), HEX\_TO\_DECIMAL (8), SIMPLE\_CHANGE (9, calculated: received value - previous value), CHANGE\_PER\_SECOND (10, calculated: (received value - previous value)/(time now - time of last check)), XMLPATH (11), JSONPATH (12), IN\_RANGE (13), MATCHES\_REGEX (14), NOT\_MATCHES\_REGEX (15), CHECK\_JSON\_ERROR (16), CHECK\_XML\_ERROR (17), CHECK\_REGEX\_ERROR (18), DISCARD\_UNCHANGED (19), DISCARD\_UNCHANGED\_HEARTBEAT (20), JAVASCRIPT (21), PROMETHEUS\_PATTERN (22), PROMETHEUS\_TO\_JSON (23), CSV\_TO\_JSON (24), STR\_REPLACE (25), CHECK\_NOT\_SUPPORTED (26), XML\_TO\_JSON (27), SNMP\_WALK\_VALUE (28), SNMP\_WALK\_TO\_JSON (29), SNMP\_GET\_VALUE (30).|
|parameters|<| |(required) Root element for parameters of the item value preprocessing step.|
| |parameter|string|Individual parameter of the item value preprocessing step.|
|error\_handler|<|string|Action type used in case of preprocessing step failure.<br>Possible values:^[1](#footnotes)^ ORIGINAL\_ERROR (0, default), DISCARD\_VALUE (1), CUSTOM\_VALUE (2), CUSTOM\_ERROR (3).|
|error\_handler\_params|<|string|Error handler parameters.|

::: noteclassic
See also: [Item preprocessing object](/manual/api/reference/item/object#item-preprocessing) (refer to the relevant property with a matching name).
:::

[comment]: # ({/b0814e0a-497cb193})

[comment]: # ({fbceca7a-8aada697})
##### Template item triggers

|Element|<|Type|Description|
|-|---|---|-----------------------|
|uuid|<|string|(required) Unique identifier for this trigger.|
|expression|<|string|(required) Trigger expression.|
|recovery\_mode|<|string|Basis for generating OK events.<br>Possible values:^[1](#footnotes)^ EXPRESSION (0, default), RECOVERY\_EXPRESSION (1), NONE (2).|
|recovery\_expression|<|string|Trigger recovery expression.|
|correlation\_mode|<|string|Correlation mode (no event correlation or event correlation by tag).<br>Possible values:^[1](#footnotes)^ DISABLED (0, default), TAG\_VALUE (1).|
|correlation\_tag|<|string|The tag name to be used for event correlation.|
|name|<|string|(required) Trigger name.|
|event\_name|<|string|Event name.|
|opdata|<|string|Operational data.|
|url\_name|<|string|Label for the URL associated with the trigger.|
|url|<|string|URL associated with the trigger.|
|status|<|string|Trigger status.<br>Possible values:^[1](#footnotes)^ ENABLED (0, default), DISABLED (1).|
|priority|<|string|Trigger severity.<br>Possible values:^[1](#footnotes)^ NOT\_CLASSIFIED (0, default), INFO (1), WARNING (2), AVERAGE (3), HIGH (4), DISASTER (5).|
|description|<|text|Trigger description.|
|type|<|string|Event generation type (single problem event or multiple problem events).<br>Possible values:^[1](#footnotes)^ SINGLE (0, default), MULTIPLE (1).|
|manual\_close|<|string|Manual closing of problem events.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|dependencies|<| |Root element for dependencies.|
|<|name|string|(required) Dependency trigger name.|
|^|expression|string|(required) Dependency trigger expression.|
|^|recovery\_expression|string|Dependency trigger recovery expression.|
|tags|<| |Root element for trigger tags.|
|<|tag|string|(required) Tag name.|
|^|value|string|Tag value.|

::: noteclassic
See also: [Trigger object](/manual/api/reference/trigger/object) (refer to the relevant property with a matching name).
:::

[comment]: # ({/fbceca7a-8aada697})

[comment]: # ({13cb0aa5-2fdd304e})
#### Template low-level discovery rules

::: noteimportant
Most template low-level discovery rule elements are the same as for [template items](#template-items).
The table below describes those elements that differ from template items.
:::

|Element|<|Type|Description|
|-|---|---|-----------------------|
|type|<|string|Item type.<br>Possible values:^[1](#footnotes)^ ZABBIX\_PASSIVE (0, default), TRAP (2), SIMPLE (3), INTERNAL (5), ZABBIX\_ACTIVE (7), EXTERNAL (10), ODBC (11), IPMI (12), SSH (13), TELNET (14), JMX (16), DEPENDENT (18), HTTP\_AGENT (19), SNMP\_AGENT (20), ITEM\_TYPE\_SCRIPT (21), ITEM\_TYPE\_BROWSER (22).|
|key|<|string|(required) The low-level discovery rule key.|
|filter|<| |Root element for [template low-level discovery rule filters](#template-low-level-discovery-rule-filters).|
|lifetime|<|string|Time period (using seconds, [time suffix](/manual/appendix/suffixes#time-suffixes), or [user macro](/manual/config/macros/user_macros)), after which no longer discovered resources will be deleted.<br>Default: 7d.|
|lifetime_type|<|string|Scenario for deleting lost LLD resources.<br>Possible values: DELETE\_NEVER, DELETE\_IMMEDIATELY, DELETE\_AFTER.|
|enabled_lifetime|<|string|Time period (using seconds, [time suffix](/manual/appendix/suffixes#time-suffixes), or [user macro](/manual/config/macros/user_macros)), after which no longer discovered resources will be disabled.|
|enabled_lifetime_type|<|string|Scenario for disabling lost LLD resources.<br>Possible values: DISABLE\_NEVER, DISABLE\_IMMEDIATELY, DISABLE\_AFTER.|
|item\_prototypes|<| |Root element for template item prototype elements, which are the same as for [template items](#template-items).|
|trigger\_prototypes|<| |Root element for template trigger prototype elements, which are the same as for [template item triggers](#template-item-triggers).|
|graph\_prototypes|<| |Root element for template graph prototype elements, which are the same as for [host graphs](/manual/xml_export_import/hosts#host-graphs).|
|host\_prototypes|<| |Root element for template host prototype elements, which are the same as for [hosts](/manual/xml_export_import/hosts#hosts).|
|master_item|<|string|(required for DEPENDENT rules) Root element for the dependent rule's master item.|
|lld\_macro\_paths|<| |Root element for low-level discovery rule macro paths.|
|<|lld\_macro|string|(required) Low-level discovery rule macro name.|
|^|path|string|(required) Selector for value, which will be assigned to the corresponding macro.|
|preprocessing|<| |Root element for low-level discovery rule value preprocessing.|
| |step| |Root element for low-level discovery rule value preprocessing step elements, which are the same as for [template item value preprocessing steps](#template-item-preprocessing-steps), except with fewer possible values. See also: [LLD rule preprocessing object](/manual/api/reference/discoveryrule/object#lld-rule-preprocessing).|
|overrides|<| |Root element for low-level discovery rule override rules.|
|<|name|string|(required) Unique override name.|
|^|step|string|(required) Unique order number of the override.|
|^|stop|string|Stop processing next overrides if matches.|
|^|filter| |Root element for template low-level discovery rule override rule filter elements, which are the same as for [template low-level discovery rule filters](#template-low-level-discovery-rule-filters).|
|^|operations| |Root element for [template low-level discovery rule override operations](#template-low-level-discovery-rule-override-operations).|

::: noteclassic
See also: [LLD rule object](/manual/api/reference/discoveryrule/object) (refer to the relevant property with a matching name).
:::

[comment]: # ({/13cb0aa5-2fdd304e})

[comment]: # ({198effa4-1147e24b})
##### Template low-level discovery rule filters

|Element|<|Type|Description|
|-|---|---|-----------------------|
|evaltype|<|string|Override filter condition evaluation method.<br>Possible values:^[1](#footnotes)^ AND\_OR (0, default), AND (1), OR (2), FORMULA (3).|
|formula|<|string|Custom calculation formula for filter conditions.|
|conditions|<| |Root element for filter conditions.|
|<|macro|string|(required) The name of the low-level discovery macro to perform the check on.|
|^|value|string|Value to compare with.|
|^|operator|string|Condition operator.<br>Possible values:^[1](#footnotes)^ MATCHES\_REGEX (8, default), NOT\_MATCHES\_REGEX (9).|
|^|formulaid|string|(required) Arbitrary unique ID that is used to reference a condition from the custom expression. Can only contain capital-case letters. The ID must be defined by the user when modifying filter conditions, but will be generated anew when requesting them afterward.|

::: noteclassic
See also: [LLD rule filter object](/manual/api/reference/discoveryrule/object#lld-rule-filter) (refer to the relevant property with a matching name).
:::

[comment]: # ({/198effa4-1147e24b})

[comment]: # ({7eed19ff-18c53e3c})
##### Template low-level discovery rule override operations

|Element|<|Type|Description|
|-|---|---|-----------------------|
|operationobject|<|string|Object to which the operation is applied.<br>Possible values:^[1](#footnotes)^ ITEM_PROTOTYPE (0), TRIGGER_PROTOTYPE (1), GRAPH_PROTOTYPE (2), HOST_PROTOTYPE (3).|
|operator|<|string|Override condition operator.<br>Possible values:^[1](#footnotes)^ EQUAL (1), NOT_EQUAL (2), LIKE (3), NOT_LIKE (4), REGEXP (5), NOT_REGEXP (6).|
|value|<|string|A regular expression or a string for the override condition operator.|
|status|<|string|Status of the object upon the override operation.|
|discover|<|string|Whether the object is added as a result of the discovery.|
|delay|<|string|Update interval set for the item prototype upon the override operation.|
|history|<|string|History storage period set for the item prototype upon the override operation.|
|trends|<|string|Trend storage period set for the item prototype upon the override operation.|
|severity|<|string|Trigger prototype severity set upon the override operation.|
|tags|<| |Root element for the tags set for the object upon the override operation.|
|<|tag|string|(required) Tag name.|
|^|value|string|Tag value.|
|templates|<| |Root element for the templates linked to the host prototype upon the override operation.|
| |name|string|(required) Template name.|
|inventory_mode|<|string|Host prototype inventory mode set upon the override operation.|

::: noteclassic
See also: [LLD rule override operation object](/manual/api/reference/discoveryrule/object#lld-rule-override-operation) (refer to the relevant property with a matching name).
:::

[comment]: # ({/7eed19ff-18c53e3c})

[comment]: # ({ad2d6df7-fd8f09c1})
#### Template web scenarios

|Element|<|Type|Description|
|-|---|---|-----------------------|
|uuid|<|string|(required) Unique identifier for this web scenario.|
|name|<|string|(required) Web scenario name.|
|delay|<|string|Frequency (using seconds, [time suffix](/manual/appendix/suffixes#time-suffixes), or [user macro](/manual/config/macros/user_macros)) of executing web scenario.<br>Default: 1m.|
|attempts|<|integer|The number of attempts for executing web scenario steps.<br>Possible values:^[1](#footnotes)^ 1-10 (default: 1).|
|agent|<|string|Client agent. Zabbix will pretend to be the selected browser.<br>This is useful when a website returns different content for different browsers.<br>Default: Zabbix.|
|http\_proxy|<|string|Proxy that will be used by the web scenario given as: `http://[username[:password]@]proxy.example.com[:port]`|
|variables|<| |Root element for web scenario variables that may be used in scenario steps.|
|<|name|string|(required) Variable name.|
|^|value|text|(required) Variable value.|
|headers|<| |Root element for HTTP headers to be sent when performing a request.<br>Headers should be listed using the same syntax as they would appear in the HTTP protocol.|
|<|name|string|(required) Header name.|
|^|value|text|(required) Header value.|
|status|<|string|Web scenario status.<br>Possible values:^[1](#footnotes)^ ENABLED (0, default), DISABLED (1).|
|authentication|<|string|Authentication method.<br>Possible values:^[1](#footnotes)^ NONE (0, default), BASIC (1), NTLM (2), Kerberos (3), or Digest (4).|
|http\_user|<|string|User name used for BASIC (HTTP), NTLM, Kerberos, or Digest authentication.|
|http\_password|<|string|Password used for BASIC (HTTP), NTLM, Kerberos, or Digest authentication.|
|verify\_peer|<|string|Verify the SSL certificate of the web server.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|verify\_host|<|string|Verify that the *Common Name* field or the *Subject Alternate Name* field of the web server certificate matches.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|ssl\_cert\_file|<|string|Name of the SSL certificate file used for client authentication (must be in PEM format).|
|ssl\_key\_file|<|string|Name of the SSL private key file used for client authentication (must be in PEM format).|
|ssl\_key\_password|<|string|SSL private key file password.|
|steps|<| |(required) Root element for [template web scenario steps](#template-web-scenario-steps).|
|tags|<| |Root element for web scenario tags.|
|<|tag|string|(required) Tag name.|
|^|value|string|Tag value.|

::: noteclassic
See also: [Web scenario object](/manual/api/reference/httptest/object) (refer to the relevant property with a matching name).
:::

[comment]: # ({/ad2d6df7-fd8f09c1})

[comment]: # ({5f667fc1-0dcf2b63})
##### Template web scenario steps

|Element|<|Type|Description|
|-|---|---|-----------------------|
|name|<|string|(required) Web scenario step name.|
|url|<|string|(required) URL for monitoring.|
|query\_fields|<| |Root element for query parameters (an array of HTTP fields to be added to the URL when performing a request).|
|<|name|string|(required) Query parameter name.|
|^|value|string|Query parameter value.|
|posts|<| |Root element for HTTP POST variables (a string (raw post data) or an array of HTTP fields (form field data)).|
|<|name|string|(required) Post field name.|
|^|value|string|(required) Post field value.|
|variables|<| |Root element of step-level variables (macros) that should be applied after this step.<br>If the variable value has a 'regex:' prefix, then its value is extracted from the data returned by this step according to the regular expression pattern following the 'regex:' prefix|
|<|name|string|(required) Variable name.|
|^|value|text|(required) Variable value.|
|headers|<| |Root element for HTTP headers to be sent when performing a request.|
|<|name|string|(required) Header name.|
|^|value|text|(required) Header value.|
|follow\_redirects|<|string|Follow HTTP redirects.<br>Possible values:^[1](#footnotes)^ NO (0), YES (1, default).|
|retrieve\_mode|<|string|HTTP response retrieve mode.<br>Possible values:^[1](#footnotes)^ BODY (0, default), HEADERS (1), BOTH (2).|
|timeout|<|string|Timeout (using seconds, [time suffix](/manual/appendix/suffixes#time-suffixes), or [user macro](/manual/config/macros/user_macros)) of step execution.<br>Default: 15s.|
|required|<|string|Text that must be present in the response (ignored if empty).|
|status\_codes|<|string|A comma-delimited list of accepted HTTP status codes (e.g., `200-201,210-299`; ignored if empty).|

::: noteclassic
See also: [Web scenario step object](/manual/api/reference/httptest/object#scenario-step) (refer to the relevant property with a matching name).
:::

[comment]: # ({/5f667fc1-0dcf2b63})

[comment]: # ({d872388a-51ede6fc})
#### Template dashboards

|Element|<|Type|Description|
|-|---|---|-----------------------|
|uuid|<|string|(required) Unique identifier for this dashboard.|
|name|<|string|(required) Template dashboard name.|
|display period|<|integer|Display period of dashboard pages.|
|auto\_start|<|string|Slideshow auto start.<br>Possible values:^[1](#footnotes)^ NO (0), YES (1, default).|
|pages|<| |Root element for template dashboard pages.|
|<|name|string|Page name.|
|^|display period|integer|Page display period.|
|^|sortorder|integer|Page sorting order.|
|widgets|<| |Root element for [template dashboard widgets](#template-dashboard-widgets).|

::: noteclassic
See also: [Template dashboard object](/manual/api/reference/templatedashboard/object) (refer to the relevant property with a matching name).
:::

[comment]: # ({/d872388a-51ede6fc})

[comment]: # ({30097c1f-c1a97fff})
##### Template dashboard widgets

|Element|<|Type|Description|
|-|---|---|-----------------------|
|type|<|string|(required) Widget type.|
|name|<|string|Widget name.|
|x|<|integer|Horizontal position from the left side of the template dashboard.<br>Possible values:^[1](#footnotes)^ 0-71.|
|y|<|integer|Vertical position from the top of the template dashboard.<br>Possible values:^[1](#footnotes)^ 0-63.|
|width|<|integer|Widget width.<br>Possible values:^[1](#footnotes)^ 1-72.|
|height|<|integer|Widget height.<br>Possible values:^[1](#footnotes)^ 1-64.|
|hide\_header|<|string|Hide widget header.<br>Possible values:^[1](#footnotes)^ NO (0, default), YES (1).|
|fields|<| |Root element for the template dashboard widget fields.|
|<|type|string|(required) Widget field type.<br>Possible values:^[1](#footnotes)^ INTEGER (0), STRING (1), ITEM (4), ITEM\_PROTOTYPE (5), GRAPH (6), GRAPH\_PROTOTYPE (7), MAP (8), SERVICE (9), SLA (10), USER (11), ACTION (12), MEDIA_TYPE (13).|
|^|name|string|(required) Widget field name.|
|^|value|mixed|(required) Widget field value, depending on the field type.|

::: noteclassic
See also: [Template dashboard widget object](/manual/api/reference/templatedashboard/object#template-dashboard-widget) (refer to the relevant property with a matching name).
:::

[comment]: # ({/30097c1f-c1a97fff})

[comment]: # ({6863a601-8e4db88d})
#### Template value maps

|Element|<|Type|Description|
|-|---|---|-----------------------|
|uuid|<|string|(required) Unique identifier for this value map.|
|name|<|string|(required) Value map name.|
|mapping|<| |Root element for mappings.|
|<|type|string|Mapping match type.<br>Possible values:^[1](#footnotes)^ EQUAL (0, default), GREATER_OR_EQUAL (2), LESS_OR_EQUAL (3), IN_RANGE (4), REGEXP (5), DEFAULT (6).|
|^|value|string|Original value.|
|^|newvalue|string|(required) Value to which the original value is mapped to.|

::: noteclassic
See also: [Value map object](/manual/api/reference/valuemap/object) (refer to the relevant property with a matching name).
:::

[comment]: # ({/6863a601-8e4db88d})

[comment]: # ({8a9ebde1-869bd76e})
## Footnotes

^1^ API integer values in brackets, for example, ENABLED (0), are mentioned only for reference.
For more information, see the linked API object page in the table entry or at the end of each section.

[comment]: # ({/8a9ebde1-869bd76e})
