Utility to import Zabbix XML configuration: templates, hosts, host groups
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zabbix-import-1.0.0.tar.gz
.
File metadata
- Download URL: zabbix-import-1.0.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24bdd6010a0e5cf2c1c6b14b65da008824731031113ba8b846491ef6768fd805 |
|
MD5 | 23331ab7cd399144fca5f0fc9ef736ea |
|
BLAKE2b-256 | c35c2dd9c878285fd9bf3670e9e54a041b4c525a2edda1428a7d6cc8ebb24a00 |
File details
Details for the file zabbix_import-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: zabbix_import-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b20476f4f16fd1473611df3d7a7d071ce227c39b1de384bfa06a02a1fd993095 |
|
MD5 | 3851688b04b7f39baed99794e9615ecd |
|
BLAKE2b-256 | 78b0a2728677fabf990c56b0cb4eb501d8465a6872ce61d9eae2aed66dd95d19 |