1Info::Layer2::HP(3)   User Contributed Perl Documentation  Info::Layer2::HP(3)
2
3
4

NAME

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

AUTHOR

9       Max Baker
10

SYNOPSIS

12        # Let SNMP::Info determine the correct subclass for you.
13        my $hp = new SNMP::Info(
14                                 AutoSpecify => 1,
15                                 Debug       => 1,
16                                 DestHost    => 'myswitch',
17                                 Community   => 'public',
18                                 Version     => 2
19                               )
20           or die "Can't connect to DestHost.\n";
21
22        my $class      = $hp->class();
23        print "SNMP::Info determined this device to fall under subclass : $class\n";
24

DESCRIPTION

26       Provides abstraction to the configuration information obtainable from a
27       HP ProCurve Switch via SNMP.
28
29       Note:  Some HP Switches will connect via SNMP version 1, but a lot of
30       config data will not be available.  Make sure you try and connect with
31       Version 2 first, and then fail back to version 1.
32
33       For speed or debugging purposes you can call the subclass directly, but
34       not after determining a more specific class using the method above.
35
36        my $hp = new SNMP::Info::Layer2::HP(...);
37
38   Inherited Classes
39       SNMP::Info::Layer2
40       SNMP::Info::LLDP
41       SNMP::Info::MAU
42
43   Required MIBs
44       RFC1271-MIB
45           Included in V2 mibs from Cisco
46
47       HP-ICF-OID
48       HP-VLAN
49           (this MIB new with SNMP::Info 0.8)
50
51       STATISTICS-MIB
52       NETSWITCH-MIB
53       CONFIG-MIB
54
55       The last five MIBs listed are from HP and can be found at
56       <http://www.hp.com/rnd/software> or
57       <http://www.hp.com/rnd/software/MIBs.htm>
58

Change Log

60       Version 0.4 - Removed ENTITY-MIB e_*() methods to separate sub-class -
61       SNMP::Info::Entity
62

GLOBALS

64       These are methods that return scalar value from SNMP
65
66       $hp->cpu()
67           Returns CPU Utilization in percentage.
68
69       $hp->log()
70           Returns all the log entries from the switch's log that are not Link
71           up or down messages.
72
73       $hp->mem_free()
74           Returns bytes of free memory
75
76       $hp->mem_total()
77           Return bytes of total memory
78
79       $hp->mem_used()
80           Returns bytes of used memory
81
82       $hp->model()
83           Returns the model number of the HP Switch.  Will translate between
84           the HP Part number and the common model number with this map :
85
86            %MODEL_MAP = (
87                           'J4093A' => '2424M',
88                           'J4110A' => '8000M',
89                           'J4120A' => '1600M',
90                           'J4121A' => '4000M',
91                           'J4122A' => '2400M',
92                           'J4122B' => '2424M',
93                           'J4138A' => '9308M',
94                           'J4139A' => '9304M',
95                           'J4812A' => '2512',
96                           'J4813A' => '2524',
97                           'J4815A' => '3324XL',
98                           'J4819A' => '5308XL',
99                           'J4840A' => '6308M-SX',
100                           'J4841A' => '6208M-SX',
101                           'J4850A' => '5304XL',
102                           'J4851A' => '3124',
103                           'J4865A' => '4108GL',
104                           'J4874A' => '9315M',
105                           'J4887A' => '4104GL',
106                           'J4899A' => '2650',
107                           'J4899B' => '2650-CR',
108                           'J4900A' => '2626',
109                           'J4900B' => '2626-CR',
110                           'J4902A' => '6108',
111                           'J4903A' => '2824',
112                           'J4904A' => '2848',
113                           'J4905A' => '3400cl-24G',
114                           'J4906A' => '3400cl-48G',
115                           'J8130A' => 'WAP-420-NA',
116                           'J8131A' => 'WAP-420-WW',
117                           'J8133A' => 'AP520WL',
118                           'J8164A' => '2626-PWR',
119                           'J8165A' => '2650-PWR',
120                           'J8433A' => 'CX4-6400cl-6XG',
121                           'J8474A' => 'MF-6400cl-6XG',
122                           'J8680A' => '9608sl',
123                           'J8692A' => '3500yl-24G-PWR',
124                           'J8693A' => '3500yl-48G-PWR',
125                           'J8697A' => '5406zl',
126                           'J8698A' => '5412zl',
127                           'J8718A' => '5404yl',
128                           'J8719A' => '5408yl',
129                           'J8770A' => '4204vl',
130                           'J8771A' => '4202vl-48G',
131                           'J8772A' => '4202vl-72',
132                           'J8773A' => '4208vl',
133                           'J8762A' => '2600-8-PWR',
134                           'J8992A' => '6200yl-24G',
135                           'J9019A' => '2510-24A',
136                           'J9020A' => '2510-48A',
137                           'J9021A' => '2810-24G',
138                           'J9022A' => '2810-48G',
139                           'J9028A' => '1800-24G',
140                           'J9029A' => '1800-8G',
141                           'J9050A' => '2900-48G',
142                           'J9049A' => '2900-24G',
143                           'J9032A' => '4202vl-68G',
144                           'J9091A' => '8212zl',
145                           );
146
147       $hp->os()
148           Returns hp
149
150       $hp->os_bin()
151           "hpSwitchRomVersion.0"
152
153       $hp->os_ver()
154           Tries to use os_version() and if that fails will try and cull the
155           version from the description field.
156
157       $hp->os_version()
158           "hpSwitchOsVersion.0"
159
160       $hp->serial()
161           Returns serial number if available through SNMP
162
163       $hp->slots()
164           Returns number of entries in $hp->e_name that have 'slot' in them.
165
166       $hp->vendor()
167           hp
168
169       $hp->fan()
170           Returns fan status
171
172       $hp->ps1_status()
173           Power supply 1 status
174
175       $hp->ps2_status()
176           Power supply 2 status
177
178   Globals imported from SNMP::Info::Layer2
179       See documentation in "GLOBALS" in SNMP::Info::Layer2 for details.
180
181   Globals imported from SNMP::Info::LLDP
182       See documentation in "GLOBALS" in SNMP::Info::LLDP for details.
183
184   Globals imported from SNMP::Info::MAU
185       See documentation in "GLOBALS" in SNMP::Info::MAU for details.
186

