SNMP::Info::Layer2::HP - SNMP Interface to HP Procurve Switches
Max Baker (max@warped.org)
# 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";
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(...);
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
Version 0.4 - Removed ENTITY-MIB e_*() methods to separate sub-class - SNMP::Info::Entity
These are methods that return scalar value from SNMP
cpu()log()mem_free()mem_total()mem_used()model()
%MODEL_MAP = (
'J4812A' => '2512',
'J4819A' => '5308XL',
'J4813A' => '2524',
'J4805A' => '5304XL',
'J4815A' => '3324XL',
'J4865A' => '4108GL',
'J4887A' => '4104GL',
'J4874A' => '9315',
);
os()os_bin()os_ver()os_version() and if that fails will try and cull the version from
the description field.
os_version()serial()slots()vendor()
See documentation in SNMP::Info::Layer2 for details.
See documentation in SNMP::Info::Entity for details.
See documentation in SNMP::Info::MAU for details.
These are methods that return tables of information in the form of a reference to a hash.
interfaces()i_description()
i_duplex()mau_index() with $hp->mau_link(). Methods inherited from
SNMP::Info::MAU.
i_duplex_admin()mau_index() with $hp->mau_auto(), $hp->mau_autostat(),
$hp->typeadmin(), and $mau_autosent(). Methods inherited from
SNMP::Info::MAU.
i_name()i_name() with $hp->e_name() using $hp->e_port() and i_alias()
i_type()i_type() with $hp->e_descr() using $hp->e_port()
i_vlan()and for older devices looks in HP-VLAN.
See documentation in SNMP::Info::Layer2 for details.
See documentation in SNMP::Info::Entity for details.
See documentation in SNMP::Info::MAU for details.