-
Notifications
You must be signed in to change notification settings - Fork 39
Quick Start
Twan Kamans edited this page Feb 11, 2026
·
8 revisions
This guide will get the script running in just a few minutes using the minimum required configuration.
Make sure you have:
- Reachability to your NetBox API
- Reachability to your Zabbix API
- A NetBox API token
- A Zabbix user or API token with permissions to create and update hosts
- Go to User → API Tokens
- Create a new token
- Ensure the token has read access to:
- Devices
- Virtual Machines
- Interfaces
- IP Addresses
- Ensure the token has write access to:
- Devices
- VMs This is required to link a Netbox object to a Zabbix HostID. Another write-action to Netbox is for Journal support which is not enabled by default.
Save the token.
Use either:
- A dedicated API user with appropriate permissions
- Or an API token (recommended for newer Zabbix versions)
The user/token must be able to:
- Create hosts
- Update hosts
- Manage host groups
Before running the script, you must create two custom fields in NetBox.
These fields are required for syncing to work correctly.
- Go to Customization → Custom Fields in NetBox.
- Create the two required custom fields as described in the NetBox Preparation section of the documentation.
- Ensure the fields are assigned to:
- Devices
- Virtual Machines (if VM syncing is enabled)
Without these custom fields, the script will not be able to properly identify and manage synced objects in Zabbix.
docker run \
-e NETBOX_URL=https://netbox.example.com \
-e NETBOX_TOKEN=your_netbox_token \
-e ZABBIX_URL=https://zabbix.example.com \
-e ZABBIX_USERNAME=api_user \
-e ZABBIX_PASSWORD=api_password \
ghcr.io/thenetworkguy/netbox-zabbix-sync:latestFollow these steps to run the script directly using Python.
git clone https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
cd netbox-zabbix-syncLinux/macOS
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtexport NETBOX_URL=https://netbox.example.com
export NETBOX_TOKEN=your_netbox_token
export ZABBIX_URL=https://zabbix.example.com
export ZABBIX_USERNAME=api_user
export ZABBIX_PASSWORD=api_passwordpython netbox_zabbix_sync.py- The script connects to NetBox and retrieves objects based on your configuration.
- It connects to Zabbix and creates or updates matching hosts.
Obviously there are many different options to adjust. However most default settings will do fine