API for Rear Port and Front Port Cable tracing

59 views
Skip to first unread message

Astrit Çepele

unread,
Oct 21, 2019, 1:40:41 PM10/21/19
to NetBox
Hi, 

I have a kind of situation in my devices that I want to trace the connection from my rear socket port into the switch ( through a patch panel).

I am not sure if there is any kind of API if I am able to trace the cable from the rear port into an interface of a switch, although there is already a button configured.

I am using Netbox 2.5.10.

Brian Candler

unread,
Oct 22, 2019, 4:04:39 AM10/22/19
to NetBox
You can't trace from the rear port through to the front port.  That's because one rear port may be linked to many front ports.  You need to select the relevant front port yourself, and then trace from there.  That should work in the GUI.

As for API: I see in netbox/dcim/api/views.py there is a CableTraceMixin which is included in the views for interface, consoleport/consoleserverport and powerport/poweroutlet. Try:


But the code suggests it may not be available for frontport or rearport.

Astrit Çepele

unread,
Oct 24, 2019, 3:44:55 AM10/24/19
to NetBox
That is very pitty in fact. Since i am able to have to do a cable trace from the rear port of the socket, through the patch panel to my switch interface (sa, it would have been nice to be available via API:

R0-switch.PNG




The controversy is that I can do a trace from the interface of the switch up to the front port of my socket.

switch - F0.PNG



Personally this is something that I was able to do but via 6 API calls and that makes my script a bit slow.

Brian Candler

unread,
Oct 24, 2019, 4:48:44 PM10/24/19
to NetBox
On Thursday, 24 October 2019 08:44:55 UTC+1, Astrit Çepele wrote:
That is very pitty in fact. Since i am able to have to do a cable trace from the rear port of the socket, through the patch panel to my switch interface (sa, it would have been nice to be available via API:


I would have thought that would work through API too, as it uses the same underlying function.

If you start at a rear port, then the trace will follow from that rear port to the next rear port it's connected to.  From there it will go through to a remote device interface - but if the rear port is associated to multiple front ports, it will only pick the first front port.  There's a ticket for that somewhere.

But it won't trace through to the front port that the rear port is directly connected to.

Astrit Çepele

unread,
Oct 25, 2019, 7:10:50 AM10/25/19
to NetBox
What can be a real case when a Rear port is connected to many front ports?

Brian Candler

unread,
Oct 25, 2019, 7:44:35 AM10/25/19
to NetBox
On Friday, 25 October 2019 12:10:50 UTC+1, Astrit Çepele wrote:
What can be a real case when a Rear port is connected to many front ports?


A patch panel which has 6 duplex LC connectors on the front, and a 12-fibre MPO port at the rear to connect to another patch panel.

Sander Steffann

unread,
Oct 27, 2019, 5:37:40 AM10/27/19
to Astrit Çepele, NetBox
Hi,

> What can be a real case when a Rear port is connected to many front ports?

A DWDM mux where multiple front ports with each their own wavelength are combined into one DWDM link with many wavelengths.

Cheers,
Sander

Reply all
Reply to author
Forward
0 new messages