mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2026-03-21 12:08:39 -06:00
Page:
Configuration
Clone
17
Configuration
Twan Kamans edited this page 2026-02-27 17:18:13 +01:00
Table of Contents
Config file
First time user? Copy the config.py.example file to config.py. This file is
used for modifying filters and setting variables such as custom field names.
cp config.py.example config.py
Configuration options
| Setting | Category | Type | Default | Description |
|---|---|---|---|---|
| templates_config_context | Template logic | Boolean | False | Use config context as template source instead of a custom field |
| templates_config_context_overrule | Template logic | Boolean | False | Use custom fields as template source. If a template is referenced in the config context then it will overwrite the custom field template |
| template_cf | Custom fields | String | zabbix_template | Name of the Netbox custom field used for listing Zabbix template (under device types) |
| device_cf | Custom fields | String | zabbix_hostid | Name of the Netbox custom field used to store the Zabbix HostID |
| description | Zabbix host description | string | "static" | Sets the description type in Zabbix. |
| description_dt_format | Zabbix host description | string | "%Y-%m-%d %H:%M:%S" | Sets the datetime format of the {datetime} flag for the description configuration |
| clustering | Device | Boolean | False | Set the use of clustering devices |
| create_hostgroups | Hostgroups | Boolean | True | Creates missing hostgroups in Zabbix. Requires hostgroup permissions in Zabbix |
| create_journal | Journal | Boolean | False | Enables the script to create journals in Netbox that show basic operations |
| sync_vms | VM | Boolean | False | Enables the sync of VM's on top of devices |
| vm_hostgroup_format | VM | String | "cluster_type/cluster/role" | Set the hostgroup format for virtual machines. |
| full_proxy_sync | Proxy | Boolean | False | Enables full proxy sync. Removes proxy link from Zabbix host when proxy is not defined in config context |
| zabbix_device_removal | Netbox state | List | ["Decommissioning","Inventory"] | NetBox device status that removes the host from Zabbix |
| zabbix_device_disable | Netbox state | List | ["Offline","Planned","Staged","Failed"] | NetBox device status that disables the host in Zabbix |
| hostgroup_format | Device | String | "site/manufacturer/role" | Hostgroup format for Devices |
| traverse_regions | Hostgroups | Boolean | False | Use full region path instead of only directly assigned region |
| traverse_site_groups | Hostgroups | Boolean | False | Use full site group path instead of only directly assigned site group |
| extended_site_properties | Hostgroups | Boolean | False | Query additional site properties from NetBox (increases API calls) |
| nb_device_filter | Device | Dict | {"name__n": "null"} | Filter applied to NetBox devices before syncing |
| nb_vm_filter | VM | Dict | {"name__n": "null"} | Filter applied to NetBox Virtual Machines before syncing |
| inventory_mode | Inventory | String | "disabled" | Inventory mode in Zabbix (disabled, manual, automatic) |
| inventory_sync | Inventory | Boolean | False | Enable syncing of NetBox properties to Zabbix inventory |
| device_inventory_map | Device | Dict | See example | Mapping of NetBox device fields to Zabbix inventory fields |
| vm_inventory_map | VM | Dict | See example | Mapping of NetBox VM fields to Zabbix inventory fields |
| usermacro_sync | Usermacros | Boolean/String | False | Enable syncing of usermacros from NetBox. Use "full" to force update secret macros |
| device_usermacro_map | Device | Dict | See example | Map NetBox device fields to Zabbix usermacros |
| vm_usermacro_map | VM | Dict | See example | Map NetBox VM fields to Zabbix usermacros |
| tag_sync | Tags | Boolean | False | Enable syncing of tags to Zabbix |
| tag_lower | Tags | Boolean | True | Convert tag names and values to lowercase before syncing |
| tag_name | Tags | String/Boolean | "NetBox" | Zabbix tag key used to store NetBox tags. Set to False to disable |
| tag_value | Tags | String | "name" | NetBox tag property used as Zabbix tag value (name, slug, display) |
| device_tag_map | Device | Dict | See example | Map NetBox device fields to Zabbix host tags |
| vm_tag_map | VM | Dict | See example | Map NetBox VM fields to Zabbix host tags |
Environment variables
All of the configurations that are listed above can also be set by using environment variables using the prefix NBZX_ followed with the option in caps. For example, if you want to set the clustering option to True using an environment variable, specify the option with the variable NBZX_CLUSTERING.