SNMP::...HP4000(3pm)
β¨ NAME β¨
SNMP::...HP4000 β it's the SNMP::Info::Layer2::HP4000 module, bestie π
and it's your SNMP interface to the older HP ProCurve switches (the 1600, 2400, 2424M, 4000 and 8000 girlies, specifically). This page lives in the 3pm manual section, under User Contributed Perl Documentation. π
πΈ AUTHOR πΈ
Max Baker π
π¦ SYNOPSIS π¦
okay so the whole vibe here is: you let SNMP::Info figure out which subclass is the right one for your switch, 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";
periodt. π
π DESCRIPTION π
So basically this module gives you abstraction for all the configuration info you can pull off an HP ProCurve Switch via SNMP. β¨
ngl, watch out: some HP Switches will connect via SNMP version 1, but a lot of the config data will justβ¦ not be available. π So make sure you try connecting with Version 2 first, and then fail back to version 1. fr fr.
π§ Inherited Classes π§
SNMP::Info::Layer2SNMP::Info::MAU
π Required MIBs π
RFC1271-MIBβ included in the V2 mibs from CiscoHP-ICF-OIDHP-VLANβ (this MIB is new withSNMP::Info 0.8) πSTATISTICS-MIBNETSWITCH-MIBCONFIG-MIB
The last five MIBs listed are from HP and can be found 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 a scalar value from SNMP. iconic.
$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. (we're filtering the noise, bestie π§Ή)$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. Will translate between the HP Part number and the common model number with this map :
%MODEL_MAP = (
'J4093A' => '2424M',
'J4110A' => '8000M',
'J4120A' => '1600M',
'J4121A' => '4000M',
'J4122A' => '2400M',
'J4122B' => '2424M',
);
$hp->os()β Returnshp$hp->os_bin()β"hpSwitchRomVersion.0"$hp->os_ver()β Tries to useos_version()and if that fails 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 haveslotin them.$hp->vendor()βhp$hp->fan()β Returns fan status π$hp->ps1_status()β Power supply 1 status$hp->ps2_status()β Power supply 2 status
π Globals imported from SNMP::Info::Layer2 π
See documentation in "GLOBALS" in SNMP::Info::Layer2 for details.
π 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. (a hash ref, bestie, we love a data structure π )
π₯ 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->i_vlan()β Returns a mapping between"ifIndex"and the PVID (default VLAN) or untagged port when usingHP-VLAN.$hp->i_vlan_membership()β Returns reference to hash of arrays: key ="ifIndex", value = array of VLAN IDs. These are the VLANs which are members of the egress list for the port. It is the union of tagged, untagged, and auto ports.
Example:
my $interfaces = $hp->interfaces();
my $vlans = $hp->i_vlan_membership();
foreach my $iid (sort keys %$interfaces) {
my $port = $interfaces->{$iid};
my $vlan = join(',', sort(@{$vlans->{$iid}}));
print "Port: $port VLAN: $vlan\n";
}
$hp->i_vlan_membership_untagged()β Returns reference to hash of arrays: key ="ifIndex", value = array of VLAN IDs. These are the VLANs which are members of the untagged egress list for the port.$hp->v_index()β Returns VLAN IDs$hp->v_name()β Returns VLAN names$hp->bp_index()β Returns reference to hash of bridge port table entries map back to interface identifier (iid)
Returns ("ifIndex") for both key and value for 1600, 2424, 4000, and 8000 models since they seem to have problems with BRIDGE-MIB π
π 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.
π«Ά 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 information on set operations.
set_i_vlan()set_i_vlan_tagged()
slay. that's the whole set list. π β¨
and that's a wrap, bestie!! π¦ this page is perl v5.40.1, dated 2026-02-28, and it's SNMP::...HP4000(3pm) β go forth and poll your switches, you've got this ππ
π¦ 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