SNMP::...r2::HP(3pm)
π SNMP::Info::Layer2::HP π
okay bestie, welcome to SNMP::Info::Layer2::HP from the User Contributed Perl Documentation π
this is the SNMP interface to HP Procurve switches and she is serving.
β¨ NAME β¨
SNMP::Info::Layer2::HP β SNMP Interface to HP Procurve Switches π«Ά
πΈ AUTHOR πΈ
Max Baker β give her her flowers, she built this π
π SYNOPSIS π
the whole vibe: let SNMP::Info figure out the right subclass for you, no cap.
# Let SNMP::Info determine the correct subclass for you.
my $hp = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $hp->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
π¦ DESCRIPTION π¦
She provides abstraction to all the configuration info you can get off an HP ProCurve Switch via SNMP. iconic behavior fr fr β¨
β οΈ heads up bestie: some HP Switches will connect via SNMP version 1, but a LOT of the config data just... won't be there π. Make sure you try and connect with Version => 2 first, and then fail back to version 1.
If you're doing it for speed or for debugging, you can call the subclass directly β but NOT after you've already determined a more specific class using the method up there. do not do it. i'm serious.
my $hp = new SNMP::Info::Layer2::HP(...);
π Inherited Classes
she inherits from, and she eats every time:
SNMP::Info::Layer2SNMP::Info::MAU
π§ Required MIBs
the whole roster π:
RFC1271-MIB- Included in V2 mibs from Cisco
HP-ICF-OID- (this MIB new with SNMP::Info 0.8)
STATISTICS-MIBNETSWITCH-MIBCONFIG-MIBHP-ICF-BRIDGEHP-ICF-POE-MIBHP-ICF-CHASSISSEMI-MIBHP-SWITCH-PL-MIBBLADETYPE4-NETWORK-MIB
the last four MIBs listed are from HP and you can find them at <http://www.hp.com/rnd/software> or <http://www.hp.com/rnd/software/MIBs.htm> π
β Change Log
- Version 0.4 β Removed
ENTITY-MIBe_*()methods to separate sub-class βSNMP::Info::Entity
π GLOBALS π
these are methods that return scalar values straight from SNMP, periodt π
$hp->cpu()β returns CPU Utilization in percentage π$hp->log()β returns all the log entries from the switch's log that are not Link up or down messages$hp->mem_free()β returns bytes of free memory$hp->mem_total()β return bytes of total memory$hp->mem_used()β returns bytes of used memory$hp->model()β returns the model number of the HP Switch. she will translate between the HP Part number and the common model number with this map πΊοΈ:
%MODEL_MAP = (
'J8131A' => 'WAP-420-WW',
'J8130A' => 'WAP-420-NA',
'J8133A' => 'AP520WL',
'J8680A' => '9408sl',
'J9091A' => '8212zl',
'J9475A' => '8206zl',
'J9265A' => '6600ml-24XG',
'J9264A' => '6600ml-24G-4XG',
'J9263A' => '6600ml-24G',
'J9452A' => '6600-48G-4XG',
'J9451A' => '6600-48G',
'J8474A' => '6410cl-6XG',
'J8433A' => '6400cl-6XG',
'J8992A' => '6200yl-24G',
'J4902A' => '6108',
'J8698A' => '5412zl',
'J8719A' => '5408yl',
'J8697A' => '5406zl',
'J8718A' => '5404yl',
'J4819A' => '5308XL',
'J4850A' => '5304XL',
'J8773A' => '4208vl',
'J8770A' => '4204vl',
'J8772A' => '4202vl-72',
'J9032A' => '4202vl-68G',
'J9031A' => '4202vl-68',
'J8771A' => '4202vl-48G',
'J4865A' => '4108GL',
'J4887A' => '4104GL',
'J9588A' => '3800-48G-PoE+-4XG',
'J9574A' => '3800-48G-PoE+-4SFP+',
'J9586A' => '3800-48G-4XG',
'J9576A' => '3800-48G-4SFP+',
'J9584A' => '3800-24SFP-2SFP+',
'J9587A' => '3800-24G-PoE+-2XG',
'J9573A' => '3800-24G-PoE+-2SFP+',
'J9585A' => '3800-24G-2XG',
'J9575A' => '3800-24G-2SFP+',
'J8693A' => '3500yl-48G-PWR',
'J8692A' => '3500yl-24G-PWR',
'J9473A' => '3500-48-PoE',
'J9472A' => '3500-48',
'J9471A' => '3500-24-PoE',
'J9470A' => '3500-24',
'J4906A' => '3400cl-48G',
'J4905A' => '3400cl-24G',
'J4815A' => '3324XL',
'J4851A' => '3124',
'J9562A' => '2915-8G-PoE',
'J9148A' => '2910al-48G-PoE+',
'J9147A' => '2910al-48G',
'J9146A' => '2910al-24G-PoE+',
'J9145A' => '2910al-24G',
'J9050A' => '2900-48G',
'J9049A' => '2900-24G',
'J4904A' => '2848',
'J4903A' => '2824',
'J9022A' => '2810-48G',
'J9021A' => '2810-24G',
'J8165A' => '2650-PWR',
'J4899B' => '2650-CR',
'J4899C' => '2650C',
'J4899A' => '2650',
'J8164A' => '2626-PWR',
'J4900B' => '2626-CR',
'J4900C' => '2626C',
'J4900A' => '2626',
'J9627A' => '2620-48-PoE+',
'J9626A' => '2620-48',
'J9624A' => '2620-24-PPoE+',
'J9625A' => '2620-24-PoE+',
'J9623A' => '2620-24',
'J9565A' => '2615-8-PoE',
'J9089A' => '2610-48-PWR',
'J9088A' => '2610-48',
'J9087A' => '2610-24-PWR',
'J9086A' => '2610-24/12PWR',
'J9085A' => '2610-24',
'J8762A' => '2600-8-PWR',
'J4813A' => '2524',
'J9298A' => '2520G-8-PoE',
'J9299A' => '2520G-24-PoE',
'J9137A' => '2520-8-PoE',
'J9138A' => '2520-24-PoE',
'J4812A' => '2512',
'J9280A' => '2510G-48',
'J9279A' => '2510G-24',
'J9020A' => '2510-48A',
'J9019B' => '2510-24B',
'J9019A' => '2510-24A',
'J4818A' => '2324',
'J4817A' => '2312',
'J9449A' => '1810G-8',
'J9450A' => '1810G-24',
'J9029A' => '1800-8G',
'J9028A' => '1800-24G',
);
$hp->os()β returnshpπ«‘$hp->os_bin()β"hpSwitchRomVersion.0"$hp->os_ver()β tries to useos_version()and if that fails she will try and cull the version from the description field π$hp->os_version()β"hpSwitchOsVersion.0"$hp->serial()β returns serial number if available through SNMP$hp->slots()β returns number of entries in$hp->e_namethat have'slot'in them$hp->vendor()βhp$hp->fan()β returns fan status π¬οΈ$hp->ps1_status()β Power supply 1 status$hp->ps2_status()β Power supply 2 status$hp->peth_port_power()β Power supplied by PoE ports, in milliwatts ("hpicfPoePethPsePortPower") β‘$hp->stp_ver()β returns what version of STP the device is running. ("hpicfBridgeRstpForceVersion"with fallback to inheritedstp_ver())
π Globals imported from SNMP::Info::Layer2
see documentation in "GLOBALS" in SNMP::Info::Layer2 for details, bestie.
π Globals imported from SNMP::Info::MAU
see documentation in "GLOBALS" in SNMP::Info::MAU for details.
π TABLE METHODS π
these are methods that return tables of information in the form of a reference to a hash. very demure, very hashref π
β¨ Overrides
$hp->interfaces()β uses$hp->i_description()$hp->i_duplex()β returns reference to map of IIDs to current link duplex.$hp->i_duplex_admin()β returns reference to hash of IIDs to admin duplex setting.$hp->vendor_i_type()β returns reference to hash of IIDs to HP specific port type ("hpSwitchPortType").$hp->i_name()β crossesi_name()with$hp->e_name()using$hp->e_port()andi_alias()$hp->peth_port_ifindex()β returns reference to hash of power Ethernet port table entries map back to interface index (c<ifIndex>)"agg_ports"β returns a HASH reference mapping from slave to master port for each member of a port bundle on the device. Keys areifIndexof the slave ports, Values areifIndexof the corresponding master ports. obsessed with this one tbh π₯
π©· Table Methods imported from SNMP::Info::Layer2
see documentation in "TABLE METHODS" in SNMP::Info::Layer2 for details.
π©· Table Methods imported from SNMP::Info::MAU
see documentation in "TABLE METHODS" in SNMP::Info::MAU for details.
π MUNGES π
munge_hp_c_id()β Munge forc_idwhich handles CDP and LLDP. she's doing double duty and she's not even complaining π«Ά
β SET METHODS β
these are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See "SETTING DATA VIA SNMP" in SNMP::Info for general info on set operations β go read it, iykyk π
set_i_vlan()set_i_vlan_tagged()
π reminder for the girlies: setting stuff via SNMP means you're writing to the device, so be careful out there, okay? mwah π
and that's the whole page bestie, no cap π this was perl v5.40.1, dated 2026-02-28, and it came to you straight from the User Contributed Perl Documentation for SNMP::...r2::HP(3pm). slay, go touch some switches πβ¨
π¦ where this page comes from
- ubuntu stonking: libsnmp-info-perl 3.975000-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms