SNMP::Info::Layer2::HP - SNMP Interface to HP Procurve Switches
Max Baker (max@warped.org)
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(...);
Included in V2 mibs from Cisco
The last three MIBs listed are from HP and can be found at http://www.hp.com/rnd/software
Version 0.4 - Removed ENTITY-MIB e_*() methods to separate sub-class - SNMP::Info::Entity
These are methods that return scalar value from SNMP
Returns CPU Utilization in percentage.
Returns all the log entries from the switch's log that are not Link up or down messages.
Returns bytes of free memory
Return bytes of total memory
Returns bytes of used memory
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', );
Returns hp
hpSwitchRomVersion.0
Tries to use os_version() and if that fails will try and cull the version from the description field.
hpSwitchOsVersion.0
Returns serial number if available through SNMP
Returns number of entries in $hp->e_name that have 'slot' in them.
hp
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.
Uses $hp->i_description()
Maps $hp->mau_index() with $hp->mau_link(). Methods inherited from SNMP::Info::MAU.
Maps $hp->mau_index() with $hp->mau_auto(), $hp->mau_autostat(), $hp->typeadmin(), and $mau_autosent(). Methods inherited from SNMP::Info::MAU.
Crosses i_name() with $hp->e_name() using $hp->e_port() and i_alias()
Crosses i_type() with $hp->e_descr() using $hp->e_port()
To install SNMP::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SNMP::Info
CPAN shell
perl -MCPAN -e shell install SNMP::Info
For more information on module installation, please visit the detailed CPAN module installation guide.