Zabbix Import/Export functionality is created to make possible effective exchange of various configuration entities.
Data is exported in XML format which is easy to read and modify.
Use cases:
Zabbix users may share configuration parameters.
Universal XML format makes integration and data import/export possible with third party tools and applications.
Currently two main categories of configuration are supported for export - hosts and their associated data, and network maps.
Zabbix host import/export processes the following data:
Zabbix map import/export supports the following elements since version 1.8.2:
Additionally, since 1.8.3 used images (icons and background images) are exported as well.
Zabbix screen import/export supports all screen elements.
For Zabbix versions up to 1.8.3, host and template export is available at Configuration → Export/Import. Starting with 1.8.3, import and export controls are available on corresponding configuration pages (Configuration → Hosts and Configuration → Templates).
Navigate either to Configuration → Hosts or Configuration → Templates, depending on which ones you want to export. Mark checkboxes next to elements to be exported.
Make sure that Export selected is chosen in the activity dropdown below host or template list, then click Go and save the file.
Select elements for export
We selected host “Template_Linux” and all its items and triggers.
Press button “Preview” to see list of elements to be exported:
Export data
Press button “Export” to export selected elements to a local XML file with default name zabbix_export.xml. The file has the following format (one element of each type is shown):
<?xml version="1.0"?> <zabbix_export version="1.0" date="11.05.07" time="11.11"> <hosts> <host name="ZABBIX Server"> <useip>1</useip> <ip>127.0.0.1</ip> <port>10050</port> <status>1</status> <groups> </groups> <items> <item type="0" key="agent.ping" value_type="3"> <description>Ping to the server (TCP)</description> <delay>30</delay> <history>7</history> <trends>365</trends> <snmp_port>161</snmp_port> <valuemap>Service state</valuemap> <applications> <application>General</application> </applications> </item> .... </items> <triggers> <trigger> <description>Version of zabbix_agent(d) was changed on {HOSTNAME}</description> <expression>{{HOSTNAME}:agent.version.diff(0)}>0</expression> <priority>3</priority> </trigger> .... <graphs> <graph name="CPU Loads" width="900" height="200"> <show_work_period>1</show_work_period> <show_triggers>1</show_triggers> <yaxismin>0.0000</yaxismin> <yaxismax>100.0000</yaxismax> <graph_elements> <graph_element item="{HOSTNAME}:system.cpu.load[,avg15]"> <color>990000</color> <yaxisside>1</yaxisside> <calc_fnc>2</calc_fnc> <periods_cnt>5</periods_cnt> </graph_element> <graph_element item="{HOSTNAME}:system.cpu.load[,avg1]"> <color>009900</color> <yaxisside>1</yaxisside> <calc_fnc>2</calc_fnc> <periods_cnt>5</periods_cnt> </graph_element> <graph_element item="{HOSTNAME}:system.cpu.load[,avg5]"> <color>999900</color> <yaxisside>1</yaxisside> <calc_fnc>2</calc_fnc> <periods_cnt>5</periods_cnt> </graph_element> </graph_elements> </graph> .... </graphs> </host> .... </hosts> </zabbix_export>
For Zabbix versions up to 1.8.3, host and template import is available at Configuration → Export/Import. Starting with 1.8.3, import and export controls are available on corresponding configuration pages (Configuration → Hosts and Configuration → Templates).
Configure settings for data import and press “Import”.
Pay attention to the following parameters of the item:
PARAMETER | Description |
---|---|
Import file | File name of XML file. |
Rules | Element defines element of XML file. If parameter Update is set for Existing element, then the import will update it with data taken from the file. Otherwise it will not update it. If parameter Add is set for Missing element, then the import will add new element with data taken from the file. Otherwise it will not add it. |
Map export and import controls can be found under Configuration → Maps menu, where all configured maps are displayed.
In left bottom corner a selection box is available with two options: “Export selected” and “Delete selected”. To export maps:
Importing maps is as easy as exporting them. On the top right corner near “Create Map” button, you will find new button - “Import Map”.
To import maps:
![]() | ![]() |
Map import dialogue | Map import dialogue for Zabbix super admin, showing image importing options (available since version 1.8.3) |
Click on “Details” link on the left hand side to see more information about what was done by import, or why it failed to import.
Only map structure is exported. That means all map settings are exported, all contained elements with their settings are exported, so are the map links and map link status indicators.
Any maps, hostgroups, hosts, triggers, images or any others elements related to the exported map are not exported. Thus if at least one of the elements map refers to is missing, import will fail.
For example, if map refers to a specific trigger on a specific node, but this trigger has been deleted in the meantime, import would fail with an error message:
Cannot find trigger "our_node5:Zabbix server:Disk is full" used in exported map "Small map".
An example empty map export with background image from a distributed setup node:
<sysmap> <selements> </selements> <links> </links> <name>TEST</name> <width>800</width> <height>600</height> <backgroundid> <node>aly_trunk</node> <name>Map BG</name> </backgroundid> <label_type>2</label_type> <label_location>0</label_location> <highlight>1</highlight> <expandproblem>1</expandproblem> </sysmap>
Let's take XML excerpt of some Zabbix map element as an example:
<selement> <selementid>100100000000372</selementid> <elementid> <node>noden1</node> <host>LocalHost</host> <description>DOUBLE</description> <expression>{TimeHost:system.localtime[local].last(0)}=0 & {TimeHost:system.localtime[local].last(0)}=2</expression> </elementid> <elementtype>2</elementtype> <iconid_off> <node>noden1</node> <name>Hub</name> </iconid_off> <label>New Element</label> <label_location>-1</label_location> <x>231</x> <y>122</y> </selement>
elementtype tag in map export can be one of the following:
Value | Type |
---|---|
0 | Host |
1 | Map |
2 | Trigger |
3 | Host group |
4 | Image |
DM (distributed monitoring) setup
<node>noden1</node> <host>LocalHost</host>
Single server setup
<host>LocalHost</host>
Hosts are referred to by host name.
DM setup
<node>noden1</node> <name>Local map</name>
Single server setup
<name>Local map</name>
Maps are referred to by map name.
Triggers are described in a more complex way:
DM setup
<node>noden1</node> <host>LocalHost</host> <description>Lack of free memory on server {HOSTNAME}</description> <expression>{LocalHost:vm.memory.size[free].last(0)}<10000</expression>
Single server setup
<host>LocalHost</host> <description>Lack of free memory on server {HOSTNAME}</description> <expression>{LocalHost:vm.memory.size[free].last(0)}<10000</expression>
Trigger is referred to by host name, trigger description and trigger expression.
DM setup
<node>noden1</node> <name>Local Host Group</name>
Single server setup
<name>Local Host Group</name>
Host groups are referred to by host group name.
Nodes <iconid_off>, <iconid_on>, <iconid_unknown>, <iconid_maintenance> and <iconid_disabled> describes what icons should be used for the map element according to its status.
For default icon, <iconid_off> is used.
Inside icon block, image itself is specified: DM setup
<node>noden1</node> <name>Local Image</name>
Single server setup
<name>Local Image</name>
To use default icon for any state, node for that state should be skipped in the <selement> block.
Value | Type |
---|---|
-1 | use map default |
0 | bottom |
1 | left |
2 | right |
3 | top |
<x> and <y> nodes are used for positioning element on the map by x and y coordinates.
Example:
<link> <selementid1>100100000000399</selementid1> <selementid2>100100000000402</selementid2> <drawtype>0</drawtype> <color>00AA00</color> <linktriggers> </linktriggers> </link>
Value | Style |
---|---|
0 | line |
2 | bold line |
3 | dot |
4 | dashed line |
Example:
<linktrigger> <triggerid> <node>aly_trunk</node> <host>Symmetra PX40 Clone2</host> <description>APC: Input Current (PHASE L3)</description> <expression>{Symmetra PX40 Clone2:upsPhaseInputCurrent.L3.last(0)}<15 | {Symmetra PX40 Clone2:upsPhaseInputCurrent.L3.last(0)}>18</expression> </triggerid> <drawtype>0</drawtype> <color>0</color> </linktrigger>
It is possible to export and import used images alongside maps. If exported map is using any images, they are stored in the resulting XML file. An example of how an exported image might look like:
<images> <image> <name>Server (small)</name> <imagetype>1</imagetype> <encodedImage>iVBORw0KGgoAA...ErkJggg==</encodedImage> </image> </images>
Used tags:
When importing, missing images can be added and existing images can be overwritten by marking appropriate checkboxes. Image importing is only available to users of Zabbix Super Admin type.
It is possible to import images only by unchecking both map checkboxes.
Screen export and import controls can be found under Configuration → Screens menu, where all configured screens are displayed.
In left bottom corner a selection box is available with two options: “Export selected” and “Delete selected”.
To export screens:
Importing screens is as easy as exporting them. On the top right corner near “Create Screen” button, you will find new button - “Import Screen”.
To import screens:
Only screen structure is exported. That includes all screen settings are and all screen elements along with their configuration.
Anything included in the screen itself (like a host, hostgroup or any other data) is not exported.
When importing a screen, if any of the referenced elements is missing, import will fail, for example, with:
Cannot find trigger "child_node5: ZBXHost:DOUBLE CHECK" used in exported screen "Link Screen"
Screen export consists of screen definition itself and any additional elements.
<screens> <screen> <name>Screen name</name> <hsize>1</hsize> <vsize>2</vsize> <screenitems> <screenitem></screenitem> ... <screenitem></screenitem> </screenitems> </screen> </screens>
Available screen elements and their IDs.
Resource type | Description |
---|---|
0 | Graph |
1 | Simple graph |
2 | Map |
3 | Plain text |
4 | Hosts info |
5 | Triggers info |
6 | Server info |
7 | Clock |
8 | Screen |
9 | Triggers overview |
10 | Data overview |
11 | URL |
12 | History of actions |
13 | History of events |
14 | Status of hostgroup triggers |
15 | System status |
16 | Status of host triggers |
Bold text - mandatory tag for all elements;
Normal text - tag available for all elements;
Italic text - tag optionally available for some elements (see below for details).
If <resourceid> refers to an object by name, it can have subtags. If data is exported from a distributed setup installation, node will always be identified by name:
<node>Zabbix node</node>
For example, Simple graph <resourceid> entry from a non-distributed setup would look like this:
<resourceid> <host>Zabbix server</host> <key_>system.cpu.load</key_> </resourceid>
In a distributed setup, it becomes:
<resourceid> <node>Zabbix node</node> <host>Zabbix server</host> <key_>system.cpu.load</key_> </resourceid>
Individual object references are listed at each element.
Each individual element must have mandatory tags from the previous section and may have tags that are available for all elements. If there are additional tags available for the specific element, they are listed here.
Resource type 7. Additional tags:
Resource type 10. Additional tags:
Available <resourceid> contents:
<name>Linux servers</name>
Resource type 0. Additional tags:
Available <resourceid> contents:
<host>Zabbix host</host> <name>Graph name</name>
Resource type 12. Additional tags:
Resource type 13. Additional tags:
Resource type 4. Additional tags:
Available <resourceid> contents:
<name>Linux servers</name>
Resource type 2. Additional tags:
Available <resourceid> contents:
<name>City map</name>
Resource type 3. Additional tags:
Available <resourceid> contents:
<host>Zabbix server</host> <key_>system.cpu.load</key_>
Resource type 8. Additional tags:
Available <resourceid> contents:
<name>Application servers screen</name>
Resource type 6. No additional tags available.
Resource type 1. Additional tags:
Available <resourceid> contents:
<host>Zabbix server</host> <key_>system.cpu.load</key_>
Resource type 16. Additional tags:
Available <resourceid> contents:
<host>aleksei_host</host>
Resource type 14. Additional tags:
Available <resourceid> contents:
<name>aaa</name>
Resource type 15. No additional tags available.
Resource type 5. Additional tags:
Available <resourceid> contents:
<name>aaa</name>
Resource type 9. Additional tags:
Available <resourceid> contents:
<name>aaa</name>
Resource type 11. Additional tags:
The following is a simple screen (2×2), exported to XML. It contains one custom graph in upper left cell (spanning two columns), one simple graph in the lower left cell and trigger status element, filtered for a hostgroup, in the lower right cell. Notice the encoding of & as &.
<?xml version="1.0" encoding="UTF-8"?> <screens> <screen> <name>Excellent screen</name> <hsize>2</hsize> <vsize>2</vsize> <screenitems> <screenitem> <resourcetype>0</resourcetype> <resourceid> <host>Zabbix server</host> <name>CPU Load & traffic</name> </resourceid> <width>1000</width> <height>100</height> <x>0</x> <y>0</y> <colspan>2</colspan> <rowspan>0</rowspan> <elements>0</elements> <valign>0</valign> <halign>0</halign> <style>0</style> <dynamic>0</dynamic> </screenitem> <screenitem> <resourcetype>1</resourcetype> <resourceid> <host>Zabbix server</host> <key_>zabbix[uptime]</key_> </resourceid> <width>500</width> <height>90</height> <x>0</x> <y>1</y> <colspan>0</colspan> <rowspan>0</rowspan> <elements>0</elements> <valign>0</valign> <halign>0</halign> <style>0</style> <dynamic>0</dynamic> </screenitem> <screenitem> <resourcetype>14</resourcetype> <resourceid> <name>Linux servers</name> </resourceid> <width>500</width> <height>100</height> <x>1</x> <y>1</y> <colspan>0</colspan> <rowspan>0</rowspan> <elements>25</elements> <valign>0</valign> <halign>0</halign> <style>0</style> <dynamic>0</dynamic> </screenitem> </screenitems> </screen> </screens>