SNMP::Info::Layer2::HP(3) SNMP Interface to HP Procurve Switches

AUTHOR

Max Baker

SYNOPSIS


# 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

Provides abstraction to the configuration information obtainable from a HP ProCurve Switch via SNMP.

Note: Some HP Switches will connect via SNMP version 1, but a lot of config data will not be available. Make sure you try and connect with Version 2 first, and then fail back to version 1.

For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.

 my $hp = new SNMP::Info::Layer2::HP(...);

Inherited Classes

SNMP::Info::Layer2
SNMP::Info::MAU

Required MIBs

RFC1271-MIB
Included in V2 mibs from Cisco
HP-ICF-OID
(this MIB new with SNMP::Info 0.8)
STATISTICS-MIB
NETSWITCH-MIB
CONFIG-MIB
HP-ICF-BRIDGE
HP-ICF-POE-MIB

The last four 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-MIB e_*() methods to separate sub-class - SNMP::Info::Entity

GLOBALS

These are methods that return scalar value from SNMP
$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. 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()
Returns hp
$hp->os_bin()
"hpSwitchRomVersion.0"
$hp->os_ver()
Tries to use os_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_name that 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 inherited stp_ver())

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.

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()
Crosses i_name() with $hp->e_name() using $hp->e_port() and i_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 are ifIndex of the slave ports, Values are ifIndex of the corresponding master ports.

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 for c_id which handles CDP and LLDP.

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()