Is it possible to use Jinja2 variables in the Inventory configuration?
Use Case
It would be extremely useful to sync inventory data (e.g., Latitude/Longitude, address, location details, etc.) from NetBox to Zabbix automatically, rather than manually populating each field with data that already exists in NetBox.
Proposed Solution
Ideally, this functionality could be added to the new Configuration Group feature—which is a great addition, by the way!
Related Work / Findings
I was able to get Jinja2 variables working for Tags and Host Groups by modifying the following files to extend the context:
zabbixtagassignment.py - Adds site, tenant, role, device_type, manufacturer to ZabbixTagAssignment.get_context()
zabbixhostgroupassignment.py - Adds site, tenant, role, device_type, manufacturer to ZabbixHostgroupAssignment.get_context()
Then use
{{ manufacturer.name }}
{{ site.name }}
{{ device_type.model }}
Is it possible to use Jinja2 variables in the Inventory configuration?
Use Case
It would be extremely useful to sync inventory data (e.g., Latitude/Longitude, address, location details, etc.) from NetBox to Zabbix automatically, rather than manually populating each field with data that already exists in NetBox.
Proposed Solution
Ideally, this functionality could be added to the new Configuration Group feature—which is a great addition, by the way!
Related Work / Findings
I was able to get Jinja2 variables working for Tags and Host Groups by modifying the following files to extend the context:
zabbixtagassignment.py - Adds site, tenant, role, device_type, manufacturer to ZabbixTagAssignment.get_context()
zabbixhostgroupassignment.py - Adds site, tenant, role, device_type, manufacturer to ZabbixHostgroupAssignment.get_context()
Then use
{{ manufacturer.name }}
{{ site.name }}
{{ device_type.model }}