TABLE METHODS

188       These are methods that return tables of information in the form of a
189       reference to a hash.
190
191   Overrides
192       $hp->interfaces()
193           Uses $hp->i_description()
194
195       $hp->i_duplex()
196           Returns reference to map of IIDs to current link duplex.
197
198       $hp->i_duplex_admin()
199           Returns reference to hash of IIDs to admin duplex setting.
200
201       $hp->i_name()
202           Crosses i_name() with $hp->e_name() using $hp->e_port() and
203           i_alias()
204
205       $hp->i_vlan()
206           Returns a mapping between "ifIndex" and the PVID (default VLAN) or
207           untagged port when using HP-VLAN.
208
209           Looks in Q-BRIDGE-MIB first ("TABLE METHODS" in SNMP::Info::Bridge)
210           and for older devices looks in HP-VLAN.
211
212       $hp->i_vlan_membership()
213           Returns reference to hash of arrays: key = "ifIndex", value = array
214           of VLAN IDs.  These are the VLANs which are members of the egress
215           list for the port.  It  is the union of tagged, untagged, and auto
216           ports when using HP-VLAN.
217
218           Looks in Q-BRIDGE-MIB first ("TABLE METHODS" in SNMP::Info::Bridge)
219           and for older devices looks in HP-VLAN.
220
221             Example:
222             my $interfaces = $hp->interfaces();
223             my $vlans      = $hp->i_vlan_membership();
224
225             foreach my $iid (sort keys %$interfaces) {
226               my $port = $interfaces->{$iid};
227               my $vlan = join(',', sort(@{$vlans->{$iid}}));
228               print "Port: $port VLAN: $vlan\n";
229             }
230
231       $hp->v_index()
232           Returns VLAN IDs
233
234       $hp->v_name()
235           Returns VLAN names
236
237       $hp->bp_index()
238           Returns reference to hash of bridge port table entries map back to
239           interface identifier (iid)
240
241           Returns ("ifIndex") for both key and value for 1600, 2424, 4000,
242           and 8000 models since they seem to have problems with BRIDGE-MIB
243
244       $hp->peth_port_ifindex()
245           Returns reference to hash of power Ethernet port table entries map
246           back to interface index (c<ifIndex>)
247
248   Topology information
249       Based upon the firmware version HP devices may support Cisco Discovery
250       Protocol (CDP), Link Layer Discovery Protocol (LLDP), or both.  These
251       methods will query both and return the combination of all information.
252       As a result, there may be identical topology information returned from
253       the two protocols causing duplicate entries.  It is the calling
254       program's responsibility to identify any duplicate entries and remove
255       duplicates if necessary.
256
257       $hp->hasCDP()
258           Returns true if the device is running either CDP or LLDP.
259
260       $hp->c_if()
261           Returns reference to hash.  Key: iid Value: local device port
262           (interfaces)
263
264       $hp->c_ip()
265           Returns reference to hash.  Key: iid Value: remote IPv4 address
266
267           If multiple entries exist with the same local port, c_if(), with
268           the same IPv4 address, c_ip(), it may be a duplicate entry.
269
270           If multiple entries exist with the same local port, c_if(), with
271           different IPv4 addresses, c_ip(), there is either a non-CDP/LLDP
272           device in between two or more devices or multiple devices which are
273           not directly connected.
274
275           Use the data from the Layer2 Topology Table below to dig deeper.
276
277       $hp->c_port()
278           Returns reference to hash. Key: iid Value: remote port (interfaces)
279
280       $hp->c_id()
281           Returns reference to hash. Key: iid Value: string value used to
282           identify the chassis component associated with the remote system.
283
284       $hp->c_platform()
285           Returns reference to hash.  Key: iid Value: Remote Device Type
286
287   Table Methods imported from SNMP::Info::Layer2
288       See documentation in "TABLE METHODS" in SNMP::Info::Layer2 for details.
289
290   Table Methods imported from SNMP::Info::LLDP
291       See documentation in "TABLE METHODS" in SNMP::Info::LLDP for details.
292
293   Table Methods imported from SNMP::Info::MAU
294       See documentation in "TABLE METHODS" in SNMP::Info::MAU for details.
295

MUNGES

297       munge_hp_c_id()
298           Munge for c_id which handles CDP and LLDP.
299
300
301
302perl v5.12.0                      2009-06-12               Info::Layer2::HP(3)
Impressum