SNMP::...thernet(3pm)

✨ NAME ✨

SNMP::Info::PowerEthernet β€” the SNMP bestie that talks to all the data chillin' in POWER-ETHERNET-MIB. πŸ’–

(also, the manual page header calls this thing SNMP::...thernet(3pm), and it lives in the User Contributed Perl Documentation section, iykyk 🫢)

πŸ‘‘ AUTHOR πŸ‘‘

Bill Fenner wrote this. iconic of him, honestly. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

# Let SNMP::Info determine the correct subclass for you.
my $poe = new SNMP::Info(
                         AutoSpecify => 1,
                         Debug       => 1,
                         DestHost    => 'myswitch',
                         Community   => 'public',
                         Version     => 2
                       )
   or die "Can't connect to DestHost.\n";

my $class      = $poe->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";

like, you literally just let it pick its own subclass and it tells you what it picked. main character behavior fr fr. 🌟


🌸 DESCRIPTION 🌸

POWER-ETHERNET-MIB is the MIB that describes PoE β€” that's IEEE 802.3af, bestie, the thing that sends power down the ethernet cable so your access point doesn't need its own lil wall wart. βš‘πŸ’–

⚠️ ok so listen: create or use a device subclass that inherits this class. Do not use it directly. this is the blueprint, not the house. 🏠

For debugging purposes you can call this class directly the same way you'd call SNMP::Info:

my $poe = new SNMP::Info::PowerEthernet (...);

πŸ¦‹ Inherited Classes πŸ¦‹

none. it's giving self-made. πŸ’€

πŸŽ€ Required MIBs πŸŽ€

POWER-ETHERNET-MIB


πŸ’œ GLOBALS πŸ’œ

none. nothing here. empty. a vacuum. 🌈


πŸ’… TABLE METHODS πŸ’…

These are methods that return tables of information in the form of a reference to a hash. (yes bestie, a hashref. get into it. πŸ“)

⭐ Power Port Table ⭐

Selected values from the "pethPsePortTable" β€” the lil table about ports that might get to hand out power. πŸ‘‘

  • $poe->peth_port_admin() β€” administrative status: is this port, like, permitted to deliver power? yes or no energy.
    • maps to "pethPsePortAdminEnable"
  • $poe->peth_port_status() β€” current status: is this port delivering power, searching, disabled, etc? the vibe check of the port, basically.
    • maps to "pethPsePortDetectionStatus"
  • $poe->peth_port_class() β€” device class: if status is delivering power, this represents the 802.3af class of the device being powered.
    • maps to "pethPsePortPowerClassifications"
  • $poe->peth_port_ifindex() β€” a mapping function from the "pethPsePortTable" INDEX of module.port to an "ifIndex". The default mapping ignores the module β€” it returns undef if there are any module values greater than 1 β€” and just returns the port number, assuming there's a 1:1 mapping.
    • ngl, this mapping is more or less left up to the device vendor to implement; the MIB gives only very weak guidance. a given device class may implement its own version of this function (e.g. go peek at Info::CiscoPower). πŸ™ˆ
  • $poe->peth_port_neg_power() β€” the power, in milliwatts, that has been committed to this port. This value is derived from the 802.3af class of the device being powered, but it may be overridden by a subclass that has information from another source (e.g. if a different protocol, such as CDP, was used to negotiate the power level). ✨

🌈 Power Supply Table 🌈

  • $poe->peth_power_watts() β€” the power supply's capacity, in watts.
    • maps to "pethMainPsePower"
  • $poe->peth_power_status() β€” the power supply's operational status.
    • maps to "pethMainPseOperStatus"
  • $poe->peth_power_consumption() β€” how much power, in watts, this power supply has been committed to deliver.
    • maps to "pethMainPseConsumptionPower"
    • > 😭 heads up: certain devices seem to supply this value in milliwatts instead, so be cautious interpreting it. stay safe out there.
  • $poe->peth_power_threshold() β€” the threshold (in percent) of consumption required to raise an alarm.
    • maps to "pethMainPseUsageThreshold"

and that's the whole page, bestie. go forth and poll responsibly. πŸ’œβœ¨

~( ΛΆΛ†α—œΛ†Λ΅ ) this lil writeup came from perl v5.40.1, dated 2026-02-28, and yeah it's still filed under SNMP::...thernet(3pm) β€” the truncation is real but so is my love for you. mwah. πŸ«ΆπŸ’–~

πŸ“¦ where this page comes from