News:

We really need your input in this questionnaire

Main Menu

L2 Map Filter

Started by gmonk63, August 04, 2022, 07:26:07 PM

Previous topic - Next topic

gmonk63

Is it possible to filter by interface on topology map ?  We have 48 Port core switch that has around 20 devices connected to each port so a topology map is pretty much a big blob of devices that span out from the core.  I would like to be able just include say interface Gi1/0/1 and whatever devices that span out from that particular interface.



Thanks

Filipp Sudanov

There is Object Filter in map properties. That's script that is executed for each node to decide if it should be added to the map.
So in that script you can loop through interfaces of the node, interfaces have peerInterface attribute. This attribute, if not null, will have interface object of the switch.

Pls send a note if you need an example of the script.

Filipp Sudanov

Here's an example of map filter script to start with.
if ($node->name == "sw-shelf") return true;

for (i:$node->interfaces) {
  p = i->peerInterface;
  n = i->peerNode;
  if (n != null and p != null and n->name == "sw-shelf" and p->name->contains("gi1/0")) return true;
}
return false;

It shows sw-shelf node and nodes connected to ports of the switch that have names beginning with "gi1/0".

But this script only shows directly connected devices. Do I understand correctly, that you actually want all the hierarchy that is connected to a specific port of your core switch?

gmonk63

Yes,  That's correct I was trying to get the hierarchy from a single core switch interface.  I was trying to see if that was possible but it looks like I would have to do  some sort of recursive function and step through each peer and its interfaces.  Any pointers would be much apperciated.


Thanks

Filipp Sudanov

Currently not really possible. I've just created an issue: https://track.radensolutions.com/issue/NX-2292
When this issue would be fixed, it would be possible to select some node connected to that specific interface of the core switch as seed node. Then in filter script you'd be able to filter out the core switch and it won't go pass the core switch when building the map.