Map export and import is available since Zabbix version 1.8.2.
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:
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>
When importing an XML, selementid values don't have to match any values in the existing dataset - they are only used to determine map link connections.
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
Single server setup
Hosts are referred to by host name.
DM setup
Single server setup
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
Single server setup
Host groups are referred to by host group name.
For images <elementid> node can be skipped.
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
Single server setup
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>
Image import/export is supported since Zabbix version 1.8.3.
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>
Value for the <encodedImage> tag is truncated in the above example.
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.
Warning: if replacing an existing image, it will affect all maps that are using this image.
It is possible to import images only by unchecking both map checkboxes.