1SNMP::Info::CiscoStack(U3s)er Contributed Perl DocumentatSiNoMnP::Info::CiscoStack(3)
2
3
4
6 SNMP::Info::CiscoStack - SNMP Interface to data from CISCO-STACK-MIB
7
9 Max Baker
10
12 # Let SNMP::Info determine the correct subclass for you.
13 my $ciscostack = 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 = $ciscostack->class();
23 print "SNMP::Info determined this device to fall under subclass : $class\n";
24
26 SNMP::Info::CiscoStack is a subclass of SNMP::Info that provides an
27 interface to the "CISCO-STACK-MIB". This MIB is used across the
28 Catalyst family under CatOS and IOS.
29
30 Use or create in a subclass of SNMP::Info. Do not use directly.
31
32 Inherited Classes
33 none.
34
35 Required MIBs
36 CISCO-STACK-MIB
37
39 $stack->broadcast()
40 ("sysBroadcast")
41
42 $stack->fan()
43 ("chassisFanStatus")
44
45 $stack->model()
46 ("chassisModel")
47
48 $stack->netmask()
49 ("sysNetMask")
50
51 $stack->ps1_type()
52 ("chassisPs1Type")
53
54 $stack->ps2_type()
55 ("chassisPs2Type")
56
57 $stack->ps1_status()
58 ("chassisPs1Status")
59
60 $stack->ps2_status()
61 ("chassisPs2Status")
62
63 $stack->serial()
64 ("chassisSerialNumberString") or ("chassisSerialNumber")
65
66 $stack->slots()
67 ("chassisNumSlots")
68
70 Interface Tables
71 $stack->i_physical()
72 Returns a map to IID for ports that are physical ports, not vlans,
73 etc.
74
75 $stack->i_type()
76 Crosses p_port() with p_type() and returns the results.
77
78 Overrides with "ifType" if p_type() isn't available.
79
80 $stack->i_duplex()
81 Returns reference to hash of iid to current link duplex setting.
82
83 First checks for fixed gigabit ports which are always full duplex.
84 Next, if the port is not operational and reported port duplex
85 ("portDuplex") is auto then the operational duplex can not be
86 determined. Otherwise it uses the reported port duplex
87 ("portDuplex").
88
89 $stack->i_duplex_admin()
90 Returns reference to hash of iid to administrative duplex setting.
91
92 First checks for fixed gigabit ports which are always full duplex.
93 Next checks the port administrative speed ("portAdminSpeed") which
94 if set to autonegotiate then the duplex will also autonegotiate,
95 otherwise it uses the reported port duplex ("portDuplex").
96
97 $stack->i_speed_admin()
98 Returns reference to hash of iid to administrative speed setting.
99
100 "portAdminSpeed"
101
102 $stack->set_i_speed_admin(speed, ifIndex)
103 Sets port speed, must be supplied with speed and port C<ifIndex>
104
105 Speed choices are 'auto', '10', '100', '1000'
106
107 Crosses $stack->p_port() with $stack->p_duplex() to
108 utilize port C<ifIndex>.
109
110 Example:
111 my %if_map = reverse %{$stack->interfaces()};
112 $stack->set_i_speed_admin('auto', $if_map{'FastEthernet0/1'})
113 or die "Couldn't change port speed. ",$stack->error(1);
114
115 $stack->set_i_duplex_admin(duplex, ifIndex)
116 Sets port duplex, must be supplied with duplex and port C<ifIndex>
117
118 Speed choices are 'auto', 'half', 'full'
119
120 Crosses $stack->p_port() with $stack->p_duplex() to
121 utilize port C<ifIndex>.
122
123 Example:
124 my %if_map = reverse %{$stack->interfaces()};
125 $stack->set_i_duplex_admin('auto', $if_map{'FastEthernet0/1'})
126 or die "Couldn't change port duplex. ",$stack->error(1);
127
128 Module table
129 This table holds configuration information for each of the blades
130 installed in the Catalyst device.
131
132 $stack->m_type()
133 ("moduleType")
134
135 $stack->m_model()
136 ("moduleModel")
137
138 $stack->m_serial()
139 ("moduleSerialNumber")
140
141 $stack->m_status()
142 ("moduleStatus")
143
144 $stack->m_name()
145 ("moduleName")
146
147 $stack->m_ports()
148 ("moduleNumPorts")
149
150 $stack->m_ports_status()
151 Returns a list of space separated status strings for the ports.
152
153 To see the status of port 4 :
154
155 @ports_status = split(' ', $stack->m_ports_status() );
156 $port4 = $ports_status[3];
157
158 ("modulePortStatus")
159
160 $stack->m_ports_hwver()
161 ("moduleHwVersion")
162
163 $stack->m_ports_fwver()
164 ("moduleFwVersion")
165
166 $stack->m_ports_swver()
167 ("moduleSwVersion")
168
169 $stack->m_ports_ip()
170 ("moduleIPAddress")
171
172 $stack->m_ports_sub1()
173 ("moduleSubType")
174
175 $stack->m_ports_sub2()
176 ("moduleSubType2")
177
178 Modules - Router Blades
179 $stack->m_ip()
180 ("moduleIPAddress")
181
182 $stack->m_sub1()
183 ("moduleSubType")
184
185 $stack->m_sub2()
186 ("moduleSubType2")
187
188 Port Entry Table ("CISCO-STACK-MIB::portTable")
189 $stack->p_name()
190 ("portName")
191
192 $stack->p_type()
193 ("portType")
194
195 $stack->p_status()
196 ("portOperStatus")
197
198 $stack->p_status2()
199 ("portAdditionalStatus")
200
201 $stack->p_speed()
202 ("portAdminSpeed")
203
204 $stack->p_duplex()
205 ("portDuplex")
206
207 $stack->p_port()
208 ("portIfIndex")
209
210 $stack->p_rx_flow_control()
211 Can be either "on" "off" or "disagree"
212
213 "Indicates the receive flow control operational status of the port.
214 If the port could not agree with the far end on a link protocol,
215 its operational status will be disagree(3)."
216
217 "portOperRxFlowControl"
218
219 $stack->p_tx_flow_control()
220 Can be either "on" "off" or "disagree"
221
222 "Indicates the transmit flow control operational status of the
223 port. If the port could not agree with the far end on a link
224 protocol, its operational status will be disagree(3)."
225
226 "portOperTxFlowControl"
227
228 $stack->p_rx_flow_control_admin()
229 Can be either "on" "off" or "desired"
230
231 "Indicates the receive flow control administrative status set on
232 the port. If the status is set to on(1), the port will require the
233 far end to send flow control. If the status is set to off(2), the
234 port will not allow far end to send flow control. If the status is
235 set to desired(3), the port will allow the far end to send the flow
236 control."
237
238 "portAdminRxFlowControl"
239
240 $stack->p_tx_flow_control_admin()
241 Can be either "on" "off" or "desired"
242
243 "Indicates the transmit flow control administrative status set on
244 the port. If the status is set to on(1), the port will send flow
245 control to the far end. If the status is set to off(2), the port
246 will not send flow control to the far end. If the status is set to
247 desired(3), the port will send flow control to the far end if the
248 far end supports it."
249
250 "portAdminTxFlowControl"
251
252 Port Capability Table ("CISCO-STACK-MIB::portCpbTable")
253 $stack->p_speed_admin()
254 ("portCpbSpeed")
255
256 $stack->p_duplex_admin()
257 ("portCpbDuplex")
258
260 $stack->munge_port_status()
261 Munges binary byte describing each port into ascii, and returns an
262 ascii list separated by spaces.
263
264
265
266perl v5.34.0 2021-09-13 SNMP::Info::CiscoStack(3)