nav
nav copied to clipboard
Make it possible to turn on PoE in PortAdmin
How do to this will likely vary from vendor to vendor, and not all vendors will support SNMP write operations to do this. If we were to concentrate on some of the most common vendors in the Norwegian HE sector, we need to investigate how to do this for:
- [x] #2632
- [ ] #2634
- [x] #2633
- [x] #2690
Feedback from nav-ref indicates that this is not simply a "on/off" choice, but potentially a choice between "off" and several other "on"-type configs:
- Off is pretty self-explanatory
- Auto would mean On, but with auto-negotiation of the power class
- Class 1 through Class 4 (and potentially, class 5 may become an option due to recent developments). This means On, but locked to a specific power class.
Additionally, a button or option to simply power-cycle a port has been requested. The potential use of this is to force a reboot of the connected equipment.
Then, there is also #2186 - which shows that not all vendors will automatically turn PoE off when the port is shutdown. This could only be implemented once general PoE support becomes available, and in this instance, it would be specific for Aruba devices.
Off / Auto would be will be sufficient. We usely never use the "Class"-settings.
leaving some notes here with relevant info:
The standard POWER-ETHERNET-MIB only supports turning on/off PoE on ports as far as I can see. Also some problems with not all ports being available there directly, but through groups instead? But that might be for statistics, turning on/off PoE probably works on a port-by-port basis. But it does not support setting manual power classes, or using the 'auto' feature, so proprietary mibs are required.
CISCO-POWER-ETHERNET-EXT-MIB adds much more configuration.
cpeExtPsePortEnable allows more control on how the port behaves. It has auto, static, limit and disable. 'auto' will select power automatically, so that seems to fulfill the auto requirement. 'disable' disables PoE, again this is something we want.
The problem is how to manually set a specific power class. 'static' selects power based on how the power sourcing equipment is configured. This does not seem to do what we want. 'limit' uses the value of cpeExtPsePortPwrMax (cpeExtDefaultAllocation is used as well i think), but this does not seem to correspond directly to one of the classes. But I guess this is the closest to what we want? Im guessing based on the values you put in, the switch translates it to a class and puts that info in cpeExtPsePortLldpPwrClass.
The standard POWER-ETHERNET-MIB only supports turning on/off PoE on ports as far as I can see. Also some problems with not all ports being available there directly, but through groups instead?
Yes, I remember faintly there were issues with this on NAV's first brush with collecting PoE information. A lot of details aren't available for individual ports in this MIB, but for port "groups" instead.
But that might be for statistics, turning on/off PoE probably works on a port-by-port basis. But it does not support setting manual power classes, or using the 'auto' feature, so proprietary mibs are required.
On first sight, the MIB seems to only support setting the pethPsePortAdminEnable
value to enable/disable PoE on a port - but as you've observed, there doesn't seem to be a way to influence the actual power options.
'limit' uses the value of cpeExtPsePortPwrMax (cpeExtDefaultAllocation is used as well i think), but this does not seem to correspond directly to one of the classes. But I guess this is the closest to what we want? Im guessing based on the values you put in, the switch translates it to a class and puts that info in cpeExtPsePortLldpPwrClass.
The discussed feature is mainly about either disabling PoE, or enabling it by selecting some mode from a dropdown list (either a power class or auto
or on
).
I guess the backend ManagementHandler
has to be prepared to produce a list of available "options" per port, depending on what it finds support for. The PortAdmin UI PoE dropdown should only list the supported options.
Configuring numbers/limits is not within the scope set by this task, so I would try to avoid that (it also would complicate the UI beyond just a mere dropdown).
frontend notes: Ikke inkluder Poe options/kolonne om devicen ikke støtter poe (i praksis: om ingen interfacer har en state når du bruke get_poe_states, så tolk det som at devicen ikke støtter det og ikke vis noe. Eventuelt legg til nye funksjon device_supports_poe som på en smartere måte kan sjekke om poe er støttet, men det kan bli en egen pull request
Om det er en rask måte å sjekke om en device som helhet støtter PoE så kan man gjøre portadmin noe raskere med å skippe get_poe_states kall