netbox-topology-views icon indicating copy to clipboard operation
netbox-topology-views copied to clipboard

3.3.0-beta2 can't hide patchpanels from Topology to get end2end connection

Open peterbaumert opened this issue 2 years ago • 2 comments

Before 3.3.0 it was possible to hide patchpanels and show "end2end connections" this now doesn't work anymore, or i don't know how to :)

peterbaumert avatar Sep 02 '22 15:09 peterbaumert

^^ and the "show intermediate devices" field type would be awesome to have back.

cyberndj avatar Oct 03 '22 23:10 cyberndj

I'm looking forward to see that feature back.

joaolucasmacedo avatar Oct 07 '22 14:10 joaolucasmacedo

+1 for a return of "end2end connections"!

It used to be possible to see the logical connections between devices, hiding the noisy details of intervening patch panels.

Now you either see no connection at all, or you see physical cables only. In the following example (from my small home network), lots of cables go through the same patch panel, and this obscures what connects to what :-(

image

I see that end2end connections was removed in 318b8495b as part of adding Netbox 3.3 support, so I wonder if the Netbox data model now makes it difficult to implement?

candlerb avatar Nov 03 '22 20:11 candlerb

I'm looking forward to having this back too. Is anyone working on this?

tgrusendorf avatar Nov 06 '22 23:11 tgrusendorf

I've worked out the changes to bring back end to end connections with 3.3.0 and above and done a proof of concept. I'll start a branch and PR for it.

I've also added cables and wireless links to the selection options so that you can pick and choose any combination of types connections you want to include on the topology diagram.

image

tgrusendorf avatar Nov 19 '22 01:11 tgrusendorf

My first working commit is here: https://github.com/tgrusendorf/netbox-topology-views/tree/end-to-end-connections

I've taken a different approach than pycolas, using the same view as you will find under Connections -> Interface Connections in NetBox to generate the connections.

tgrusendorf avatar Nov 19 '22 16:11 tgrusendorf

Awesome! I just applied https://github.com/mattieserver/netbox-topology-views/commit/0b8c4caaec1c8a1fdd92010a1fe8d42e444c634f.diff and it looks great.

Only minor issue I can find: if I select both "Hide unconnected" and "Show end-to-end interface connections", I get a completely blank result. "Hide unconnected" with "Show cables" works fine though.

Selecting both "Show cables" and "Show end-to-end interface connections" is a bit weird since links appear twice, but I guess that's what I asked for :-)

candlerb avatar Nov 19 '22 16:11 candlerb

How

Awesome! I just applied https://github.com/mattieserver/netbox-topology-views/commit/0b8c4caaec1c8a1fdd92010a1fe8d42e444c634f.diff and it looks great.

Only minor issue I can find: if I select both "Hide unconnected" and "Show end-to-end interface connections", I get a completely blank result. "Hide unconnected" with "Show cables" works fine though.

Selecting both "Show cables" and "Show end-to-end interface connections" is a bit weird since links appear twice, but I guess that's what I asked for :-)

How can I test it? Which file do I need to replace?

joaolucasmacedo avatar Nov 19 '22 18:11 joaolucasmacedo

This is what I did:

cd /opt/netbox/venv/lib/python3.8/site-packages/netbox_topology_views
wget https://github.com/mattieserver/netbox-topology-views/commit/0b8c4caaec1c8a1fdd92010a1fe8d42e444c634f.diff
patch -p2 <0b8c4caaec1c8a1fdd92010a1fe8d42e444c634f.diff
systemctl restart netbox

candlerb avatar Nov 19 '22 18:11 candlerb

Awesome! I just applied https://github.com/mattieserver/netbox-topology-views/commit/0b8c4caaec1c8a1fdd92010a1fe8d42e444c634f.diff and it looks great.

Only minor issue I can find: if I select both "Hide unconnected" and "Show end-to-end interface connections", I get a completely blank result. "Hide unconnected" with "Show cables" works fine though.

Selecting both "Show cables" and "Show end-to-end interface connections" is a bit weird since links appear twice, but I guess that's what I asked for :-)

I see what I missed. I'll fix "Hide unconnected" in the next couple of days.

tgrusendorf avatar Nov 19 '22 19:11 tgrusendorf

It worked just fine. Thanks guys. It is very expected feature.

joaolucasmacedo avatar Nov 19 '22 20:11 joaolucasmacedo

Awesome! I just applied https://github.com/mattieserver/netbox-topology-views/commit/0b8c4caaec1c8a1fdd92010a1fe8d42e444c634f.diff and it looks great. Only minor issue I can find: if I select both "Hide unconnected" and "Show end-to-end interface connections", I get a completely blank result. "Hide unconnected" with "Show cables" works fine though. Selecting both "Show cables" and "Show end-to-end interface connections" is a bit weird since links appear twice, but I guess that's what I asked for :-)

I see what I missed. I'll fix "Hide unconnected" in the next couple of days.

New commit today fixes showing end-to-end connections with 'Hide Unconnected' selected.

tgrusendorf avatar Nov 20 '22 20:11 tgrusendorf

LGTM: thanks!

candlerb avatar Nov 20 '22 21:11 candlerb

Worked perfectly. Great. However, when I selected only the "show cables" option, the power cables came. Would it be possible to include one more "hide power cables" option to work together with the "show cables"? powercables

demesilva avatar Nov 22 '22 16:11 demesilva

Yes, or perhaps "Show data cables" and "Show power cables".

Cables can only go between certain types of port: see COMPATIBLE_TERMINATION_TYPES.

I would be inclined to classify power cables as those which terminate in a powerport, poweroutlet or powerfeed, and data cables as everything else.

candlerb avatar Nov 22 '22 17:11 candlerb

While I agree those are good ideas, they are not directly related to this issue. Power cables were already included in the types of cables displayed prior to adding end to end interface connections. Maybe I've already overstepped by allowing cables and wireless links to be excluded, but I needed a way to hide them when viewing interface connections.

You can probably exclude them with the 'ignore_cable_type' configuration setting. I'd suggest opening a separate issue.

tgrusendorf avatar Nov 23 '22 03:11 tgrusendorf

Re. ignore_cable_type, see also #177. This is close to what's required; the problem is that's a fixed configuration (so if you set it to power port/outlet/feed, you can never see power cables).

Re. end-to-end interface connections: I think those should be defined as those cable runs which both start and end at an Interface only, so that they match the end-to-end connections as shown in the Netbox GUI itself against a given interface. If a cable run starts at an Interface but ends at a Frontport (say), then it's not an end-to-end connection.

candlerb avatar Nov 23 '22 08:11 candlerb

Re. ignore_cable_type: agreed.

Re. end-to-end interface connections: That is exactly what my current code does - only connections where both ends terminate on an interface are shown. Let me know if you're seeing something different. As discussed in #188, I'll probably rename the filter criteria to "Show Logical Connections'.

tgrusendorf avatar Nov 23 '22 14:11 tgrusendorf