Skip to main content

NetBox to Zabbix synchronization

A script to create, update and delete Zabbix hosts using NetBox device and virtual machine objects, keeping NetBox the single source of truth. Tested and compatible with all currently supported Zabbix releases.

The full documentation is in the project wiki.

Features

  • Syncs NetBox devices and, optionally, virtual machines to Zabbix hosts
  • Creates, updates, disables and deletes hosts based on the NetBox status
  • Builds hostgroups from NetBox data such as site, region, role, tenant or custom fields
  • Links templates from a device type custom field or from config context
  • Configures agent, SNMP, IPMI and JMX interfaces, and out-of-band interfaces, from config context
  • Assigns proxies and proxy groups
  • Syncs inventory, tags and usermacros from NetBox fields and config context
  • Treats virtual chassis as a single Zabbix host (clustering)
  • Writes journal entries in NetBox for every change

Requirements

  • A NetBox instance and an API token with write access
  • A Zabbix server and an API token or user
  • Python 3.12 or later, unless you use the Docker image
  • A zabbix_hostid custom field in NetBox, see Preparation

Quick start

After preparing NetBox, run a sync with Docker:

docker run --rm \
  -e NETBOX_HOST=https://netbox.example.com \
  -e NETBOX_TOKEN=your_netbox_token \
  -e ZABBIX_HOST=https://zabbix.example.com \
  -e ZABBIX_TOKEN=your_zabbix_token \
  ghcr.io/thenetworkguy/netbox-zabbix-sync:latest

Each run performs one sync and exits, so run it on a schedule to keep Zabbix up to date. See the Quick Start for a step-by-step guide.

Installation

The sync can run in three ways, described in Installation:

  • Docker: ghcr.io/thenetworkguy/netbox-zabbix-sync
  • Python package: pip install netbox-zabbix-sync, which provides the netbox-zabbix-sync command and a Sync class to use in your own code
  • From source: clone this repository, install the dependencies with uv sync or pip install -r requirements.txt, and run python3 netbox_zabbix_sync.py

The connection to NetBox and Zabbix is configured with the NETBOX_HOST, NETBOX_TOKEN, ZABBIX_HOST and ZABBIX_TOKEN (or ZABBIX_USER and ZABBIX_PASS) environment variables.

Configuration

The script works with its built-in defaults. To change them, copy config.py.example to config.py, or use NBZX_ environment variables or command-line flags. Run netbox_zabbix_sync.py --help for all flags.

Documentation

Page Contents
Quick Start A first sync in a few minutes
Installation Docker, Python package and source installs, environment variables, command-line flags
Preparation Custom fields, API permissions, custom links
Configuration All settings, environment variables and logging
Sync Behavior Hostgroups, templates, interfaces, proxies, inventory, tags, usermacros and more
Experimental Features Jinja2 rendering of config context

Development

Install the development dependencies and run the tests and checks with uv:

uv sync --dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run ty check

The functional tests run the sync against real NetBox and Zabbix containers. See tests/functional/README.md.

License

This project is licensed under the MIT license. See LICENSE.

Metadata

Release files for netbox-zabbix-sync 4.1.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 netbox-zabbix-sync 4.1.0
File Size Uploaded
netbox_zabbix_sync-4.1.0.tar.gz 175.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netbox-zabbix-sync 4.1.0
File Interpreter ABI Platform
netbox_zabbix_sync-4.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 220.1 kB

Release files / netbox_zabbix_sync-4.1.0.tar.gz

Download URL netbox_zabbix_sync-4.1.0.tar.gz
Size 175.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6eeca73a79dbcb75272f487ffcdc15612435546998981e98cf6eb37c07620476
BLAKE2b-256 checksum
How to use checksums
49463a73ccc3fe7c43c7ede1b8eb0e532d91bf4ed7a2b5e9a765235e34279c27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / netbox_zabbix_sync-4.1.0-py3-none-any.whl

Download URL netbox_zabbix_sync-4.1.0-py3-none-any.whl
Size 44.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70f8ffe4d0eeb0f17b51aa8ada85a7bb8c8d8ca13bdc20c502fdce4d80a8a075
BLAKE2b-256 checksum
How to use checksums
f0cffdd07e6c58e81b2b34d6527b628fc8c39826ebe6308a3baf8394cd3b19d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log
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