Inherit custom fields from device type to device #4229

Closed
opened 2025-12-29 18:34:00 +01:00 by adam · 2 comments
Owner

Originally created by @TheNetworkGuy on GitHub (Oct 29, 2020).

Environment

  • Python version: 3.8.1
  • NetBox version: 2.9.4

Proposed Functionality

To my knowledge, device types can be seen as "templates" by which a device is created. After that the device is customized with IP address, subinterfaces etc.
However custom fields do not apply to this rule. It would be great to specify a value only related to that device type which gets inherited to the device itself, just like the interfaces and rack U information etc.

Use Case

Pulling values from Netbox to other applications such as Splunk, Ansible, Zabbix etc. Specifically for Zabbix for managing the template which the device receives. This information is (in my environment) for device types the same which makes propagating it to the device logical. Furthermore it would follow the "template" expectation from device types quite nicely.

Database Changes

Sorry but i'm not skilled enough on DB level to know this 100%.
I can only guess that its Python code since the functionality for custom fields is already present for both devices and device types.

External Dependencies

None.

Thanks for reading and considering this FR!

Originally created by @TheNetworkGuy on GitHub (Oct 29, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/g/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.8.1 * NetBox version: 2.9.4 ### Proposed Functionality To my knowledge, device types can be seen as "templates" by which a device is created. After that the device is customized with IP address, subinterfaces etc. However custom fields do not apply to this rule. It would be great to specify a value only related to that device type which gets inherited to the device itself, just like the interfaces and rack U information etc. ### Use Case Pulling values from Netbox to other applications such as Splunk, Ansible, Zabbix etc. Specifically for Zabbix for managing the template which the device receives. This information is (in my environment) for device types the same which makes propagating it to the device logical. Furthermore it would follow the "template" expectation from device types quite nicely. ### Database Changes Sorry but i'm not skilled enough on DB level to know this 100%. I can only guess that its Python code since the functionality for custom fields is already present for both devices and device types. ### External Dependencies None. Thanks for reading and considering this FR!
adam closed this issue 2025-12-29 18:34:00 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 29, 2020):

I'm not sure I follow. There's no need to replicate the value of a custom field from a device type to a device, because the device object has access to its parent device type's custom fields; e.g. device.device_type.cf['my_custom_field'].

@jeremystretch commented on GitHub (Oct 29, 2020): I'm not sure I follow. There's no need to replicate the value of a custom field from a device type to a device, because the device object has access to its parent device type's custom fields; e.g. `device.device_type.cf['my_custom_field']`.
Author
Owner

@TheNetworkGuy commented on GitHub (Oct 29, 2020):

Completely missed that on my part. In that case this FR seems kind of unnecessary since you can get to the data through the device type. Thanks for the quick response!

@TheNetworkGuy commented on GitHub (Oct 29, 2020): Completely missed that on my part. In that case this FR seems kind of unnecessary since you can get to the data through the device type. Thanks for the quick response!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4229