Zabbix template export and import format¶
Zabbix uses XML as the standard format for exporting and importing configuration objects such as templates, hosts, triggers, and graphs^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L174-L197]. This format allows administrators to port configurations between different Zabbix instances or save them as version-controlled files^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L174-L197].
File Structure¶
An export file must be well-formed XML and begins with a standard XML declaration and version encoding^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L174-L176]. All content is enclosed within a root <zabbix_export> element^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L177-L197].
Root Metadata¶
The root element typically contains versioning and date information:
<version>: Specifies the version of the Zabbix export format (e.g.,3.4)^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L178].<date>: An ISO 8601 timestamp indicating when the export was created^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L179].
Primary Sections¶
The XML structure is divided into specific top-level sections that group related configuration data^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L180-L197]:
<groups>: Defines host groups referenced within the export^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L180-L184].<templates>: Contains the core definitions of the templates being exported^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L185-L197].<graphs>: Defines graph configurations associated with the templates^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L194-L197].
Template Definition¶
Within the <templates> section, individual <template> elements define the specific monitoring logic^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L186-L197].
Identification and Description¶
A template includes metadata to identify and describe its purpose^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L187-L194]:
<template>: The unique technical name or key of the template^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L187].<name>: The display name for the template^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L188].<description>: A text field explaining the template's function^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L189].<groups>: Associates the template with a specific host group^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L190-L193].
Items Configuration¶
Monitoring items are defined within the <items> block of a template^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L194-L196]. Each <item> element contains detailed configuration parameters^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L196-L233]:
- General Settings:
<name>: Display name of the item^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L197].<type>: The numerical type of the item (e.g.,0for Zabbix agent)^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L199].<key>: The unique item key (e.g.,mypay.robot[robot1047])^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L202].
- Data Settings:
<delay>: The update interval (e.g.,30s)^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L203].<history>: How long historical data is kept^[600-developer__operation-maintenance__zabbix-key.md#L204].<trends>: How long trend data is stored^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L205].<value_type>: The numerical code for the data type received^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L208].<units>: The unit of measure for the item's value^[600-developer__operation-maintenance__zabbix__zabbix-key.md#L210].
- Associations:
<applications>: Links the item to an application grouping^[600-developer__operation-maintenance__zabbix-key.md#L225-L229].
Related Concepts¶
- [[Zabbix]]
- [[XML]]
Sources¶
600-developer__operation-maintenance__zabbix__zabbix-key.md