These scripts have only been tested against a limited set of devices, so bugs are to be expected. In addition, due to the way Zabbix handles encryption, hosts and proxies using encryption will be imported incompletely: it is not possible to sync Pre-Shared Keys from Zabbix back into NetBox.
This means:
-
Your NetBox setup may be broken by using these scripts.
-
Your Zabbix setup may be impacted if nbxSync synchronizes incomplete data back to Zabbix after the import.
No warranty and no support are provided.
You have been warned.
These scripts are intended to help onboard existing Zabbix hosts into NetBox by creating the appropriate nbxSync objects for each host.
They work by matching the Zabbix host name against NetBox Devices and Virtual Machines. If a name match is found, the corresponding nbxSync objects are created:
-
The Zabbix Server assignment is created
-
Host Interfaces are created
-
All templates are assigned
-
All HostGroups are assigned
-
A Zabbix Server with valid token must be in NetBox
-
A Device or Virtual Machine must exist in NetBox with exactly the same name as the host in Zabbix.
-
The IP addresses used on the Zabbix host interface must be assigned to the Device/VM in NetBox via an interface (for host interface creation to succeed).
Please note: Zabbix Macros and Tags are not synchronized.
Whilst not shown, it is advised to run these script in a Python Virtual Environment
pip install -r requirements.txt
Edit import_devices.py and/or import_proxygroups_and_proxies.py and set NETBOX_URL and NETBOX_TOKEN to your NetBox URL and token.
Then run:
python3 import_devices.py
nbxSync v1.0.1 is required for these scripts to work.
These scripts have only been tested against a limited set of devices, so bugs are to be expected. In addition, due to the way Zabbix handles encryption, hosts and proxies using encryption will be imported incompletely: it is not possible to sync Pre-Shared Keys from Zabbix back into NetBox.
This means:
-
Your NetBox setup may be broken by using these scripts.
-
Your Zabbix setup may be impacted if nbxSync synchronizes incomplete data back to Zabbix after the import.
No warranty and no support are provided.
You have been warned.