Skip to main content

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.

Release files for zabbix-import 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zabbix-import 1.0.0
File Size Uploaded
zabbix-import-1.0.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zabbix-import 1.0.0
File Interpreter ABI Platform
zabbix_import-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / zabbix-import-1.0.0.tar.gz

Download URL zabbix-import-1.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
24bdd6010a0e5cf2c1c6b14b65da008824731031113ba8b846491ef6768fd805
BLAKE2b-256 checksum
How to use checksums
c35c2dd9c878285fd9bf3670e9e54a041b4c525a2edda1428a7d6cc8ebb24a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

Release files / zabbix_import-1.0.0-py3-none-any.whl

Download URL zabbix_import-1.0.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b20476f4f16fd1473611df3d7a7d071ce227c39b1de384bfa06a02a1fd993095
BLAKE2b-256 checksum
How to use checksums
78b0a2728677fabf990c56b0cb4eb501d8465a6872ce61d9eae2aed66dd95d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page