Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Extend inventory items fields #987

Closed
marc-us opened this issue Mar 23, 2017 · 5 comments
Closed

Feature request: Extend inventory items fields #987

marc-us opened this issue Mar 23, 2017 · 5 comments

Comments

@marc-us
Copy link
Contributor

marc-us commented Mar 23, 2017

feature request:

The usecase behind it, that we could make periodic check on the PCI devices within server, make sure all of them still present and nothing has been changed. (This is done by external monitoring script which polls netbox API)

We done it in the following way, but would like to share with community:

+++ b/netbox/dcim/models.py
    class_id = models.CharField(max_length=50, verbose_name='PCI Class id', blank=True)
    class_name = models.CharField(max_length=50, verbose_name='PCI Class name', blank=True)
    pci_vendor_id = models.CharField(max_length=50, verbose_name='PCI Vendor id', blank=True)
    pci_device_id = models.CharField(max_length=50, verbose_name='PCI Device id', blank=True)
    device_type = models.CharField(max_length=50, verbose_name='Device type', blank=True)
    slot = models.CharField(max_length=50, verbose_name='Slot', blank=True)
    comments = models.TextField(blank=True)

Should be editable when I open the form on GUI:

+++ b/netbox/dcim/forms.py
+        fields = ['name', 'manufacturer', 'part_id', 'serial', 'class_id', 'class_name', 'pci_vendor_id', 'pci_device_id', 'device_type', 'slot', 'comments']
+++ b/netbox/dcim/api/serializers.py
+        fields = ['id', 'device', 'parent', 'name', 'manufacturer', 'part_id', 'serial', 'discovered', 'class_id', 'class_name', 'pci_vendor_id', 'pci_device_id', 'device_type', 'slot', 'comments']

Just like when I query it via API:

+++ b/netbox/dcim/api/serializers.py
+        fields = ['id', 'device', 'parent', 'name', 'manufacturer', 'part_id', 'serial', 'discovered', 'class_id', 'class_name', 'pci_vendor_id', 'pci_device_id', 'device_type', 'slot', 'comments']
@jeremystretch
Copy link
Member

This is probably extending the data model a bit too far. I'd like to keep inventory data fairly generic to ensure that we can support all hardware.

Moving forward, the plan is to replace NetBox's very limited RPC functionality with NAPALM. NAPALM will use the OpenConfig platform model to represent hardware components, which we will store as InventoryItems in NetBox.

@marc-us
Copy link
Contributor Author

marc-us commented Mar 23, 2017

Okay, but two fields in any case would be good, slot/position and comments.
The first one would be the key for searching and rest of the content could be passed within the comment.

What you mention with napalm and openconfig is mean that netbox should be able to access to the equipments, however I think it is not so much good in multi site environment. I still belive that some middleware should upload/modify the data in the netbox.

@jeremystretch
Copy link
Member

NetBox may or may not access the devices directly in a given deployment, but I want to make sure that its API endpoint for inventory items matches the OpenConfig model very closely.

@jeremystretch
Copy link
Member

Closing this out for now. Let's wait and see how the NAPALM integration goes before we make any further changes to this model.

@misch42
Copy link

misch42 commented Feb 14, 2019

Any update on this topic? Is it possible to get the data of a device in a format described in the openconfig_interface model?

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants