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

Implement a VLAN members view #1945

Closed
Alestor opened this issue Mar 4, 2018 · 5 comments
Closed

Implement a VLAN members view #1945

Alestor opened this issue Mar 4, 2018 · 5 comments
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@Alestor
Copy link

Alestor commented Mar 4, 2018

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

@lampwins
Copy link
Contributor

lampwins commented Mar 4, 2018

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.

@jeremystretch
Copy link
Member

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 jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Mar 6, 2018
@lampwins
Copy link
Contributor

lampwins commented Mar 6, 2018

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

@jeremystretch jeremystretch changed the title Interface Vlan summary Information Implement a VLAN members view Mar 6, 2018
@cyberlu
Copy link

cyberlu commented Mar 22, 2018

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

@Alestor
Copy link
Author

Alestor commented Mar 23, 2018

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

@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants