14 Configuration export/import

Overview

Zabbix export/import functionality makes it possible to exchange various configuration entities between one Zabbix system and another.

Typical use cases for this functionality:

  • share templates or network maps - Zabbix users may share their configuration parameters
  • upload a template to Zabbix Community templates. Then others can download the template and import the file into Zabbix.
  • integrate with third-party tools - universal YAML, XML and JSON formats make integration and data import/export possible with third-party tools and applications
What can be exported/imported

Objects that can be exported/imported are:

Export format

Data can be exported using the Zabbix web frontend or Zabbix API. Supported export formats are YAML, XML and JSON.

Details about export

  • All supported elements are exported in one file.
  • Host and template entities (items, triggers, graphs, discovery rules) that are inherited from linked templates are not exported. Any changes made to those entities on a host level (such as changed item interval, modified regular expression or added prototypes to the low-level discovery rule) will be lost when exporting; when importing, all entities from linked templates are re-created as on the original linked template.
  • Entities created by low-level discovery and any entities depending on them are not exported. For example, a trigger created for an LLD-rule generated item will not be exported.

Details about import

  • Import stops at the first error.
  • When updating existing images during image import, "imagetype" field is ignored, i.e. it is impossible to change image type via import.
  • When importing hosts/templates using the "Delete missing" option, host/template macros not present in the import file will be deleted from
    the host/template after the import.
  • Empty tags for items, triggers, graphs, discoveryRules, itemPrototypes, triggerPrototypes, graphPrototypes are meaningless i.e. it's the same as if it was missing.
  • Import supports YAML, XML and JSON, the import file must have a correct file extension: .yaml and .yml for YAML, .xml for XML and .json for JSON. See compatibility information about supported XML versions.
  • Import supports configuration files only in UTF-8 encoding (with or without BOM); other encodings (UTF16LE, UTF16BE, UTF32LE, UTF32BE, etc.) will result in an import conversion error.

YAML base format

The YAML export format contains the following nodes:

  • Root node for Zabbix YAML export
  • Export version
  • Date when export was created in ISO 8601 long format
zabbix_export:
         version: '6.0'
         date: '2020-04-22T06:20:11Z'

Other nodes are dependent on exported objects.

XML format

The XML export format contains the following tags:

  • Default header for XML documents
  • Root tag for Zabbix XML export
  • Export version
  • Date when export was created in ISO 8601 long format
<?xml version="1.0" encoding="UTF-8"?>
       <zabbix_export>
           <version>6.0</version>
           <date>2020-04-22T06:20:11Z</date>
       </zabbix_export>

Other tags are dependent on exported objects.

JSON format

The JSON export format contains the following objects:

  • Root object for Zabbix JSON export
  • Export version
  • Date when export was created in ISO 8601 long format
{
           "zabbix_export": {
               "version": "6.0",
               "date": "2020-04-22T06:20:11Z"
           }
       }

Other objects are dependent on exported objects.