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

Network Map: Filter by VLAN doesn't work as expected #677

Closed
kkesper opened this issue Oct 31, 2019 · 12 comments
Closed

Network Map: Filter by VLAN doesn't work as expected #677

kkesper opened this issue Oct 31, 2019 · 12 comments
Labels

Comments

@kkesper
Copy link

kkesper commented Oct 31, 2019

Expected Behavior

As stated in the User Guide the switches which are shown in the map should have at least one port in the VLAN specified in the filter.

Current Behavior

Instead all devices are shown where this VLAN is known. Since we use Cisco VTP domains, this means that all the devices in the VTP domain are shown, regardless which VLAN in the domain is selected.

Possible Solution

In a former version (i don't know the exact number, but before 2.42.10) the behaviour was correct.

Steps to Reproduce (for bugs)

  1. select Neighbors tab
  2. enter a VLAN number in "carrying VLAN", which is known at some devices, which have no port carrying it.
  3. select Redraw Map
  4. These devices appear erroneously in the map.

Context

These VLAN-maps are very useful in a large network with a complicated VLAN structure. Unfortunately the current behaviour makes this featuere unusuable

Your Environment

  • Netdisco version used: 2.44.4
  • SNMP::Info version used: 3.70

Config info (deployment.yml)

Device information

netdisco-do show -d 1.1.1.1 -e specify -DI

@ollyg
Copy link
Member

ollyg commented Oct 31, 2019

Good call, thanks for the report @kkesper.

Note to self: Changing vlans to port_vlans on the following lines (twice) should do it:

# filter by vlan for all or neighbors only
if ($vlan) {
$devices = $devices->search(
{ 'vlans.vlan' => $vlan },
{ join => 'vlans' }
);
}

@kkesper
Copy link
Author

kkesper commented Nov 15, 2019

I have tried your solution, and it worked in so far, as now the correct set of devices is shown. But now the links in between these devices are drawn at completely wrong positions in the graph. It seems, as if the connections are not "fixed" at the devices.

Interestingly enough, this only happens when the VLAN-filter is switched on.

@ollyg
Copy link
Member

ollyg commented Dec 22, 2019

thanks @kkesper for testing it! that helped me find the issue which was on a DB JOIN returning too many rows. I've now implemented this fix and it will be in the next release.

[master d133eb9] #667 Network Map: Filter by VLAN doesnt work as expected

@ollyg ollyg closed this as completed Dec 22, 2019
@ollyg
Copy link
Member

ollyg commented Dec 23, 2019

I've accidentally committed this with the comment referring to #667

@kkesper
Copy link
Author

kkesper commented Jan 21, 2020

I have installed version 2.44.5 now, and unfortunately this issue is not completely solved yet. The graph looks at first ok, but the positions of the devices don't move (as they do, when no VLAN-Filter is on) and it is also impossible to reposition any device, as the links between them stay fixed.

@ollyg ollyg reopened this Jan 22, 2020
@ollyg ollyg added the bug label Jan 22, 2020
@ollyg
Copy link
Member

ollyg commented Jan 22, 2020

Hi @kkesper please can you try clearing the cached netmap positions and check again?

netdisco-do psql -e 'delete from netmap_positions'

Thanks

@kkesper
Copy link
Author

kkesper commented Jan 22, 2020

Sorry, but no change. As soon as the VLAN-filter is used, the graph "freezes". That means the links in between the devices are fixed to the background. The devices themselves can be moved but the links dont follow them and remain in the old position.

When i disable the VLAN-filter (selecting VLAN 0) everything is correct again.

@ollyg
Copy link
Member

ollyg commented Jan 22, 2020

OK thanks, I'll take a look and see if I can reproduce it

@ollyg
Copy link
Member

ollyg commented Jan 22, 2020

Hi @kkesper thanks, I found the bug and have released version 2.44.6 to CPAN.

[master ee86e62] fix bug in vlan filtered netmap, duplicate nodes

@ollyg ollyg closed this as completed Jan 22, 2020
@ollyg
Copy link
Member

ollyg commented Jan 22, 2020

[master bb46797] smarter fix for vlan filter in netmap

@kkesper
Copy link
Author

kkesper commented Jan 24, 2020

It runs perfectly now. Great work. Thanks a lot @ollyg!

These graphs are very valuable for us to keep track of our campus network's structure (~230 VLANs). So again, thanks a lot.

@ollyg
Copy link
Member

ollyg commented Jan 24, 2020

My pleasure :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants