==== - #5 Map export and import ====
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.
=== - Map exporting ===
In left bottom corner a selection box is available with two options: "Export selected" and "Delete selected". To export maps:
- Mark boxes next to maps you wish to export;
- Select "Export selected" if it's not selected already;
- Press button "Go";
- Select file where Zabbix should store XML data with exported maps.
{{:1.8:manual:xml_export_import:map_export.png|}}
=== - Map importing ===
Importing maps is as easy as exporting them. On the top right corner near "Create Map" button, you will find new button - "Import Map".
{{:1.8:manual:xml_export_import:map_import.png|}}
To import maps:
- Press "Import Map" button. You will get to a screen similar to what you see when importing hosts in Configuration-> Export/Import (Import) menu;
- Press on "Choose file" button to select XML file containing exported Zabbix maps;
- Check box under "Update existing" if you need to update (overwrite) existing maps;
- Check box under "Add missing" if you need to create a new map if it's missing;
- Press import to send needed data to Zabbix frontend;
- Wait till page reloads. It can take some time if you have lots of maps to import or lots of hosts, triggers etc. Zabbix frontend will inform you about import success or failure.
|{{:1.8:manual:xml_export_import:map_import_dialogue.png|}}|{{:1.8:manual:xml_export_import:map_import_superadmin.png|}}|
|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.
=== - What is exported? ===
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.
=== - What is not exported? ===
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".
=== - Export format ===
An example empty map export with background image from a distributed setup node:
TEST800600aly_trunkMap BG2011
== - Map elements ==
Let's take XML excerpt of some Zabbix map element as an example:
100100000000372noden1LocalHostDOUBLE{TimeHost:system.localtime[local].last(0)}=0 & {TimeHost:system.localtime[local].last(0)}=22noden1Hub-1231122
* **** is the opening tag for an element (shorthand of "System map element");
* **** is a unique element id, used for map link references;
* **** refers to the actual Zabbix entity that is represented on the map (map/hostgroup/host etc.;
* **** tag will be present if the exported map comes from a distributed setup, skipped otherwise;
* **** describes what [[map_export_import#element_types_and_storage|type of element]] info is stored in **** node;
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.
== - Element types and storage ==
**elementtype** tag in map export can be one of the following:
^Value^Type^
|0|Host|
|1|Map|
|2|Trigger|
|3|Host group|
|4|Image|
* **Host reference**
//DM (distributed monitoring) setup//
noden1LocalHost
//Single server setup//
LocalHost
Hosts are referred to by host name.
* **Map reference**
//DM setup//
noden1Local map
//Single server setup//
Local map
Maps are referred to by map name.
* **Trigger reference**
Triggers are described in a more complex way:
//DM setup//
noden1LocalHostLack of free memory on server {HOSTNAME}{LocalHost:vm.memory.size[free].last(0)}<10000
//Single server setup//
LocalHostLack of free memory on server {HOSTNAME}{LocalHost:vm.memory.size[free].last(0)}<10000
Trigger is referred to by host name, trigger description and trigger expression.
* **Host group reference**
//DM setup//
noden1Local Host Group
//Single server setup//
Local Host Group
Host groups are referred to by host group name.
* **Image reference**
For images node can be skipped.
Nodes ****, ****, ****, **** and **** describes what icons should be used for the map element according to its status.
For default icon, **** is used.
Inside icon block, image itself is specified:
//DM setup//
noden1Local Image
//Single server setup//
Local Image
To use default icon for any state, node for that state should be skipped in the **** block.
== - Element labels ==
* **