Skip to main content

Convert Zabbix templates to older versions.

Project description

This Python script aims to resolve compatability issues when migrating Zabbix template XML files between versions of Zabbix. For example, you may wish to import a Zabbix v3.2 template into Zabbix v2.0.

The script works by applying conversion rules to a template, which manipulate the template XML to match the desired Zabbix version template format.

Installation

Install the Python script to /usr/local/bin with pip:

$ pip install zabbix-template-converter

Usage

$ zabbix-template-convertor -h
usage: zabbix-template-convertor [-h] [-v] -o X.Y.Z [-s] file

Migrate Zabbix templates between versions

positional arguments:
file                  Zabbix template XML file

optional arguments:
-h, --help            show this help message and exit
-v, --version         show program's version number and exit
-o X.Y.Z, --output-version X.Y.Z
                        target Zabbix version
-s, --squash-value-maps
                        remove references to value maps for versions older
                        than 3.0.0

Examples

To convert a Zabbix 3.2 template for import into v2.0:

$ zabbix-template-convertor -o 2.0 my_template.xml > my_template-2.0.xml

A number of transformations will take place. For example, Discovery Rule filters will be downgraded from the multiple-filter format introduced in Zabbix 2.4, to a single filter expression as follows:

<filter>
    <evaltype>0</evaltype>
    <formula/>
    <conditions>
        <condition>
            <macro>{#IFNAME}</macro>
            <value>@Network interfaces for discovery</value>
            <operator>8</operator>
            <formulaid>A</formulaid>
        </condition>
    </conditions>
</filter>

Becomes:

<filter>{#IFNAME}:@Network interfaces for discovery</filter>

Coverage

This project relies heavily on the community to report incompatibility problems when importing templates.

Please raise an issue if you find a template that won’t import after being converted. Be sure to include the error messages and template file.

Over time, as conversion rules are added, the script should become more comprehensive, and more reliable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zabbix-template-converter-1.1.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file zabbix-template-converter-1.1.0.tar.gz.

File metadata

File hashes

Hashes for zabbix-template-converter-1.1.0.tar.gz
Algorithm Hash digest
SHA256 caa2b649042458d265de3720947ba2033f6679fa2c4b24311d2fd09c539ea61d
MD5 7ebccbcb63125b3a84e30ec5995e445e
BLAKE2b-256 16082d4a81dd5d7d8dd7c2a24ee250a4985bd5aa0c22a4c4b9d3cb13495bbf7b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page