Closed andershagman closed 8 months ago
Thanks for posting! I can confirm this behavior on https://demo.netbox.dev.
I made the assumption that lists would be merged within device config context. What i would recommend is creating an issue for the folks over at Netbox to see if this can be implemented. Since this is mostly a Netbox config context rendering feature.
In the meantime i'll check if this can be somehow solved with the script :)
I've found an old issue that lists this Netbox behavior. Unfortunately i am unable to work around this limitation since the only solution would be to independently query all objects that could have some form of config context. The amount of API calls would increase by a lot for each device.
Although i do understand your logic and agree to it it seems like Netbox is against this behavior.
Since this issue has been stale for a couple of weeks i suggest closing this. The only way to make this type of hierarchy work is by having different list names for each device. This would make maintaining the code with several types of variables acting for the same type of data and the administrative burden of administrating templates way harder.
You often want to use one template for the role and one for the model. if you have four roles and four models you create four role templates and four model templates. This makes 16 combinations. In Netbox you have to create those 16 config contexts to match two templates in Zabbix.
If I create one config context for a role:![bild](https://github.com/TheNetworkGuy/netbox-zabbix-sync/assets/20284974/1e61e294-ea74-4fd6-a0e6-1df14775ee3f)
And one for the modell![bild](https://github.com/TheNetworkGuy/netbox-zabbix-sync/assets/20284974/c283755b-19c9-4277-9ee8-07894128aa8c)
I get only one template![bild](https://github.com/TheNetworkGuy/netbox-zabbix-sync/assets/20284974/63805fac-7d13-4f62-9756-16a03a1b5f55)
Could it be possible to use template-1, template-2 ... and concatenate the template list in the script?