Netbox: Implement a VLAN members view

Created on 4 Mar 2018  路  5Comments  路  Source: netbox-community/netbox

Issue type

[ x ] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.3
  • NetBox version: 2.3.0

Description

Hello,

the webgui currently does not provide a view to check on which interfaces of devices a vlan is associated. At least I haven't found one yet.
Getting a summary list of access and trunk ports by selecting ipam/vlans/ipam_vlan.id/ would be a great enhancement from administrative perspective. This could be accomplished without any change to the database schema as far as i can tell.

A db query for devices / ports which have a vlan tagged associated

SELECT dcim_device.name, dcim_interface.name, dcim_interface.mode FROM dcim_interface_tagged_vlans INNER JOIN ipam_vlan ON dcim_interface_tagged_vlans.vlan_id = ipam_vlan.id INNER JOIN dcim_interface ON dcim_interface_tagged_vlans.interface_id = dcim_interface.id INNER JOIN dcim_device ON dcim_device.id = dcim_interface.device_id WHERE ipam_vlan.id =1;

and a query for devices and interfaces which have a vlan nativce associated:

SELECT dcim_device.name, dcim_interface.name, dcim_interface.mode FROM dcim_interface INNER JOIN ipam_vlan ON dcim_interface.untagged_vlan_id = ipam_vlan.id INNER JOIN dcim_device ON dcim_device.id = dcim_interface.device_id WHERE ipam_vlan.id =1;

I do know jack about SQL (and even less about python), so there is a good chance to do this in a better way.

Anyway at this point I like to thank the developers for this great piece of software.

best regards

accepted feature

Most helpful comment

Just so I understand, this request is to implement a view showing all of the interfaces (and their parent devices/VMs) assigned to a particular VLAN? Seems like we could add a "members" tab to the VLAN view to do this pretty easily.

All 5 comments

Representing this data was something I struggled with when implementing #150. Ultimately I decided to defer the UI to get the feature out the door. Showing the associations from the device/interface context is tricky because of the number of vlans that could potentially be assigned. I had not considered the view from the opposite perspective (from the VLAN). I will play around with this; like you said it would not be that difficult.

Just so I understand, this request is to implement a view showing all of the interfaces (and their parent devices/VMs) assigned to a particular VLAN? Seems like we could add a "members" tab to the VLAN view to do this pretty easily.

@jeremystretch yep, that's pretty much exactly what I had in mind for this.

This is near of what we are searching for.
At the moment we still use our xls-Sheets shame because of the possibility to have an overview of the switch with the assinged vlans.
netbox_view_vlan

I would love to see this under the Device.
Populating a table would be easy enough, as all the data are already in the DB.
here is what i would do if i could program:
First Line:
The names on top will be filled with the "Connection" from Interfaces
Second Line:
Switch01 is simply the name of the Device then the Type with IP(and mac?)
Third Line:
Information titles and Portnames: VLAN -> ID -> Portname/number
Rest:
The VLAN-Names -> VLAN-ID -> Tagged or Untagged status.

to enumerate how big the table should get we can get the numbers of interfaces attached to the device (in this case 8) plus 2 to get 10 Rows
The number of tagged/untagged VLAN's on this device (no need to show VLAN's that are not tagged or untagged) we get 6 participating VLAN's plus 2 Columns = 8

So we would need a table with 10 Rows and 8 Columns to display an overview of the Switch-Config.

As we have a lot of VLAN's and Switches this is the only reason we do not have implemented Netbox yet.
if i can be of assistans anyhow please let me know. unfortunately i don't know anything about python

@jeremystretch: Thank you for the implementation. Works great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hellerve picture hellerve  路  3Comments

robbagithub picture robbagithub  路  3Comments

markve-sa picture markve-sa  路  4Comments

mrfroggg picture mrfroggg  路  3Comments

candlerb picture candlerb  路  3Comments