From 252930580349771bfb81c06619ff3349b6ce8378 Mon Sep 17 00:00:00 2001 From: Jeroen van Ingen <> Date: Mon, 23 Aug 2010 11:38:55 +0000 Subject: [PATCH] Add placeholder method peth_port_power() to PowerEthernet class; overrides to actually return data in Cisco, Extreme and HP classes. --- ChangeLog | 2 ++ Info/CiscoPower.pm | 10 +++++++++- Info/Layer2/HP.pm | 25 +++++++++++++++++++++++++ Info/Layer3/Extreme.pm | 11 +++++++++++ Info/PowerEthernet.pm | 14 ++++++++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 942d74ef..496042de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ version 2.02 () + [2599795] Added vendor_i_type() method to HP and HP4000 clases + [2688801] Minor modification for obscure Proxim/Orinoco device (jrbinks) + + [3051443] Add PoE measured power per port to Cisco, Extrme and HP + classes (jeroenvi) * Minor tweaks to support devices without sysServices version 2.01 (06/12/09) diff --git a/Info/CiscoPower.pm b/Info/CiscoPower.pm index 0d3c3019..e62fb97a 100644 --- a/Info/CiscoPower.pm +++ b/Info/CiscoPower.pm @@ -45,7 +45,10 @@ $VERSION = '2.01'; %GLOBALS = (); -%FUNCS = ( 'cpeth_ent_phy' => 'cpeExtPsePortEntPhyIndex', ); +%FUNCS = ( + 'cpeth_ent_phy' => 'cpeExtPsePortEntPhyIndex', + 'peth_port_power' => 'cpeExtPsePortPwrConsumption', +); %MUNGE = (); @@ -143,6 +146,11 @@ to a hash. Maps the C to C by way of the F. +=item $poe->peth_port_power() + +Power supplied by PoE ports, in milliwatts +("cpeExtPsePortPwrConsumption") + =back =cut diff --git a/Info/Layer2/HP.pm b/Info/Layer2/HP.pm index e55a964f..d53ddd02 100644 --- a/Info/Layer2/HP.pm +++ b/Info/Layer2/HP.pm @@ -59,6 +59,8 @@ $VERSION = '2.02-cvs'; 'NETSWITCH-MIB' => 'hpMsgBufFree', 'CONFIG-MIB' => 'hpSwitchConfig', 'HP-ICF-CHASSIS' => 'hpicfSensorObjectId', + 'HP-ICF-BRIDGE' => 'hpicfBridgeRstpForceVersion', + 'HP-ICF-POE-MIB' => 'hpicfPoePethPsePortCurrent', ); %GLOBALS = ( @@ -74,6 +76,7 @@ $VERSION = '2.02-cvs'; 'os_version' => 'hpSwitchOsVersion.0', 'os_bin' => 'hpSwitchRomVersion.0', 'mac' => 'hpSwitchBaseMACAddress.0', + 'rstp_ver' => 'hpicfBridgeRstpForceVersion', ); %FUNCS = ( @@ -95,6 +98,9 @@ $VERSION = '2.02-cvs'; 'hp_s_oid' => 'hpicfSensorObjectId', 'hp_s_name' => 'hpicfSensorDescr', 'hp_s_status' => 'hpicfSensorStatus', + + # HP-ICF-POE-MIB + 'peth_port_power' => 'hpicfPoePethPsePortPower', ); %MUNGE = ( @@ -190,6 +196,11 @@ $VERSION = '2.02-cvs'; # Method Overrides +sub stp_ver { + my $hp = shift; + return $hp->rstp_ver() || $hp->SUPER::stp_ver(); +} + sub cpu { my $hp = shift; return $hp->hp_cpu(); @@ -667,6 +678,10 @@ Included in V2 mibs from Cisco =item F +=item F + +=item F + =back The last four MIBs listed are from HP and can be found at @@ -826,6 +841,16 @@ Power supply 1 status Power supply 2 status +=item $hp->peth_port_power() + +Power supplied by PoE ports, in milliwatts +("hpicfPoePethPsePortPower") + +=item $hp->stp_ver() + +Returns what version of STP the device is running. +("hpicfBridgeRstpForceVersion" with fallback to inherited stp_ver()) + =back =head2 Globals imported from SNMP::Info::Layer2 diff --git a/Info/Layer3/Extreme.pm b/Info/Layer3/Extreme.pm index c32dcc47..a40c5846 100644 --- a/Info/Layer3/Extreme.pm +++ b/Info/Layer3/Extreme.pm @@ -52,6 +52,7 @@ $VERSION = '2.01'; 'EXTREME-SYSTEM-MIB' => 'extremeSystem', 'EXTREME-FDB-MIB' => 'extremeSystem', 'EXTREME-VLAN-MIB' => 'extremeVlan', + 'EXTREME-POE-MIB' => 'extremePethSystemAdminEnable', ); %GLOBALS = ( @@ -82,6 +83,8 @@ $VERSION = '2.01'; # EXTREME-VLAN-MIB:extremeVlanEncapsIfTable 'ex_vlan_encap_tag' => 'extremeVlanEncapsIfTag', + + 'peth_port_power' => 'extremePethPortMeasuredPower', ); %MUNGE = ( @@ -587,6 +590,8 @@ my $extreme = new SNMP::Info::Layer3::Extreme(...); =item F +=item F + =item Inherited Classes' MIBs See classes listed above for their required MIBs. @@ -748,6 +753,11 @@ identifier (iid) Returns (C) for both key and value since we're using F rather than F. +=item $extreme->peth_port_power() + +Power supplied by PoE ports, in milliwatts +("extremePethPortMeasuredPower") + =back =head2 Table Methods imported from SNMP::Info::Layer3 @@ -808,6 +818,7 @@ with the numeric VLAN ID and port C. $extreme->set_remove_i_vlan_tagged('2', $if_map{'FastEthernet0/1'}) or die "Couldn't add port to egress list. ",$extreme->error(1); + =back =head1 Data Munging Callback Subroutines diff --git a/Info/PowerEthernet.pm b/Info/PowerEthernet.pm index 1c9b7ad0..1cb1ca3b 100644 --- a/Info/PowerEthernet.pm +++ b/Info/PowerEthernet.pm @@ -89,6 +89,10 @@ sub peth_port_ifindex { return $peth_port_ifindex; } +sub peth_port_power { + return {}; +} + 1; __END__ @@ -174,6 +178,16 @@ class of the device being powered. C +=item $poe->peth_port_power() + +Power sourced: if status is delivering power, this represents the actual +power output to the device being powered. This is not included in the MIB, +but we include a placeholder for the function so it can be included in +device classes in a uniform manner. + +Currently the Cisco, Extreme and HP classes override this method to return +actual values. + =item $poe->peth_port_ifindex() A mapping function from the C INDEX of