The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SNMP::Info::Layer2::HP - SNMP Interface to HP Procurve Switches

AUTHOR

Max Baker (max@warped.org)

SYNOPSIS

 # Let SNMP::Info determine the correct subclass for you. 
 my $hp = new SNMP::Info(
                          AutoSpecify => 1,
                          Debug       => 1,
                          # These arguments are passed directly on to SNMP::Session
                          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::Entity
SNMP::Info::MAU

Required MIBs

RFC1271-MIB

Included in V2 mibs from Cisco

HP-ICF-OID
HP-VLAN

(this MIB new with SNMP::Info 0.8)

STATISTICS-MIB
NETSWITCH-MIB

The last three 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

ChangeLog

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 = ( 
               'J4812A' => '2512',
               'J4819A' => '5308XL',
               'J4813A' => '2524',
               'J4805A' => '5304XL',
               'J4815A' => '3324XL',
               'J4865A' => '4108GL',
               'J4887A' => '4104GL',
               'J4874A' => '9315',
              );
$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

Globals imported from SNMP::Info::Layer2

See documentation in SNMP::Info::Layer2 for details.

Globals imported from SNMP::Info::Entity

See documentation in SNMP::Info::Entity for details.

Globals imported from SNMP::Info::MAU

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

Maps $hp->mau_index() with $hp->mau_link(). Methods inherited from SNMP::Info::MAU.

$hp->i_duplex_admin()

Maps $hp->mau_index() with $hp->mau_auto(), $hp->mau_autostat(), $hp->typeadmin(), and $mau_autosent(). Methods inherited from SNMP::Info::MAU.

$hp->i_name()

Crosses i_name() with $hp->e_name() using $hp->e_port() and i_alias()

$hp->i_type()

Crosses i_type() with $hp->e_descr() using $hp->e_port()

$hp->i_vlan()

Looks in Q-BRIDGE-MIB -- see SNMP::Info::Bridge

and for older devices looks in HP-VLAN.

Table Methods imported from SNMP::Info::Layer2

See documentation in SNMP::Info::Layer2 for details.

Table Methods imported from SNMP::Info::Entity

See documentation in SNMP::Info::Entity for details.

Table Methods imported from SNMP::Info::MAU

See documentation in SNMP::Info::MAU for details.