Cable Trace for Power Port/Outlet: show all segments for path to the Power Panel #4424

Closed
opened 2025-12-29 18:35:52 +01:00 by adam · 9 comments
Owner

Originally created by @Starkstromkonsument on GitHub (Dec 31, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.10.2

Proposed Functionality

Show all segments in the Cable Trace for Power Ports/Outlets starting with the current port/outlet back up until the Power Panel, as is done for network connections throughout several patch panels and cables. At the moment only the current segment is shown.

Use Case

Imagine an example setup:

Power Panel |--> Power Feed 1 --> PDU 1 |--> UPS1 --> PDU 1.1 |--> Server 1 PSU 1
            |                           |                     |--> Server 2 PSU 1
            |                           |                     |--> etc.
            |                           |
            |                           |--> UPS2 --> PDU 1.2 |--> Server 1 PSU 2
            |                           |                     |--> etc.
            |                           |
            |                           |--> etc.
            |                          
            |--> Power Feed 2 --> PDU 2 |--> UPS3 --> PDU 2.1 |--> Server 2 PSU 2
                                        |                     |--> Server 3 PSU
                                        |                     |--> etc.
                                        |
                                        |--> UPS4 --> PDU 2.2 |--> Server 4 PSU
                                        |                     |--> etc.
                                        |
                                        |--> etc.

I'm not saying this is a good grid design, but well, it happens... it would facilitate things if tracing the power plug of e.g. "Server 2 PDU 2" would print the whole trace path and not only the segment between "PDU 2.1" and "Server 2 PSU 2". The corresponding UPS and Power Feed are probably the most interesting information's along the trace path.

Database Changes

none?

External Dependencies

none?

Originally created by @Starkstromkonsument on GitHub (Dec 31, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please start a discussion instead: https://github.com/netbox-community/netbox/discussions NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.9 * NetBox version: 2.10.2 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Show all segments in the Cable Trace for Power Ports/Outlets starting with the current port/outlet back up until the Power Panel, as is done for network connections throughout several patch panels and cables. At the moment only the current segment is shown. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case Imagine an example setup: ``` Power Panel |--> Power Feed 1 --> PDU 1 |--> UPS1 --> PDU 1.1 |--> Server 1 PSU 1 | | |--> Server 2 PSU 1 | | |--> etc. | | | |--> UPS2 --> PDU 1.2 |--> Server 1 PSU 2 | | |--> etc. | | | |--> etc. | |--> Power Feed 2 --> PDU 2 |--> UPS3 --> PDU 2.1 |--> Server 2 PSU 2 | |--> Server 3 PSU | |--> etc. | |--> UPS4 --> PDU 2.2 |--> Server 4 PSU | |--> etc. | |--> etc. ``` I'm not saying this is a good grid design, but well, it happens... it would facilitate things if tracing the power plug of e.g. "Server 2 PDU 2" would print the whole trace path and not only the segment between "PDU 2.1" and "Server 2 PSU 2". The corresponding UPS and Power Feed are probably the most interesting information's along the trace path. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes none? <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies none?
adam added the type: featurestatus: needs ownerpending closure labels 2025-12-29 18:35:52 +01:00
adam closed this issue 2025-12-29 18:35:52 +01:00
Author
Owner

@Starkstromkonsument commented on GitHub (Jan 2, 2021):

I'm sorry for the noise, I read some of the other issues in the meantime. Power loops (#3782) will very likely be a problem for this feature request too.

IMHO loops should not be tolerated (from https://github.com/netbox-community/netbox/issues/3377#issuecomment-753447760):

I can't see a valuable use case. Electrical power circuits should always be protected by corresponding fuses/switchgears. Building loops or interconnecting different circuits ends up in a mess and can get very dangerous in case of a fault. This is what devices with multiple PSUs are built for.

As far as I understood the discussions on the other issues and PRs, nobody brought up a use case for power loops so far. If you want to allow loops anyway, it could be a solution to run the new loop detection test_cable_cannot_create_power_loop (from #3897) first and just show the current segment and an error message "loop detected, can't trace full path" instead of the full path. I hope this does not introduce a performance issue though.

@Starkstromkonsument commented on GitHub (Jan 2, 2021): I'm sorry for the noise, I read some of the other issues in the meantime. Power loops (#3782) will very likely be a problem for this feature request too. IMHO loops should not be tolerated (from https://github.com/netbox-community/netbox/issues/3377#issuecomment-753447760): > I can't see a valuable use case. Electrical power circuits should always be protected by corresponding fuses/switchgears. Building loops or interconnecting different circuits ends up in a mess and can get very dangerous in case of a fault. This is what devices with multiple PSUs are built for. As far as I understood the discussions on the other issues and PRs, nobody brought up a use case for power loops so far. If you want to allow loops anyway, it could be a solution to run the new loop detection `test_cable_cannot_create_power_loop` (from #3897) first and just show the current segment and an error message "loop detected, can't trace full path" instead of the full path. I hope this does not introduce a performance issue though.
Author
Owner

@stale[bot] commented on GitHub (Feb 22, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Feb 22, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@engageant commented on GitHub (Mar 1, 2021):

I'd like to have this functionality as well. We're in a situation right now where we need to replace a UPS and need to know its dependencies. This is currently a manual process. Having end-to-end visibility would greatly simplify this and reduce human error.

@engageant commented on GitHub (Mar 1, 2021): I'd like to have this functionality as well. We're in a situation right now where we need to replace a UPS and need to know its dependencies. This is currently a manual process. Having end-to-end visibility would greatly simplify this and reduce human error.
Author
Owner

@rmuehl commented on GitHub (Mar 24, 2021):

Another reason why this would be very helpful: if you need to shut off a power breaker for electrical maintenance, you could see the whole tree of devices involved.

@rmuehl commented on GitHub (Mar 24, 2021): Another reason why this would be very helpful: if you need to shut off a power breaker for electrical maintenance, you could see the whole tree of devices involved.
Author
Owner

@jeremystretch commented on GitHub (Apr 21, 2021):

This is probably doable, but someone needs to come up with a proof of concept and tests. Bear in mind we also need a way to elegantly handle "southbound" tracing (from power sources to their consumers).

@jeremystretch commented on GitHub (Apr 21, 2021): This is _probably_ doable, but someone needs to come up with a proof of concept and tests. Bear in mind we also need a way to elegantly handle "southbound" tracing (from power sources to their consumers).
Author
Owner

@github-actions[bot] commented on GitHub (Jun 20, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jun 20, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@AnneWielis commented on GitHub (Jul 19, 2021):

For my personal use i created a utility that does a quick and dirty solution by manually calculating lower-level power sources by means of a cron job: https://github.com/AnneWielis/NetBoxUtils

@AnneWielis commented on GitHub (Jul 19, 2021): For my personal use i created a utility that does a quick and dirty solution by manually calculating lower-level power sources by means of a cron job: https://github.com/AnneWielis/NetBoxUtils
Author
Owner

@martinum4 commented on GitHub (Aug 10, 2021):

I am interested in this as well, especially since the "'southbound' tracing" gives an opportunity to implement the same mechanics for network devices as well, e.g. find all switches that are connected to another switch.

@martinum4 commented on GitHub (Aug 10, 2021): I am interested in this as well, especially since the "'southbound' tracing" gives an opportunity to implement the same mechanics for network devices as well, e.g. find all switches that are connected to another switch.
Author
Owner

@jeremystretch commented on GitHub (Sep 14, 2021):

Closing this out as no one has volunteered to own this.

@jeremystretch commented on GitHub (Sep 14, 2021): Closing this out as no one has volunteered to own this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4424