Skip to main content

Utility to import Zabbix XML configuration: templates, hosts, host groups

Project description

pypi package

Utility to import exported XML configuration(templates, hosts, ...) into Zabbix using it's API.

$ zbx-import.py -u Admin -p *** --url https://zabbix.local/api_jsonrpc.php exported_templates.xml
SUCCESS: configuration import

Tested with Zabbix 3.4 and 4.0, probably will work with older versions up to 2.0. Written in pure python, no additional libraries are required. Works with both python 3 and python 2.

Allows to control import options:

  • create new - add new elements from the import file. Default: True
  • update existing - update existing elements from the import file. Default: True
  • delete missing - remove existing elements not present in the import file. Default: False. NOTE: without this option importing existing template with changed triggers will create new triggers, but old ones with the same name and different value will remain.

You can set this options for all elements or precisely select list of elements for the option: --delete-missing 'triggers graphs'. Check --help for available elements.

$ zbx-import.py -u Admin -p *** --url https://zabbix.local/api_jsonrpc.php --delete-missing exported_templates.xml
SUCCESS: configuration import

Installation

Simplest option - just use zbx-import.py directly, it does not have any dependencies.

From pypi.org:

pip install zabbix-import

Or create a Docker image and use it:

docker build -t zabbix-import .
# No options to get help on usage
docker run -it --rm zabbix-import [options]

P.S. If this code is useful for you - don't forget to put a star on it's github repo.

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-import-1.0.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

zabbix_import-1.0.0-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

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