add SNMP support for Cisco 2924M-XL (#582)
[racktables] / wwwroot / inc / snmp.php
CommitLineData
2ffd5a2a
DO
1<?php
2
cddbb9fd
DO
3# This file is a part of RackTables, a datacenter and server room management
4# framework. See accompanying file "COPYING" for the full copyright and
5# licensing information.
6
536e7323 7global $iftable_processors;
74aee2dc 8$iftable_processors = array();
6be06cbb 9
b0021c43
AD
10$iftable_processors['generic-fa-any-100TX'] = array
11(
12 'pattern' => '@^fa(\d+)$@',
13 'replacement' => 'fa\\1',
14 'dict_key' => 19,
869d4ff4 15 'label' => '\\1',
b0021c43
AD
16 'try_next_proc' => FALSE,
17);
18
8595dfd0
AD
19$iftable_processors['generic-g45-to-g48-combo-1000SFP'] = array
20(
21 'pattern' => '@^g(45|46|47|48)$@',
22 'replacement' => 'g\\1',
23 'dict_key' => '4-1077',
24 'label' => 'g\\1',
25 'try_next_proc' => TRUE,
26);
27
28$iftable_processors['generic-g-any-1000T'] = array
29(
30 'pattern' => '@^g(\d+)$@',
31 'replacement' => 'g\\1',
32 'dict_key' => 24,
33 'label' => 'g\\1',
34 'try_next_proc' => FALSE,
35);
36
b0021c43
AD
37$iftable_processors['generic-gi-1-to-2-1000T'] = array
38(
39 'pattern' => '@^gi(\d+)$@',
40 'replacement' => 'gi\\1',
41 'dict_key' => 24,
869d4ff4 42 'label' => 'G\\1',
b0021c43
AD
43 'try_next_proc' => FALSE,
44);
45
46$iftable_processors['generic-gi-3-to-4-combo-1000SFP'] = array
47(
48 'pattern' => '@^gi(3|4)$@',
49 'replacement' => 'gi\\1',
50 'dict_key' => '4-1077',
869d4ff4 51 'label' => 'G\\1',
b0021c43
AD
52 'try_next_proc' => TRUE,
53);
54
55$iftable_processors['generic-gi-3-to-4-combo-1000T'] = array
56(
57 'pattern' => '@^gi(3|4)$@',
58 'replacement' => 'gi\\1',
59 'dict_key' => '1-24',
869d4ff4 60 'label' => 'G\\1',
b0021c43
AD
61 'try_next_proc' => FALSE,
62);
63
47a523af
AD
64$iftable_processors['catalyst-any-100TX'] = array
65(
66 'pattern' => '@^FastEthernet(\d+)$@',
67 'replacement' => 'fa\\1',
68 'dict_key' => 19,
69 'label' => 'fa\\1',
70 'try_next_proc' => FALSE,
71);
72
73$iftable_processors['catalyst-any-1000T'] = array
74(
75 'pattern' => '@^GigabitEthernet(\d+)$@',
76 'replacement' => 'gi\\1',
77 'dict_key' => 24,
78 'label' => 'gi\\1',
79 'try_next_proc' => FALSE,
80);
81
bc8b21f0
AD
82$iftable_processors['catalyst-9-to-12-1000SFP'] = array
83(
84 'pattern' => '@^GigabitEthernet(9|10|11|12)$@',
85 'replacement' => 'gi\\1',
86 'dict_key' => '4-1077',
87 'label' => 'gi\\1',
88 'try_next_proc' => TRUE,
89);
90
91$iftable_processors['catalyst-9-to-12-1000T'] = array
92(
93 'pattern' => '@^GigabitEthernet(9|10|11|12)$@',
94 'replacement' => 'gi\\1',
95 'dict_key' => 24,
96 'label' => 'gi\\1',
97 'try_next_proc' => FALSE,
98);
99
cbc30061 100$iftable_processors['catalyst-chassis-mgmt'] = array
6be06cbb 101(
cbc30061
DO
102 'pattern' => '@^FastEthernet([[:digit:]])$@',
103 'replacement' => 'fa\\1',
104 'dict_key' => '1-19',
6be06cbb
DO
105 'label' => 'mgmt',
106 'try_next_proc' => FALSE,
107);
108
38bd461c
AA
109$iftable_processors['catalyst-chassis-25-to-26-1000SFP'] = array
110(
111 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(25|26)$@',
112 'replacement' => 'gi\\1\\2',
113 'dict_key' => '4-1077',
114 'label' => '\\2X',
115 'try_next_proc' => FALSE,
116);
117
6be06cbb 118$iftable_processors['catalyst-chassis-any-100TX'] = array
74aee2dc 119(
6be06cbb
DO
120 'pattern' => '@^FastEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
121 'replacement' => 'fa\\1\\2',
74aee2dc 122 'dict_key' => 19,
6be06cbb 123 'label' => '\\2X',
56a797ef
DO
124 'try_next_proc' => FALSE,
125);
126
6be06cbb 127$iftable_processors['catalyst-chassis-25-to-26-100FX/MT-RJ'] = array
56a797ef 128(
6be06cbb
DO
129 'pattern' => '@^FastEthernet([[:digit:]]+/)?(25|26)$@',
130 'replacement' => 'fa\\1\\2',
8920f7f5 131 'dict_key' => 1195,
6be06cbb
DO
132 'label' => '\\2',
133 'try_next_proc' => FALSE,
134);
135
136$iftable_processors['catalyst-chassis-any-1000T'] = array
137(
f0255d01 138 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
6be06cbb
DO
139 'replacement' => 'gi\\1\\2',
140 'dict_key' => 24,
141 'label' => '\\2X',
56a797ef 142 'try_next_proc' => FALSE,
74aee2dc
DO
143);
144
6be06cbb 145$iftable_processors['catalyst-chassis-uplinks-1000T'] = array
74aee2dc 146(
6be06cbb
DO
147 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
148 'replacement' => 'gi\\1\\2',
74aee2dc 149 'dict_key' => 24,
6be06cbb 150 'label' => '\\2',
56a797ef
DO
151 'try_next_proc' => FALSE,
152);
153
8a4bee49
DO
154$iftable_processors['catalyst-chassis-uplinks-1000SX'] = array
155(
156 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
157 'replacement' => 'gi\\1\\2',
158 'dict_key' => '1-1202', // Gig-SX hardwired
159 'label' => '\\2',
160 'try_next_proc' => FALSE,
161);
162
6be06cbb 163$iftable_processors['catalyst-chassis-any-1000SFP'] = array
74aee2dc 164(
6be06cbb
DO
165 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
166 'replacement' => 'gi\\1\\2',
8536e20a 167 'dict_key' => '4-1077',
6be06cbb 168 'label' => '\\2',
56a797ef
DO
169 'try_next_proc' => FALSE,
170);
171
6be06cbb 172$iftable_processors['catalyst-chassis-any-1000GBIC'] = array
56a797ef 173(
6be06cbb
DO
174 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
175 'replacement' => 'gi\\1\\2',
8536e20a 176 'dict_key' => '3-1078',
6be06cbb 177 'label' => '\\2',
56a797ef
DO
178 'try_next_proc' => FALSE,
179);
180
7e87a291
DO
181$iftable_processors['catalyst-chassis-1-to-2-combo-1000SFP'] = array
182(
183 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2)$@',
184 'replacement' => 'gi\\1\\2',
185 'dict_key' => '4-1077',
186 'label' => '\\2',
187 'try_next_proc' => TRUE,
188);
189
712010be
AA
190$iftable_processors['catalyst-chassis-1-to-2-1000SFP'] = array
191(
192 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2)$@',
193 'replacement' => 'gi\\1\\2',
194 'dict_key' => '4-1077',
195 'label' => '\\2',
196 'try_next_proc' => FALSE,
197);
198
a048e8fc
DO
199$iftable_processors['catalyst-chassis-8-combo-1000SFP'] = array
200(
201 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(8)$@',
202 'replacement' => 'gi\\1\\2',
203 'dict_key' => '4-1077',
204 'label' => '\\2',
205 'try_next_proc' => TRUE,
206);
207
6be06cbb 208$iftable_processors['catalyst-chassis-21-to-24-combo-1000SFP'] = array
56a797ef 209(
6be06cbb
DO
210 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(21|22|23|24)$@',
211 'replacement' => 'gi\\1\\2',
8536e20a 212 'dict_key' => '4-1077',
6be06cbb 213 'label' => '\\2',
56a797ef
DO
214 'try_next_proc' => TRUE,
215);
216
6be06cbb 217$iftable_processors['catalyst-chassis-45-to-48-combo-1000SFP'] = array
56a797ef 218(
6be06cbb
DO
219 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(45|46|47|48)$@',
220 'replacement' => 'gi\\1\\2',
8536e20a 221 'dict_key' => '4-1077',
6be06cbb 222 'label' => '\\2',
56a797ef
DO
223 'try_next_proc' => TRUE,
224);
225
6be06cbb 226$iftable_processors['catalyst-chassis-uplinks-10000X2'] = array
56a797ef 227(
6be06cbb
DO
228 'pattern' => '@^TenGigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
229 'replacement' => 'te\\1\\2',
8536e20a 230 'dict_key' => '6-1080',
6be06cbb 231 'label' => '\\2',
56a797ef 232 'try_next_proc' => FALSE,
74aee2dc
DO
233);
234
b475f795
DO
235$iftable_processors['catalyst-chassis-uplinks-10000SFP+'] = array
236(
237 'pattern' => '@^TenGigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
238 'replacement' => 'te\\1\\2',
239 'dict_key' => '9-1084',
240 'label' => '\\2',
241 'try_next_proc' => FALSE,
242);
243
6be06cbb 244$iftable_processors['catalyst-chassis-25-to-28-1000SFP'] = array
74aee2dc 245(
6be06cbb
DO
246 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(25|26|27|28)$@',
247 'replacement' => 'gi\\1\\2',
8536e20a 248 'dict_key' => '4-1077',
6be06cbb 249 'label' => '\\2',
56a797ef 250 'try_next_proc' => FALSE,
74aee2dc
DO
251);
252
6be06cbb 253$iftable_processors['catalyst-chassis-49-to-52-1000SFP'] = array
74aee2dc 254(
6be06cbb
DO
255 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(49|50|51|52)$@',
256 'replacement' => 'gi\\1\\2',
8536e20a 257 'dict_key' => '4-1077',
6be06cbb 258 'label' => '\\2',
56a797ef 259 'try_next_proc' => FALSE,
74aee2dc
DO
260);
261
71d6b313 262$iftable_processors['catalyst-blade-13-to-16-1000SFP'] = array
74aee2dc 263(
6be06cbb
DO
264 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(13|14|15|16)$@',
265 'replacement' => 'gi\\1\\2',
8536e20a 266 'dict_key' => '4-1077',
6be06cbb 267 'label' => '\\2',
56a797ef 268 'try_next_proc' => FALSE,
74aee2dc
DO
269);
270
71d6b313 271$iftable_processors['catalyst-blade-21-to-24-1000SFP'] = array
74aee2dc 272(
6be06cbb
DO
273 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(21|22|23|24)$@',
274 'replacement' => 'gi\\1\\2',
8536e20a 275 'dict_key' => '4-1077',
6be06cbb 276 'label' => '\\2',
56a797ef 277 'try_next_proc' => FALSE,
74aee2dc
DO
278);
279
71d6b313
DO
280$iftable_processors['catalyst-blade-11-to-12-1000T'] = array
281(
282 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
283 'replacement' => 'gi\\1\\2',
284 'dict_key' => '1-24',
285 'label' => '\\2',
286 'try_next_proc' => FALSE,
287);
288
289$iftable_processors['catalyst-blade-17-to-20-1000T'] = array
290(
291 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(17|18|19|20)$@',
292 'replacement' => 'gi\\1\\2',
293 'dict_key' => '1-24',
294 'label' => '\\2',
295 'try_next_proc' => FALSE,
296);
297
298$iftable_processors['catalyst-blade-any-bp/1000T'] = array
299(
300 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
301 'replacement' => 'gi\\1\\2',
302 'dict_key' => '1-1087',
303 'label' => '',
304 'try_next_proc' => FALSE,
305);
306
86d614c3
DO
307$iftable_processors['catalyst-11-to-12-1000T'] = array
308(
309 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
310 'replacement' => 'gi\\1\\2',
311 'dict_key' => '1-24',
312 'label' => '\\2',
313 'try_next_proc' => FALSE,
314);
315
7e87a291
DO
316$iftable_processors['catalyst-1-to-10-1000T'] = array
317(
318 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2|3|4|5|6|7|8|9|10)$@',
319 'replacement' => 'gi\\1\\2',
320 'dict_key' => '1-24',
321 'label' => '\\2',
322 'try_next_proc' => FALSE,
323);
324
325$iftable_processors['catalyst-11-to-12-GBIC'] = array
326(
327 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
328 'replacement' => 'gi\\1\\2',
329 'dict_key' => '3-1078',
330 'label' => '\\2',
331 'try_next_proc' => FALSE,
332);
333
38c9bb20
DO
334$iftable_processors['catalyst-stack-any-1000T'] = array
335(
336 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(\d+)$@',
337 'replacement' => 'gi\\1/\\2/\\3',
338 'dict_key' => '1-24',
339 'label' => 'unit \\1 port \\3',
340 'try_next_proc' => FALSE,
341);
342
343$iftable_processors['catalyst-stack-25-to-28-SFP'] = array
344(
345 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(25|26|27|28)$@',
346 'replacement' => 'gi\\1/\\2/\\3',
347 'dict_key' => '4-1077',
348 'label' => 'unit \\1 port \\3',
349 'try_next_proc' => FALSE,
350);
351
74aee2dc
DO
352$iftable_processors['nexus-any-10000SFP+'] = array
353(
56a797ef 354 'pattern' => '@^Ethernet([[:digit:]]/[[:digit:]]+)$@',
74aee2dc 355 'replacement' => 'e\\1',
8536e20a 356 'dict_key' => '9-1084',
56a797ef
DO
357 'label' => '\\1',
358 'try_next_proc' => FALSE,
74aee2dc
DO
359);
360
8acd246d
DO
361$iftable_processors['ftos-any-1000T'] = array
362(
363 'pattern' => '@^GigabitEthernet 0/(\d+)$@',
364 'replacement' => 'gi0/\\1',
365 'dict_key' => '1-24',
366 'label' => '\\1',
367 'try_next_proc' => FALSE,
368);
369
370$iftable_processors['ftos-44-to-47-1000SFP'] = array
371(
372 'pattern' => '@^GigabitEthernet 0/(44|45|46|47)$@',
373 'replacement' => 'gi0/\\1',
374 'dict_key' => '4-1077',
375 'label' => '\\1',
376 'try_next_proc' => FALSE,
377);
378
379$iftable_processors['ftos-any-10000SFP+'] = array
380(
381 'pattern' => '@^TenGigabitEthernet 0/(\d+)$@',
382 'replacement' => 'te0/\\1',
383 'dict_key' => '9-1084',
384 'label' => '\\1',
385 'try_next_proc' => FALSE,
386);
387
1e5a92d8
DO
388$iftable_processors['ftos-any-QSFP+'] = array
389(
390 'pattern' => '@^fortyGigE 0/(\d+)$@',
391 'replacement' => 'fo0/\\1',
392 'dict_key' => '10-1588',
393 'label' => '\\1',
394 'try_next_proc' => FALSE,
395);
396
397$iftable_processors['ftos-mgmt'] = array
398(
399 'pattern' => '@^ManagementEthernet 0/0$@',
400 'replacement' => 'ma0/0',
401 'dict_key' => '1-19',
402 'label' => 'ethernet',
403 'try_next_proc' => FALSE,
404);
405
e7662d90
DO
406$iftable_processors['nexus-mgmt'] = array
407(
408 'pattern' => '@^(mgmt[[:digit:]]+)$@',
409 'replacement' => '\\1',
410 'dict_key' => '1-24',
411 'label' => '\\1',
412 'try_next_proc' => FALSE,
413);
414
56a797ef 415$iftable_processors['procurve-chassis-100TX'] = array
74aee2dc 416(
56a797ef 417 'pattern' => '@^([[:digit:]]+)$@',
74aee2dc
DO
418 'replacement' => '\\1',
419 'dict_key' => 19,
56a797ef
DO
420 'label' => '\\1',
421 'try_next_proc' => FALSE,
422);
423
424$iftable_processors['procurve-chassis-1000T'] = array
425(
426 'pattern' => '@^([[:digit:]]+)$@',
427 'replacement' => '\\1',
428 'dict_key' => 24,
429 'label' => '\\1',
430 'try_next_proc' => FALSE,
431);
432
4b43f713
DO
433$iftable_processors['procurve-45-to-48-combo-1000SFP'] = array
434(
435 'pattern' => '@^(45|46|47|48)$@',
436 'replacement' => '\\1',
437 'dict_key' => '4-1077',
438 'label' => '\\1',
439 'try_next_proc' => TRUE,
440);
441
13b28c20
DO
442$iftable_processors['procurve-21-to-24-combo-1000SFP'] = array
443(
444 'pattern' => '@^(21|22|23|24)$@',
445 'replacement' => '\\1',
446 'dict_key' => '4-1077',
447 'label' => '\\1',
448 'try_next_proc' => TRUE,
449);
450
93c0a7b9
DO
451$iftable_processors['procurve-23-to-24-combo-1000SFP'] = array
452(
453 'pattern' => '@^(23|24)$@',
454 'replacement' => '\\1',
455 'dict_key' => '4-1077',
456 'label' => '\\1',
457 'try_next_proc' => TRUE,
458);
459
56a797ef
DO
460$iftable_processors['procurve-modular-100TX'] = array
461(
462 'pattern' => '@^([A-Z][[:digit:]]+)$@',
463 'replacement' => '\\1',
464 'dict_key' => 19,
465 'label' => '\\1',
466 'try_next_proc' => FALSE,
74aee2dc
DO
467);
468
4bbb87a3
AD
469$iftable_processors['procurve-modular-1000T'] = array
470(
471 'pattern' => '@^([A-Z][[:digit:]]+)$@',
472 'replacement' => '\\1',
473 'dict_key' => 24,
474 'label' => '\\1',
475 'try_next_proc' => FALSE,
476);
477
74aee2dc
DO
478$iftable_processors['procurve-25-to-26-1000T'] = array
479(
56a797ef 480 'pattern' => '@^(25|26)$@',
74aee2dc
DO
481 'replacement' => '\\1',
482 'dict_key' => 24,
56a797ef
DO
483 'label' => '\\1',
484 'try_next_proc' => FALSE,
74aee2dc
DO
485);
486
83aedacd
AD
487$iftable_processors['procurve-27-to-28-1000SFP'] = array
488(
489 'pattern' => '@^(27|28)$@',
490 'replacement' => '\\1',
491 'dict_key' => '4-1077',
492 'label' => '\\1',
493 'try_next_proc' => FALSE,
494);
495
74aee2dc
DO
496$iftable_processors['procurve-49-to-50-1000T'] = array
497(
56a797ef 498 'pattern' => '@^(49|50)$@',
74aee2dc
DO
499 'replacement' => '\\1',
500 'dict_key' => 24,
56a797ef
DO
501 'label' => '\\1',
502 'try_next_proc' => FALSE,
74aee2dc
DO
503);
504
13b28c20
DO
505$iftable_processors['procurve-51-to-52-1000SFP'] = array
506(
507 'pattern' => '@^(51|52)$@',
508 'replacement' => '\\1',
509 'dict_key' => '4-1077',
510 'label' => '\\1',
511 'try_next_proc' => FALSE,
512);
513
5d930daf
AD
514$iftable_processors['procurve-49-to-52-10000SFP+'] = array
515(
516 'pattern' => '@^(49|50|51|52)$@',
517 'replacement' => '\\1',
518 'dict_key' => '9-1084',
519 'label' => '\\1',
520 'try_next_proc' => FALSE,
521);
522
4a2358b3
DO
523$iftable_processors['gbe2csfp-1-to-16'] = array
524(
525 'pattern' => '@^Downlink(\d+)$@',
526 'replacement' => '\\0',
527 'dict_key' => '1-1603',
528 'label' => '\\1',
529 'try_next_proc' => FALSE,
530);
531
532$iftable_processors['gbe2csfp-17'] = array
533(
534 'pattern' => '@^Xconnect1$@',
535 'replacement' => '\\0',
536 'dict_key' => '1-1603',
537 'label' => '17',
538 'try_next_proc' => FALSE,
539);
540
541$iftable_processors['gbe2csfp-18'] = array
542(
543 'pattern' => '@^Xconnect2$@',
544 'replacement' => '\\0',
545 'dict_key' => '1-1603',
546 'label' => '18',
547 'try_next_proc' => FALSE,
548);
549
550$iftable_processors['gbe2csfp-19'] = array
551(
552 'pattern' => '@^Mgmt$@',
553 'replacement' => '\\0',
554 'dict_key' => '1-1604',
555 'label' => '19',
556 'try_next_proc' => FALSE,
557);
558
559$iftable_processors['gbe2csfp-20'] = array
560(
561 'pattern' => '@^Uplink1$@',
562 'replacement' => '\\0',
563 'dict_key' => '1-24',
564 'label' => '20',
565 'try_next_proc' => FALSE,
566);
567
568$iftable_processors['gbe2csfp-21sfp'] = array
569(
570 'pattern' => '@^Uplink2$@',
571 'replacement' => '\\0',
572 'dict_key' => '4-1077',
573 'label' => '21',
574 'try_next_proc' => TRUE,
575);
576
577$iftable_processors['gbe2csfp-21'] = array
578(
579 'pattern' => '@^Uplink2$@',
580 'replacement' => '\\0',
581 'dict_key' => '1-24',
582 'label' => '21',
583 'try_next_proc' => FALSE,
584);
585
586$iftable_processors['gbe2csfp-22sfp'] = array
587(
588 'pattern' => '@^Uplink3$@',
589 'replacement' => '\\0',
590 'dict_key' => '4-1077',
591 'label' => '22',
592 'try_next_proc' => TRUE,
593);
594
595$iftable_processors['gbe2csfp-22'] = array
596(
597 'pattern' => '@^Uplink3$@',
598 'replacement' => '\\0',
599 'dict_key' => '1-24',
600 'label' => '22',
601 'try_next_proc' => FALSE,
602);
603
604$iftable_processors['gbe2csfp-23sfp'] = array
605(
606 'pattern' => '@^Uplink4$@',
607 'replacement' => '\\0',
608 'dict_key' => '4-1077',
609 'label' => '23',
610 'try_next_proc' => TRUE,
611);
612
613$iftable_processors['gbe2csfp-23'] = array
614(
615 'pattern' => '@^Uplink4$@',
616 'replacement' => '\\0',
617 'dict_key' => '1-24',
618 'label' => '23',
619 'try_next_proc' => FALSE,
620);
621
622$iftable_processors['gbe2csfp-24sfp'] = array
623(
624 'pattern' => '@^Uplink5$@',
625 'replacement' => '\\0',
626 'dict_key' => '4-1077',
627 'label' => '24',
628 'try_next_proc' => TRUE,
629);
630
631$iftable_processors['gbe2csfp-24'] = array
632(
633 'pattern' => '@^Uplink5$@',
634 'replacement' => '\\0',
635 'dict_key' => '1-24',
636 'label' => '24',
637 'try_next_proc' => FALSE,
638);
639
6be06cbb 640$iftable_processors['netgear-chassis-any-1000T'] = array
74aee2dc 641(
32fae2ee
DO
642 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
643 'replacement' => '\\1/\\2/\\3',
56a797ef 644 'dict_key' => 24,
32fae2ee 645 'label' => '\\3',
56a797ef
DO
646 'try_next_proc' => FALSE,
647);
648
e326551d
AD
649$iftable_processors['netgear-chassis-any-1000SFP'] = array
650(
651 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
652 'replacement' => '\\1/\\2/\\3',
653 'dict_key' => '4-1077',
654 'label' => '\\3',
655 'try_next_proc' => FALSE,
656);
657
6be06cbb
DO
658$iftable_processors['netgear-chassis-21-to-24-1000Tcombo'] = array
659(
32fae2ee
DO
660 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (21|22|23|24) Gigabit - Level$@',
661 'replacement' => '\\1/\\2/\\3',
6be06cbb 662 'dict_key' => 24,
32fae2ee 663 'label' => '\\3T',
6be06cbb
DO
664 'try_next_proc' => FALSE,
665);
666
667$iftable_processors['netgear-chassis-21-to-24-1000SFP'] = array
668(
32fae2ee
DO
669 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (21|22|23|24) Gigabit - Level$@',
670 'replacement' => '\\1/\\2/\\3',
8536e20a 671 'dict_key' => '4-1077',
32fae2ee 672 'label' => '\\3F',
6be06cbb
DO
673 'try_next_proc' => TRUE,
674);
675
3e8ad42f
DO
676$iftable_processors['netgear-chassis-any-1000SFPcombo'] = array
677(
32fae2ee
DO
678 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
679 'replacement' => '\\1/\\2/\\3',
3e8ad42f 680 'dict_key' => '4-1077',
32fae2ee 681 'label' => '\\3F',
3e8ad42f
DO
682 'try_next_proc' => TRUE,
683);
684
fc807353
DO
685$iftable_processors['netgear-chassis-any-100TX'] = array
686(
32fae2ee
DO
687 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) 10/100 Copper - Level$@',
688 'replacement' => '\\1/\\2/\\3',
fc807353 689 'dict_key' => 19,
32fae2ee 690 'label' => '\\3',
fc807353
DO
691 'try_next_proc' => FALSE,
692);
693
ac02ab69
AD
694$iftable_processors['netgear-49-to-50-combo-1000SFP'] = array
695(
696 'pattern' => '@^GbE_(49|50)$@',
697 'replacement' => '\\1',
698 'dict_key' => '4-1077',
699 'label' => '\\1F',
700 'try_next_proc' => TRUE,
701);
702
703$iftable_processors['netgear-49-to-50-combo-1000T'] = array
704(
705 'pattern' => '@^GbE_(49|50)$@',
706 'replacement' => '\\1',
707 'dict_key' => '1-24',
708 'label' => '\\1T',
709 'try_next_proc' => FALSE,
710);
711
712$iftable_processors['netgear-any-100TX'] = array
713(
714 'pattern' => '@^FE_(\d+)$@',
715 'replacement' => '\\1',
716 'dict_key' => 19,
717 'label' => '\\1',
718 'try_next_proc' => FALSE,
719);
720
56a797ef
DO
721$iftable_processors['nortel-any-1000T'] = array
722(
723 'pattern' => '@^Ethernet Port on unit 1, port ([[:digit:]]+)$@',
74aee2dc
DO
724 'replacement' => '\\1',
725 'dict_key' => 24,
56a797ef
DO
726 'label' => '\\1',
727 'try_next_proc' => FALSE,
74aee2dc
DO
728);
729
fb3e70de
DO
730$iftable_processors['smc-combo-45-to-48'] = array
731(
732 'pattern' => '@^Ethernet Port on unit 1, port (45|46|47|48)$@',
733 'replacement' => '\\1',
734 'dict_key' => '4-1077',
735 'label' => '\\1',
736 'try_next_proc' => TRUE,
737);
738
13b28c20
DO
739$iftable_processors['smc2-combo-21-to-24'] = array
740(
741 'pattern' => '@^Port #(21|22|23|24)$@',
742 'replacement' => '\\1',
743 'dict_key' => '4-1077',
744 'label' => '\\1',
745 'try_next_proc' => TRUE,
746);
747
748$iftable_processors['smc2-combo-23-to-24'] = array
749(
750 'pattern' => '@^Port #(23|24)$@',
751 'replacement' => '\\1',
752 'dict_key' => '4-1077',
753 'label' => '\\1',
754 'try_next_proc' => TRUE,
755);
756
757$iftable_processors['smc2-combo-25-to-28'] = array
758(
759 'pattern' => '@^Port #(25|26|27|28)$@',
760 'replacement' => '\\1',
761 'dict_key' => '4-1077',
762 'label' => '\\1',
763 'try_next_proc' => TRUE,
764);
765
766$iftable_processors['smc2-1000T-25-to-28'] = array
767(
768 'pattern' => '@^Port #(25|26|27|28)$@',
769 'replacement' => '\\1',
770 'dict_key' => '1-24',
771 'label' => '\\1',
772 'try_next_proc' => FALSE,
773);
774
775$iftable_processors['smc2-any-1000T'] = array
776(
777 'pattern' => '@^Port #(\d+)$@',
778 'replacement' => '\\1',
779 'dict_key' => '1-24',
780 'label' => '\\1',
781 'try_next_proc' => FALSE,
782);
783
784$iftable_processors['smc2-any-100TX'] = array
785(
786 'pattern' => '@^Port #(\d+)$@',
787 'replacement' => '\\1',
788 'dict_key' => '1-19',
789 'label' => '\\1',
790 'try_next_proc' => FALSE,
791);
792
91389980
DO
793$iftable_processors['juniper-DPCE-R-4XGE-XFP'] = array
794(
7d69a266
DO
795 'pattern' => '@^xe-([[:digit:]]+)/([[:digit:]]+/[[:digit:]]+)$@',
796 'replacement' => '\\0',
91389980 797 'dict_key' => '8-1082', // XFP/empty
7d69a266
DO
798 'label' => 'slot \\1 port \\2',
799 'try_next_proc' => FALSE,
800);
801
1f54e1ba
DO
802$iftable_processors['juniper-ex-pic0-1000T'] = array
803(
804 'pattern' => '@^ge-([[:digit:]]+)/0/([[:digit:]]+)$@',
805 'replacement' => '\\0',
806 'dict_key' => '1-24',
807 'label' => 'unit \\1 port \\2',
808 'try_next_proc' => FALSE,
809);
810
811$iftable_processors['juniper-ex-mgmt'] = array
812(
813 'pattern' => '/^me0$/',
814 'replacement' => 'me0',
815 'dict_key' => '1-24',
816 'label' => 'MGMT',
817 'try_next_proc' => FALSE,
818);
819
7d69a266
DO
820$iftable_processors['quidway-21-to-24-comboT'] = array
821(
822 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)(21|22|23|24)$@',
823 'replacement' => 'gi\\1\\2',
824 'dict_key' => '1-24',
825 'label' => '\\2',
826 'try_next_proc' => TRUE,
827);
828
24c3e444
DO
829$iftable_processors['quidway-21-to-24-comboSFP'] = array
830(
831 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)(21|22|23|24)$@',
832 'replacement' => 'gi\\1\\2',
833 'dict_key' => '4-1077',
834 'label' => '\\2',
835 'try_next_proc' => TRUE,
836);
837
b55f8de3
DO
838$iftable_processors['quidway-slot1-SFP'] = array
839(
840 'pattern' => '@^GigabitEthernet0/1/([[:digit:]]+)$@',
841 'replacement' => 'gi0/1/\\1',
842 'dict_key' => '4-1077',
843 'label' => 'SFP\\1',
844 'try_next_proc' => FALSE,
845);
846
7d69a266
DO
847$iftable_processors['quidway-any-1000SFP'] = array
848(
849 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
850 'replacement' => 'gi\\1\\2',
851 'dict_key' => '4-1077', // empty SFP-1000
852 'label' => '\\2',
853 'try_next_proc' => FALSE,
854);
855
24c3e444
DO
856$iftable_processors['quidway-any-1000T'] = array
857(
858 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
859 'replacement' => 'gi\\1\\2',
860 'dict_key' => '1-24',
861 'label' => '\\2',
862 'try_next_proc' => FALSE,
863);
864
7d69a266
DO
865$iftable_processors['quidway-XFP'] = array
866(
867 'pattern' => '@^XGigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
868 'replacement' => 'xg\\1\\2',
869 'dict_key' => '8-1082',
870 'label' => '\\2',
871 'try_next_proc' => FALSE,
872);
873
874$iftable_processors['quidway-mgmt'] = array
875(
876 'pattern' => '@^MEth([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
877 'replacement' => 'me\\1\\2',
878 'dict_key' => '1-19',
879 'label' => 'eth',
91389980
DO
880 'try_next_proc' => FALSE,
881);
882
661b3fdb
DO
883$iftable_processors['fgs-1-to-4-comboSFP'] = array
884(
885 # only 4 first copper ports of 1st unit of a stack
886 'pattern' => '@^GigabitEthernet1/1/(1|2|3|4)$@',
887 'replacement' => 'e1/1/\\1',
888 'dict_key' => '4-1077',
889 'label' => '\\1F',
890 'try_next_proc' => TRUE,
891);
892
893$iftable_processors['fgs-any-1000T'] = array
894(
6c32c3ff
AA
895 'pattern' => '@^GigabitEthernet(0|1)/1/([[:digit:]]+)$@',
896 'replacement' => 'e\\1/1/\\2',
661b3fdb 897 'dict_key' => '1-24',
6c32c3ff
AA
898 'label' => '\\2',
899 'try_next_proc' => FALSE,
900);
901
902$iftable_processors['fls624-combo'] = array
903(
904 'pattern' => '@^GigabitEthernet0/1/(21|22|23|24)$@',
905 'replacement' => 'e0/1/\\1',
906 'dict_key' => '4-1077',
661b3fdb 907 'label' => '\\1',
6c32c3ff
AA
908 'try_next_proc' => TRUE,
909);
910
911$iftable_processors['fls648-combo'] = array
912(
913 'pattern' => '@^GigabitEthernet0/1/(45|46|47|48)$@',
914 'replacement' => 'e0/1/\\1',
915 'dict_key' => '4-1077',
916 'label' => '\\1',
917 'try_next_proc' => TRUE,
918);
919
920# These can be CX4, but that is not handled here.
921$iftable_processors['fls-uplinks'] = array
922(
923 'pattern' => '@^10GigabitEthernet0/([234])/1$@',
924 'replacement' => 'e0/\\1/1',
925 'dict_key' => '8-1082',
926 'label' => 'Slot \\1',
661b3fdb
DO
927 'try_next_proc' => FALSE,
928);
929
930$iftable_processors['fgs-uplinks'] = array
931(
932 'pattern' => '@^10GigabitEthernet1/2/([[:digit:]]+)$@',
933 'replacement' => 'e1/2/\\1',
934 'dict_key' => '8-1082', // default is XFP, but may be overridden to CX4
935 'label' => 'Slot2 \\1',
936 'try_next_proc' => FALSE,
937);
938
ec523868
DO
939$iftable_processors['fcx-uplinks'] = array
940(
941 'pattern' => '@^10GigabitEthernet1/2/([[:digit:]]+)$@',
942 'replacement' => 'e1/2/\\1',
943 'dict_key' => '9-1084',
944 'label' => 'X\\1',
945 'try_next_proc' => FALSE,
946);
947
948$iftable_processors['fcx-management'] = array
949(
950 'pattern' => '@^Management$@',
951 'replacement' => 'management1',
952 'dict_key' => '1-24',
953 'label' => 'Management',
954 'try_next_proc' => FALSE,
955);
956
4eeadb79
DO
957$iftable_processors['summit-25-to-26-XFP-uplinks'] = array
958(
959 'pattern' => '@^.+ Port (25|26)$@',
960 'replacement' => '\\1',
961 'dict_key' => '8-1082',
962 'label' => '\\1',
963 'try_next_proc' => FALSE,
964);
965
dbcf1931
DO
966$iftable_processors['summit-27-to-30-XFP-uplinks'] = array
967(
968 'pattern' => '@^.+ Port (27|28|29|30)$@',
969 'replacement' => '\\1',
970 'dict_key' => '8-1082',
971 'label' => '\\1',
972 'try_next_proc' => FALSE,
973);
974
4eeadb79
DO
975$iftable_processors['summit-21-to-24-comboSFP'] = array
976(
977 'pattern' => '@^.+ Port (21|22|23|24)$@',
978 'replacement' => '\\1',
979 'dict_key' => '4-1077',
980 'label' => '\\1',
981 'try_next_proc' => TRUE,
982);
983
dbcf1931
DO
984$iftable_processors['summit-13-to-24-comboT'] = array
985(
986 'pattern' => '@^.+ Port (1[3456789]|2[01234])$@',
987 'replacement' => '\\1',
988 'dict_key' => '1-24',
989 'label' => '\\1',
990 'try_next_proc' => TRUE,
991);
992
4eeadb79
DO
993$iftable_processors['summit-any-1000T'] = array
994(
995 'pattern' => '@^.+ Port ([[:digit:]]+)$@',
996 'replacement' => '\\1',
997 'dict_key' => '1-24',
998 'label' => '\\1',
999 'try_next_proc' => FALSE,
1000);
1001
dbcf1931
DO
1002$iftable_processors['summit-any-SFP'] = array
1003(
1004 'pattern' => '@^.+ Port ([[:digit:]]+)$@',
1005 'replacement' => '\\1',
1006 'dict_key' => '4-1077',
1007 'label' => '\\1',
1008 'try_next_proc' => FALSE,
1009);
1010
4eeadb79
DO
1011$iftable_processors['summit-management'] = array
1012(
1013 'pattern' => '@^Management Port$@',
1014 'replacement' => 'mgmt',
1015 'dict_key' => '1-19',
21d38e6b 1016 'label' => 'management',
4eeadb79
DO
1017 'try_next_proc' => FALSE,
1018);
1019
13b28c20
DO
1020$iftable_processors['C3KX-NM-10000'] = array
1021(
1022 'pattern' => '@^TenGigabitEthernet1/(\d+)$@',
1023 'replacement' => 'te1/\\1',
1024 'dict_key' => '9-1084',
1025 'label' => 'NM TE\\1',
1026 'try_next_proc' => FALSE,
1027);
1028
1029$iftable_processors['C3KX-NM-1000'] = array
1030(
1031 'pattern' => '@^GigabitEthernet1/(\d+)$@',
1032 'replacement' => 'gi1/\\1',
1033 'dict_key' => '4-1077',
1034 'label' => 'NM G\\1',
1035 'try_next_proc' => FALSE,
1036);
1037
a28aee72
AD
1038$iftable_processors['fortinet-chassis-any-1000T'] = array
1039(
1040 'pattern' => '@^port([[:digit:]]+)$@',
1041 'replacement' => '\\1',
1042 'dict_key' => 24,
1043 'label' => '\\1',
1044 'try_next_proc' => FALSE,
1045);
1046
fe8f91c0 1047$iftable_processors['arista-any-SFP+'] = array
06a03a99 1048(
92df4b0e 1049 'pattern' => '@^Ethernet([[:digit:]]+)$@',
1b3176ac 1050 'replacement' => 'e\\1',
92df4b0e
AD
1051 'dict_key' => '9-1084',
1052 'label' => '\\1',
1053 'try_next_proc' => FALSE,
06a03a99
AD
1054);
1055
1056$iftable_processors['arista-management'] = array
1057(
92df4b0e 1058 'pattern' => '@^Management(1|2)$@',
ec2907cf 1059 'replacement' => 'Ma\\1',
92df4b0e 1060 'dict_key' => '1-24',
ec2907cf 1061 'label' => '\\0',
92df4b0e
AD
1062 'try_next_proc' => FALSE,
1063);
1064
1065$iftable_processors['dell-33xx-any-combo-1000SFP'] = array
1066(
1067 'pattern' => '@^1/g(\d+)$@',
1068 'replacement' => 'g\\1',
1069 'dict_key' => '4-1077',
1070 'label' => 'g\\1',
1071 'try_next_proc' => TRUE,
1072);
1073
1074$iftable_processors['dell-33xx-any-1000T'] = array
1075(
1076 'pattern' => '@^1/g(\d+)$@',
1077 'replacement' => 'g\\1',
1078 'dict_key' => '1-24',
1079 'label' => 'g\\1',
1080 'try_next_proc' => FALSE,
1081);
1082
8595dfd0
AD
1083$iftable_processors['dell-33xx-any-100TX'] = array
1084(
1085 'pattern' => '@^1/e(\d+)$@',
1086 'replacement' => 'e\\1',
1087 'dict_key' => 19,
1088 'label' => 'e\\1',
1089 'try_next_proc' => FALSE,
1090);
1091
1ce6a44d
AD
1092$iftable_processors['dell-5224-21-to-24-combo-1000SFP'] = array
1093(
1094 'pattern' => '@^EtherNet Port on unit 1, port:(21|22|23|24)$@',
1095 'replacement' => 'g\\1',
1096 'dict_key' => '4-1077',
1097 'label' => 'g\\1',
1098 'try_next_proc' => TRUE,
1099);
1100
1101$iftable_processors['dell-52xx-any-1000T'] = array
1102(
1103 'pattern' => '@^EtherNet Port on unit 1, port:(\d+)$@',
1104 'replacement' => 'g\\1',
1105 'dict_key' => 24,
1106 'label' => 'g\\1',
1107 'try_next_proc' => FALSE,
1108);
1109
92df4b0e
AD
1110$iftable_processors['dell-g1-to-g2-1000SFP'] = array
1111(
1112 'pattern' => '@^g(1|2)$@',
1113 'replacement' => 'g\\1',
1114 'dict_key' => '4-1077',
1115 'label' => 'g\\1',
1116 'try_next_proc' => FALSE,
1117);
1118
1119$iftable_processors['dell-g3-to-g4-1000T'] = array
1120(
1121 'pattern' => '@^g(3|4)$@',
1122 'replacement' => 'g\\1',
1123 'dict_key' => '1-24',
1124 'label' => 'g\\1',
1125 'try_next_proc' => FALSE,
1126);
1127
1b10e7cf
AD
1128$iftable_processors['dell-g17-to-g24-combo-1000T'] = array
1129(
1130 'pattern' => '@^g(17|18|19|20|21|22|23|24)$@',
1131 'replacement' => 'g\\1',
1132 'dict_key' => '1-24',
1133 'label' => 'g\\1',
92df4b0e
AD
1134 'try_next_proc' => TRUE,
1135);
1136
8595dfd0 1137$iftable_processors['dell-g21-to-g24-combo-1000SFP'] = array
92df4b0e
AD
1138(
1139 'pattern' => '@^g(21|22|23|24)$@',
1140 'replacement' => 'g\\1',
92df4b0e
AD
1141 'dict_key' => '4-1077',
1142 'label' => 'g\\1',
1143 'try_next_proc' => TRUE,
1144);
1145
92df4b0e
AD
1146$iftable_processors['dell-any-100TX'] = array
1147(
1148 'pattern' => '@^e(\d+)$@',
1149 'replacement' => 'e\\1',
1150 'dict_key' => 19,
1151 'label' => 'e\\1',
1152 'try_next_proc' => FALSE,
1153);
1154
1b10e7cf
AD
1155$iftable_processors['dell-any-1000SFP'] = array
1156(
1157 'pattern' => '@^g(\d+)$@',
1158 'replacement' => 'g\\1',
1159 'dict_key' => '4-1077',
1160 'label' => 'g\\1',
1161 'try_next_proc' => FALSE,
1162);
1163
1cd6eca3
AD
1164$iftable_processors['3com-49-to-52-1000SFP'] = array
1165(
1166 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(49|50|51|52)$@',
1167 'replacement' => '\\1/\\2/\\3',
1168 'dict_key' => '4-1077',
1169 'label' => '\\3',
1170 'try_next_proc' => FALSE,
1171);
1172
1173$iftable_processors['3com-any-1000T'] = array
1174(
1175 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(\d+)$@',
1176 'replacement' => '\\1/\\2/\\3',
1177 'dict_key' => 24,
1178 'label' => '\\3',
1179 'try_next_proc' => FALSE,
1180);
1181
536e7323 1182global $known_switches;
74aee2dc
DO
1183$known_switches = array // key is system OID w/o "enterprises" prefix
1184(
feee5e5a
DO
1185 '9.1.217' => array
1186 (
1187 'dict_key' => 124,
1188 'text' => 'WS-C2924-XL: 24 RJ-45/10-100TX',
1189 'processors' => array ('catalyst-chassis-any-100TX'),
10e81331
AD
1190 ),
1191 '9.1.220' => array
1192 (
1193 'dict_key' => 1719,
1194 'text' => 'WS-C2924M-XL: 24 RJ-45/10-100TX',
1195 'processors' => array ('catalyst-chassis-any-100TX'),
feee5e5a 1196 ),
462e65ac
DO
1197 '9.1.246' => array
1198 (
1199 'dict_key' => 391,
1200 'text' => 'WS-C3508G-XL: 8 GBIC/1000',
1201 'processors' => array ('catalyst-chassis-any-1000GBIC'),
1202 ),
d7466acb
DO
1203 '9.1.248' => array
1204 (
1205 'dict_key' => 393,
1206 'text' => 'WS-C3524-XL: 24 RJ-45/10-100TX + 2 GBIC/1000',
1207 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1208 ),
cfd07952
DO
1209 '9.1.278' => array
1210 (
1211 'dict_key' => 395,
1212 'text' => 'WS-C3548-XL: 48 RJ-45/10-100TX + 2 GBIC/1000',
1213 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1214 ),
74aee2dc
DO
1215 '9.1.324' => array
1216 (
1217 'dict_key' => 380,
1218 'text' => 'WS-C2950-24: 24 RJ-45/10-100TX',
6be06cbb 1219 'processors' => array ('catalyst-chassis-any-100TX'),
74aee2dc
DO
1220 ),
1221 '9.1.325' => array
1222 (
1223 'dict_key' => 382,
1224 'text' => 'WS-C2950C-24: 24 RJ-45/10-100TX + 2 MT-RJ/100FX fiber',
6be06cbb 1225 'processors' => array ('catalyst-chassis-25-to-26-100FX/MT-RJ', 'catalyst-chassis-any-100TX'),
74aee2dc 1226 ),
a3432267
DO
1227 '9.1.359' => array
1228 (
1229 'dict_key' => 386,
1230 'text' => 'WS-C2950T-24: 24 RJ-45/10-100TX + 2 1000T uplinks',
1231 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1232 ),
8fe7aefe
AD
1233 '9.1.366' => array
1234 (
1235 'dict_key' => 400,
1236 'text' => 'WS-C3550-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
1237 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1238 ),
13b28c20
DO
1239 '9.1.559' => array
1240 (
1241 'dict_key' => 387,
1242 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 1000T uplinks',
1243 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1244 ),
e41fafef
AD
1245 '9.1.694' => array
1246 (
1247 'dict_key' => 1710,
1248 'text' => 'WS-C2960-24TC-L: 24 RJ-45/10-100TX + 2 combo-gig',
1249 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1250 ),
7e87a291
DO
1251 '9.1.695' => array
1252 (
2b512043 1253 'dict_key' => 1590,
7e87a291
DO
1254 'text' => 'WS-C2960-48TC-L: 48 RJ-45/10-100TX + 2 combo-gig',
1255 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1256 ),
e8ea3f02
AD
1257 '9.1.930' => array
1258 (
aca86e3f 1259 'dict_key' => 1607,
e8ea3f02
AD
1260 'text' => 'WS-C3560E-12D-S: 12 X2/10000 w/TwinGig + OOBM',
1261 'processors' => array
1262 (
1263 'catalyst-chassis-any-1000SFP',
1264 'catalyst-chassis-uplinks-10000X2',
1265 'catalyst-chassis-mgmt',
1266 ),
1267 ),
13b28c20
DO
1268 '9.1.793' => array
1269 (
1270 'dict_key' => 1575,
1271 'text' => 'WS-C3560E-24TD: 24 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
1272 'processors' => array
1273 (
1274 'catalyst-chassis-25-to-28-1000SFP', // TwinGig
1275 'catalyst-chassis-any-1000T',
1276 'catalyst-chassis-uplinks-10000X2',
1277 'catalyst-chassis-mgmt',
1278 ),
1279 ),
1280 '9.1.794' => array
1281 (
1282 'dict_key' => 1574,
1283 'text' => 'WS-C3560E-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
1284 'processors' => array
1285 (
1286 'catalyst-chassis-49-to-52-1000SFP', // TwinGig
1287 'catalyst-chassis-any-1000T',
1288 'catalyst-chassis-uplinks-10000X2',
1289 'catalyst-chassis-mgmt',
1290 ),
1291 ),
38bd461c
AA
1292 '9.1.1257' => array
1293 (
1294 'dict_key' => 167,
1295 'text' => 'WS-C2960G-24TS-S: 24 RJ-45/10-100-1000T(X)',
1296 'processors' => array ('catalyst-chassis-25-to-26-1000SFP', 'catalyst-chassis-mgmt', 'catalyst-chassis-any-1000T'),
1297 ),
a048e8fc
DO
1298 '9.1.799' => array
1299 (
1300 'dict_key' => 168,
1301 'text' => 'WS-C2960G-8TC-L: 7 RJ-45/10-100-1000T(X) + 1 combo-gig',
1302 'processors' => array ('catalyst-chassis-8-combo-1000SFP', 'catalyst-chassis-any-1000T'),
1303 ),
74aee2dc
DO
1304 '9.1.696' => array
1305 (
1306 'dict_key' => 167,
1307 'text' => 'WS-C2960G-24TC-L: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
6be06cbb 1308 'processors' => array ('catalyst-chassis-21-to-24-combo-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1309 ),
1310 '9.1.697' => array
1311 (
1312 'dict_key' => 166,
1313 'text' => 'WS-C2960G-48TC-L: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
6be06cbb 1314 'processors' => array ('catalyst-chassis-45-to-48-combo-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc 1315 ),
38bd461c
AA
1316 '9.1.928' => array
1317 (
1318 'dict_key' => 163,
1319 'text' => 'WS-C2960-24TC-S: 24 RJ-45/10-100TX + 2 combo-gig',
1320 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-100TX'),
1321 ),
74aee2dc
DO
1322 '9.1.716' => array
1323 (
1324 'dict_key' => 164,
1325 'text' => 'WS-C2960-24TT-L: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1326 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1327 ),
1328 '9.1.717' => array
1329 (
13b28c20 1330 'dict_key' => 1572,
74aee2dc 1331 'text' => 'WS-C2960-48TT-L: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1332 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
74aee2dc 1333 ),
47a523af
AD
1334 '9.1.724' => array
1335 (
1336 'dict_key' => 160,
1337 'text' => 'WS-CE500-24TT: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1338 'processors' => array ('catalyst-any-100TX', 'catalyst-any-1000T'),
1339 ),
bc8b21f0
AD
1340 '9.1.727' => array
1341 (
1342 'dict_key' => 161,
1343 'text' => 'WS-CE500G-12TC: 8 RJ-45/10-100/1000T(X) + 4 combo',
1344 'processors' => array ('catalyst-9-to-12-1000SFP', 'catalyst-9-to-12-1000T', 'catalyst-any-1000T'),
1345 ),
ec523868
DO
1346 '9.1.950' => array
1347 (
1348 'dict_key' => 1347,
1349 'text' => 'WS-C2960-24PC: 44 RJ-45/10-100TX + 2 combo-gig',
1350 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1351 ),
4d043be1
AA
1352 '9.1.927' => array
1353 (
1354 'dict_key' => 140,
2b512043
DO
1355 'text' => 'WS-C2960-48TC-S: 48 RJ-45/10-100TX + 2 combo-gig',
1356 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
4d043be1 1357 ),
13b28c20
DO
1358 '9.1.1005' => array
1359 (
1360 'dict_key' => 1573,
1361 'text' => 'WS-C2960-48TT-S: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1362 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
1363 ),
74aee2dc
DO
1364 '9.1.527' => array
1365 (
1366 'dict_key' => 210,
1367 'text' => 'WS-C2970G-24T: 24 RJ-45/10-100-1000T(X)',
6be06cbb 1368 'processors' => array ('catalyst-chassis-any-1000T'),
74aee2dc
DO
1369 ),
1370 '9.1.561' => array
1371 (
1372 'dict_key' => 115,
1373 'text' => 'WS-C2970G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1374 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1375 ),
1376 '9.1.633' => array
1377 (
1378 'dict_key' => 169,
1379 'text' => 'WS-C3560-24TS: 24 RJ-45/10-100TX + 2 SFP/1000',
6be06cbb 1380 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1381 ),
1382 '9.1.634' => array
1383 (
1384 'dict_key' => 170,
1385 'text' => 'WS-C3560-48TS: 48 RJ-45/10-100TX + 4 SFP/1000',
6be06cbb 1386 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1387 ),
1388 '9.1.563' => array
1389 (
1390 'dict_key' => 171,
1391 'text' => 'WS-C3560-24PS: 24 RJ-45/10-100TX + 2 SFP/1000',
6be06cbb 1392 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1393 ),
1394 '9.1.564' => array
1395 (
1396 'dict_key' => 172,
1397 'text' => 'WS-C3560-48PS: 48 RJ-45/10-100TX + 4 SFP/1000',
6be06cbb 1398 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1399 ),
1400 '9.1.614' => array
1401 (
1402 'dict_key' => 175,
1403 'text' => 'WS-C3560G-24PS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1404 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1405 ),
1406 '9.1.615' => array
1407 (
1408 'dict_key' => 173,
1409 'text' => 'WS-C3560G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1410 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1411 ),
1412 '9.1.616' => array
1413 (
1414 'dict_key' => 176,
1415 'text' => 'WS-C3560G-48PS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1416 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1417 ),
1418 '9.1.617' => array
1419 (
1420 'dict_key' => 174,
1421 'text' => 'WS-C3560G-48TS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1422 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1423 ),
1424 '9.1.626' => array
1425 (
1426 'dict_key' => 147,
56a797ef 1427 'text' => 'WS-C4948: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000 + 1 RJ-45/100TX (OOB mgmt)',
cbc30061 1428 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
74aee2dc
DO
1429 ),
1430 '9.1.659' => array
1431 (
1432 'dict_key' => 377,
56a797ef 1433 'text' => 'WS-C4948-10GE: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 + 1 RJ-45/100TX (OOB mgmt)',
cbc30061 1434 'processors' => array ('catalyst-chassis-uplinks-10000X2', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
74aee2dc
DO
1435 ),
1436 '9.1.428' => array
1437 (
1438 'dict_key' => 389,
1439 'text' => 'WS-C2950G-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
6be06cbb 1440 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1441 ),
1442 '9.1.429' => array
1443 (
1444 'dict_key' => 390,
1445 'text' => 'WS-C2950G-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
6be06cbb 1446 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
74aee2dc 1447 ),
b3f84e8e
AD
1448 '9.1.471' => array
1449 (
1450 'dict_key' => 270,
1451 'text' => '2651XM: 2 RJ-45/10-100TX',
1452 'processors' => array ('catalyst-chassis-any-100TX'),
1453 ),
74aee2dc
DO
1454 '9.1.559' => array
1455 (
1456 'dict_key' => 387,
1457 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1458 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
74aee2dc 1459 ),
8a4bee49
DO
1460 '9.1.560' => array
1461 (
1462 'dict_key' => 384,
1463 'text' => 'WS-C2950SX-48: 48 RJ-45/10-100TX + 2 1000Base-SX',
1464 'processors' => array ('catalyst-chassis-uplinks-1000SX', 'catalyst-chassis-any-100TX'),
1465 ),
74aee2dc
DO
1466 '9.1.749' => array
1467 (
1468 'dict_key' => 989,
1469 'text' => 'WS-CBS3030-DEL: 10 internal/10-100-1000T(X) + 2 RJ-45/10-100-1000T(X) + 4 SFP/1000',
71d6b313 1470 'processors' => array ('catalyst-blade-11-to-12-1000T', 'catalyst-blade-13-to-16-1000SFP', 'catalyst-blade-any-bp/1000T'),
74aee2dc
DO
1471 ),
1472 '9.1.920' => array
1473 (
1474 'dict_key' => 795,
1475 'text' => 'WS-CBS3032-DEL: 16 internal/10-100-1000T(X) + 4 RJ-45/10-100-1000T(X) + 4 SFP/1000',
71d6b313 1476 'processors' => array ('catalyst-blade-17-to-20-1000T', 'catalyst-blade-21-to-24-1000SFP', 'catalyst-blade-any-bp/1000T'),
74aee2dc 1477 ),
2217e284
DO
1478 '9.1.367' => array
1479 (
1480 'dict_key' => 404,
1481 'text' => 'WS-C3550-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
1482 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000GBIC'),
1483 ),
7e87a291
DO
1484 '9.1.368' => array
1485 (
1486 'dict_key' => 398,
1487 'text' => 'WS-C3550-12T: 10 RJ-45/10-100-1000T(X) + 2 GBIC/1000',
1488 'processors' => array ('catalyst-1-to-10-1000T', 'catalyst-11-to-12-GBIC'),
1489 ),
86d614c3
DO
1490 '9.1.431' => array
1491 (
1492 'dict_key' => 399,
1493 'text' => 'WS-C3550-12G: 10 GBIC/1000 + 2 RJ-45/10-100-1000T(X)',
1494 'processors' => array ('catalyst-11-to-12-1000T', 'catalyst-chassis-any-1000GBIC'),
1495 ),
a9bd9e98
DO
1496 '9.1.282' => array
1497 (
1498 'dict_key' => 154,
1499 'text' => 'WS-C6506: modular device (INCOMPLETE!)',
1500 'processors' => array ('catalyst-chassis-any-1000T'),
1501 ),
65b4b21a
DO
1502 '9.1.1104' => array
1503 (
1504 'dict_key' => 1348,
1505 'text' => 'WS-C2350-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig option',
1506 'processors' => array
1507 (
1508 'catalyst-chassis-49-to-52-1000SFP', // TwinGig actually
1509 'catalyst-chassis-any-1000T',
1510 'catalyst-chassis-uplinks-10000X2',
1511 'catalyst-chassis-mgmt',
1512 ),
1513 ),
712010be
AA
1514 '9.1.1016' => array
1515 (
1516 'dict_key' => 1370,
1517 'text' => 'WS-C2960-48PST-L: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X)',
1518 'processors' => array
1519 (
1520 'catalyst-chassis-any-100TX',
1521 'catalyst-chassis-1-to-2-1000SFP',
1522 'catalyst-chassis-uplinks-1000T',
1523 ),
1524 ),
38c9bb20
DO
1525 '9.1.1208' => array
1526 (
1527 'dict_key' => 1394,
1528 'text' => 'WS-C2960S-24PS-L: 24 RJ-45/10-100-1000T(X) PoE+ + 4 SFP/1000',
1529 'processors' => array
1530 (
1531 'catalyst-chassis-mgmt',
1532 'catalyst-stack-25-to-28-SFP',
1533 'catalyst-stack-any-1000T',
1534 ),
1535 ),
13b28c20
DO
1536 '9.1.1227' => array
1537 (
1538 'dict_key' => 1577,
1539 'text' => 'WS-C3560X-48T: 48 RJ-45/10-100-1000T(X) + network module + OOBM',
1540 'processors' => array
1541 (
1542 'C3KX-NM-10000',
1543 'C3KX-NM-1000',
1544 'catalyst-chassis-any-1000T',
1545 'catalyst-chassis-mgmt',
1546 ),
1547 ),
b475f795
DO
1548 '9.1.1292' => array
1549 (
b0021c43 1550 'dict_key' => 1606,
b475f795
DO
1551 'text' => 'WS-C2360-48TD: 48 RJ-45 GigE + 4 SFP+/10000',
1552 'processors' => array ('catalyst-chassis-any-1000T', 'catalyst-chassis-mgmt', 'catalyst-chassis-uplinks-10000SFP+'),
1553 ),
b0021c43
AD
1554 '9.6.1.82.48.1' => array
1555 (
1556 'dict_key' => 1612,
1557 'text' => 'SF 300-48: 48 RJ-45/10/100 + 2 RJ-45/10-100-1000T(X) + 2 combo-gig',
1558 'processors' => array
1559 (
1560 'generic-gi-3-to-4-combo-1000SFP',
1561 'generic-gi-3-to-4-combo-1000T',
1562 'generic-gi-1-to-2-1000T',
1563 'generic-fa-any-100TX',
1564 ),
1565 'ifDescrOID' => 'ifName',
1566 ),
74aee2dc
DO
1567 '9.12.3.1.3.719' => array
1568 (
1569 'dict_key' => 960,
1570 'text' => 'N5K-C5020: 40 SFP+/10000',
e7662d90 1571 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
74aee2dc 1572 ),
bc45a3a4
DO
1573 '9.12.3.1.3.798' => array
1574 (
1575 'dict_key' => 959,
1576 'text' => 'N5K-C5010: 20 SFP+/10000',
1577 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1578 ),
0533b64d
DO
1579 '9.12.3.1.3.1008' => array
1580 (
1581 'dict_key' => 1412,
1582 'text' => 'N5K-C5548P: 32 SFP+/10000',
1583 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1584 ),
473dd02e
JT
1585 '9.12.3.1.3.1084' => array
1586 (
1587 'dict_key' => 1412,
1588 'text' => 'N5K-C5548P: 32 SFP+/10000',
1589 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1590 ),
13b28c20
DO
1591 '11.2.3.7.11.19' => array
1592 (
1593 'dict_key' => 859,
1594 'text' => 'J4813A: 24 RJ-45/10-100TX + 2 modules of varying type',
1595 'processors' => array ('procurve-chassis-100TX'),
1596 ),
6249647d
AD
1597 '11.2.3.7.11.29' => array
1598 (
1599 'dict_key' => 866,
1600 'text' => 'J4899A: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1601 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1602 ),
4bbb87a3
AD
1603 '11.2.3.7.11.31' => array
1604 (
1605 'dict_key' => 870,
1606 'text' => 'J4903A: 24 RJ-45/10-100-1000T(X)',
1607 'processors' => array ('procurve-chassis-1000T'),
1608 ),
56a797ef
DO
1609 '11.2.3.7.11.32' => array
1610 (
1611 'dict_key' => 871,
1612 'text' => 'J4904A: 48 RJ-45/10-100-1000T(X)',
1613 'processors' => array ('procurve-chassis-1000T'),
1614 ),
4bbb87a3
AD
1615 '11.2.3.7.11.34' => array
1616 (
1617 'dict_key' => 864,
1618 'text' => 'J8164A: 24 RJ-45/10-100TX POE + 2 RJ-45/10-100-1000T(X)',
1619 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
1620 ),
74aee2dc
DO
1621 '11.2.3.7.11.36' => array
1622 (
1623 'dict_key' => 865,
4bbb87a3 1624 'text' => 'J8164A: 24 RJ-45/10-100TX PoE + 2 RJ-45/10-100-1000T(X)',
56a797ef 1625 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
74aee2dc
DO
1626 ),
1627 '11.2.3.7.11.35' => array
1628 (
1629 'dict_key' => 867,
4bbb87a3 1630 'text' => 'J8165A: 48 RJ-45/10-100TX PoE + 2 RJ-45/10-100-1000T(X)',
56a797ef
DO
1631 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1632 ),
1633 '11.2.3.7.11.9' => array
1634 (
1635 'dict_key' => 1086,
1636 'text' => 'J4121A: modular system',
1637 'processors' => array ('procurve-modular-100TX'),
74aee2dc 1638 ),
4bbb87a3
AD
1639 '11.2.3.7.11.53' => array
1640 (
1641 'dict_key' => 881,
1642 'text' => 'J8773A: modular system',
1643 'processors' => array ('procurve-modular-1000T'),
1644 ),
13b28c20
DO
1645 '11.2.3.7.11.63' => array
1646 (
1647 'dict_key' => 868,
1648 'text' => 'J9021A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1649 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1650 ),
1651 '11.2.3.7.11.65' => array
1652 (
1653 'dict_key' => 850,
1654 'text' => 'J9028A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig',
1655 'processors' => array ('smc2-combo-23-to-24', 'smc2-any-1000T'),
1656 ),
83aedacd
AD
1657 '11.2.3.7.11.78' => array
1658 (
1659 'dict_key' => 861,
1660 'text' => 'J9087A: 24 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1661 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
1662 ),
1663 '11.2.3.7.11.80' => array
1664 (
1665 'dict_key' => 1570,
1666 'text' => 'J9086A: 24 RJ-45/10-100TX 12 PoE + 2 1000T + 2 SFP-1000',
1667 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
1668 ),
13b28c20
DO
1669 '11.2.3.7.11.86' => array
1670 (
1671 'dict_key' => 1571,
1672 'text' => 'J9145A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1673 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1674 ),
4b43f713
DO
1675 '11.2.3.7.11.87' => array
1676 (
1677 'dict_key' => 1349,
13b28c20 1678 'text' => 'J9147A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
4b43f713
DO
1679 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1680 ),
f8de6305
DO
1681 '11.2.3.7.11.85' => array
1682 (
1683 'dict_key' => 1600,
1684 'text' => 'J9148A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1685 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1686 ),
db5d7da5
AD
1687 '11.2.3.7.11.88' => array
1688 (
1689 'dict_key' => 1349,
1690 'text' => 'J9279A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig + varying uplinks',
1691 'processors' => array ('procurve-23-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1692 ),
13b28c20
DO
1693 '11.2.3.7.11.79' => array
1694 (
1695 'dict_key' => 863,
1696 'text' => 'J9089A: 48 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1697 'processors' => array ('procurve-49-to-50-1000T', 'procurve-51-to-52-1000SFP', 'procurve-chassis-100TX'),
4bbb87a3
AD
1698 ),
1699 '11.2.3.7.11.95' => array
1700 (
1701 'dict_key' => 1711,
1702 'text' => 'J9138A: 24 RJ-45/10-100TX PoE + 2 1000T + 2 combo-gig',
1703 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
13b28c20 1704 ),
5d930daf
AD
1705 '11.2.3.7.11.105' => array
1706 (
1707 'dict_key' => 1641,
1708 'text' => 'J9452A: 48 RJ-45/10-100-1000T + 2 SFP-10000+',
1709 'processors' => array ('procurve-49-to-52-10000SFP+', 'procurve-chassis-1000T'),
1710 ),
4a2358b3
DO
1711 '11.2.3.7.11.33.4.1.1' => array
1712 (
1713 'dict_key' => 1605,
1714 'text' => 'HP GbE2c w/SFP',
1715 'processors' => array
1716 (
1717 'gbe2csfp-1-to-16',
1718 'gbe2csfp-17',
1719 'gbe2csfp-18',
1720 'gbe2csfp-19',
1721 'gbe2csfp-20',
1722 'gbe2csfp-21sfp',
1723 'gbe2csfp-22sfp',
1724 'gbe2csfp-23sfp',
1725 'gbe2csfp-24sfp',
1726 'gbe2csfp-21',
1727 'gbe2csfp-22',
1728 'gbe2csfp-23',
1729 'gbe2csfp-24',
1730 ),
1731 ),
1cd6eca3
AD
1732 '43.1.16.4.3.29' => array
1733 (
1734 'dict_key' => 758,
1735 'text' => '4200G: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
1736 'processors' => array ('3com-49-to-52-1000SFP', '3com-any-1000T'),
1737 ),
fc807353
DO
1738 '4526.100.1.1' => array
1739 (
1740 'dict_key' => 587,
1741 'text' => 'FSM7328S: 24 RJ-45/10-100TX + 4 combo-gig',
1742 'processors' => array ('netgear-chassis-any-100TX', 'netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
1743 ),
74aee2dc
DO
1744 '4526.100.2.2' => array
1745 (
1746 'dict_key' => 562,
6be06cbb
DO
1747 'text' => 'GSM7224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1748 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
74aee2dc 1749 ),
3e8ad42f
DO
1750 '4526.100.2.3' => array
1751 (
1752 'dict_key' => 559,
1753 'text' => 'GSM7212: 12 combo-gig',
1754 'processors' => array ('netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
1755 ),
1b24b8ae
DO
1756 '4526.100.11.1' => array
1757 (
1758 'dict_key' => 557,
1759 'text' => 'GSM7224R: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1760 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1761 ),
12af10b8
DO
1762 '4526.100.11.5' => array
1763 (
1764 'dict_key' => 1602,
1765 'text' => 'GSM7224v2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1766 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1767 ),
e34faed3
DO
1768 '4526.100.1.13' => array
1769 (
1770 'dict_key' => 1601,
1771 'text' => 'GSM7328Sv2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1772 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1773 ),
56a797ef
DO
1774 '45.3.68.5' => array
1775 (
1776 'dict_key' => 1085,
1777 'text' => 'BES50GE-12T PWR: 12 RJ-45/10-100-1000T(X)',
1778 'processors' => array ('nortel-any-1000T'),
1779 ),
91389980
DO
1780 '2636.1.1.1.2.29' => array
1781 (
1782 'dict_key' => 925,
1783 'text' => 'MX240 modular router',
1784 'processors' => array ('juniper-DPCE-R-4XGE-XFP'),
1785 ),
1f54e1ba
DO
1786 // Juniper Networks assigns single SNMP OID per series:
1787 // EX2200 2636.1.1.1.1.43
1788 // EX3200 2636.1.1.1.2.30
1789 // EX4200 2636.1.1.1.2.31
1790 // EX4500 2636.1.1.1.1.44
1791 // There is a special workaround in code below to derive specific
1792 // product number from sysDescr string.
e68824f6
AD
1793 '2636.1.1.1.2.30' => array
1794 (
8595dfd0 1795 'dict_key' => 900,
e68824f6
AD
1796 'text' => 'Juniper EX3200 series',
1797 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
1798 ),
1f54e1ba
DO
1799 '2636.1.1.1.2.31' => array
1800 (
1801 'dict_key' => 905,
1802 'text' => 'Juniper EX4200 series',
1803 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
1804 ),
7d69a266
DO
1805 '2011.2.23.96' => array
1806 (
1807 'dict_key' => 1321,
24c3e444 1808 'text' => 'S5328C-EI-24S: 20 SFP-1000 + 4 combo-gig + 2 XFP slots',
7d69a266
DO
1809 'processors' => array ('quidway-21-to-24-comboT', 'quidway-any-1000SFP', 'quidway-XFP', 'quidway-mgmt'),
1810 ),
b55f8de3
DO
1811 '2011.2.23.103' => array
1812 (
1813 'dict_key' => 1341,
1814 'text' => 'S5352C-SI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
1815 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1816 ),
38bd461c
AA
1817 '2011.2.23.97' => array
1818 (
1819 'dict_key' => 1337,
1820 'text' => 'S5352C-EI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
1821 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1822 ),
1823 '2011.2.23.95' => array
1824 (
1825 'dict_key' => 1335,
1826 'text' => 'S5328C-EI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
1827 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1828 ),
24c3e444
DO
1829 '2011.2.23.102' => array
1830 (
1831 'dict_key' => 1339,
1832 'text' => 'S5328C-SI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
1833 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1834 ),
661b3fdb
DO
1835 '1991.1.3.45.2.1.1.1' => array
1836 (
1837 'dict_key' => 127,
1838 'text' => 'FGS648P: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
1839 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
1840 ),
1841 '1991.1.3.45.2.2.1.1' => array
1842 (
1843 'dict_key' => 131,
1844 'text' => 'FGS648P-POE: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
1845 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
1846 ),
ec523868
DO
1847 '1991.1.3.54.2.4.1.1' => array
1848 (
1849 'dict_key' => 1362,
1850 'text' => 'FCX 648: 48 RJ-45/10-100-1000T(X) + uplink slot with 4 SFP+',
1851 'processors' => array ('fgs-any-1000T', 'fcx-uplinks', 'fcx-management'),
1852 ),
6c32c3ff
AA
1853 '1991.1.3.46.1.1.1.1' => array
1854 (
1855 'dict_key' => 413,
1856 'text' => 'FLS 624: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 3 optional 10G modules',
1857 'processors' => array ('fls624-combo', 'fgs-any-1000T', 'fls-uplinks'),
1858 ),
1859 '1991.1.3.46.2.1.1.1' => array
1860 (
1861 'dict_key' => 414,
1862 'text' => 'FLS 648: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 optional 10G modules',
1863 'processors' => array ('fls648-combo', 'fgs-any-1000T', 'fls-uplinks'),
1864 ),
13b28c20
DO
1865 '1991.1.3.52.2.2.1.1' => array
1866 (
1867 'dict_key' => 1032,
1868 'text' => 'FWS648G: 4 combo-gig + 44 RJ-45/10-100-1000T(X)',
1869 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T'),
1870 ),
4eeadb79
DO
1871 '1916.2.71' => array
1872 (
1873 'dict_key' => 694,
1874 'text' => 'X450a-24t: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + XFP uplinks slot',
1875 'processors' => array ('summit-25-to-26-XFP-uplinks', 'summit-21-to-24-comboSFP', 'summit-any-1000T', 'summit-management'),
1876 ),
dbcf1931
DO
1877 '1916.2.139' => array
1878 (
1879 'dict_key' => 1353,
1880 'text' => 'X480-24x: 12 SFP-1000 + 12 combo-gig + 2 XFP + VIM slot',
1881 'processors' => array
1882 (
1883 'summit-27-to-30-XFP-uplinks',
1884 'summit-25-to-26-XFP-uplinks',
1885 'summit-13-to-24-comboT',
1886 'summit-any-SFP',
1887 'summit-management'
1888 ),
1889 ),
fb3e70de
DO
1890 '202.20.68' => array
1891 (
1892 'dict_key' => 1374,
1893 'text' => 'SMC8150L2: 46 RJ-45/10-100-1000T(X) + 4 combo ports',
1894 'processors' => array ('smc-combo-45-to-48', 'nortel-any-1000T'),
1895 ),
8acd246d
DO
1896 '6027.1.3.12' => array
1897 (
1898 'dict_key' => 1471,
1899 'text' => 'Force10 S60: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1e5a92d8
DO
1900 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
1901 ),
84ea7e6e
DO
1902 '6027.1.3.13' => array
1903 (
1904 'dict_key' => 1470,
1905 'text' => 'Force10 S55: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1906 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
1907 ),
1e5a92d8
DO
1908 '6027.1.3.14' => array
1909 (
1910 'dict_key' => 1472,
1911 'text' => 'Force10 S4810: 48 SFP+-1000/10000 + 4 QSFP-40000 ports',
1912 'processors' => array ('ftos-any-10000SFP+', 'ftos-any-QSFP+', 'ftos-mgmt'),
8acd246d 1913 ),
13b28c20
DO
1914 '202.20.59' => array
1915 (
1916 'dict_key' => 1371,
1917 'text' => 'SMC8124L2: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
1918 'processors' => array ('smc2-combo-21-to-24', 'smc2-any-1000T'),
1919 ),
1920 '202.20.66' => array
1921 (
1922 'dict_key' => 1567,
1923 'text' => 'SMC6128L2: 24 RJ-45/10-100TX + 4 combo-gig ports',
1924 'processors' => array ('smc2-combo-25-to-28', 'smc2-1000T-25-to-28', 'smc2-any-100TX'),
1925 ),
a28aee72
AD
1926 '12356.101.1.3002'=> array
1927 (
1928 'dict_key' => 1609,
1929 'text' => 'FG310B: 10 RJ-45/10-1000T',
1930 'processors' => array('fortinet-chassis-any-1000T'),
1931 ),
06a03a99
AD
1932 '30065.1.3011.7124.3282' => array
1933 (
92df4b0e
AD
1934 'dict_key' => 1610,
1935 'text' => 'DCS-7124S: 24 SFP+/10000',
1936 'processors' => array ('arista-any-SFP+', 'arista-management'),
1937 ),
1ce6a44d
AD
1938 '674.10895.4' => array
1939 (
1940 'dict_key' => 1622,
1941 'text' => 'PowerConnect 5224: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
1942 'processors' => array ('dell-5224-21-to-24-combo-1000SFP', 'dell-52xx-any-1000T'),
1943 ),
1b10e7cf
AD
1944 '674.10895.3000' => array
1945 (
1946 'dict_key' => 1623,
1947 'text' => 'PowerConnect 6024F: 16 SFP + 8 combo ports',
8595dfd0 1948 'processors' => array ('dell-g17-to-g24-combo-1000T', 'dell-any-1000SFP'),
1b10e7cf
AD
1949 'ifDescrOID' => 'ifName',
1950 ),
92df4b0e
AD
1951 '674.10895.3003' => array
1952 (
1953 'dict_key' => 1611,
1954 'text' => 'PowerConnect 3348: 48 RJ-45/10-100TX + 2 combo ports',
1955 'processors' => array ('dell-33xx-any-combo-1000SFP', 'dell-33xx-any-1000T', 'dell-33xx-any-100TX'),
1956 'ifDescrOID' => 'entPhysicalName',
1957 ),
1b10e7cf
AD
1958 '674.10895.3004' => array
1959 (
1960 'dict_key' => 349,
1961 'text' => 'PowerConnect 5324: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 1962 'processors' => array ('dell-g21-to-g24-combo-1000SFP', 'generic-g-any-1000T'),
1b10e7cf
AD
1963 'ifDescrOID' => 'ifName',
1964 ),
92df4b0e
AD
1965 '674.10895.3007' => array
1966 (
1967 'dict_key' => 347,
1968 'text' => 'PowerConnect 3448: 48 RJ-45/10-100TX + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
1969 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
1970 'ifDescrOID' => 'ifName',
1971 ),
1972 '674.10895.3009' => array
1973 (
1974 'dict_key' => 348,
1975 'text' => 'PowerConnect 3448P: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
1976 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
1977 'ifDescrOID' => 'ifName',
1978 ),
367fcba0
AD
1979 '674.10895.3010' => array
1980 (
1981 'dict_key' => 350,
1982 'text' => 'PowerConnect 6224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1983 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1984 ),
e326551d
AD
1985 '674.10895.3014' => array
1986 (
1987 'dict_key' => 352,
1988 'text' => 'PowerConnect 6224F: 20 SFP + 4 combo-gig',
1989 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000SFP'),
1990 ),
92df4b0e
AD
1991 '674.10895.3017' => array
1992 (
1993 'dict_key' => 1067,
1994 'text' => 'PowerConnect 3548: 48 RJ-45/10-100TX + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
1995 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
1996 ),
1997 '674.10895.3019' => array
1998 (
1999 'dict_key' => 1068,
2000 'text' => 'PowerConnect 3548P: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2001 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2002 ),
92df4b0e
AD
2003 '674.10895.3020' => array
2004 (
2005 'dict_key' => 1069,
2006 'text' => 'PowerConnect 5424: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2007 'processors' => array ('dell-g21-to-g24-combo-1000SFP', 'generic-g-any-1000T'),
92df4b0e
AD
2008 'ifDescrOID' => 'ifName',
2009 ),
2010 '674.10895.3021' => array
2011 (
2012 'dict_key' => 1070,
2013 'text' => 'PowerConnect 5448: 44 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2014 'processors' => array ('generic-g45-to-g48-combo-1000SFP', 'generic-g-any-1000T'),
92df4b0e 2015 'ifDescrOID' => 'ifName',
06a03a99 2016 ),
ac02ab69
AD
2017 '10977.11825.11833.97.25451.12800.100.4.4' => array
2018 (
2019 'dict_key' => 577,
2020 'text' => 'FS750T2: 48 RJ-45/10-100TX + 2 combo-gig',
2021 'processors' => array ('netgear-49-to-50-combo-1000SFP', 'netgear-49-to-50-combo-1000T', 'netgear-any-100TX'),
2022 ),
8595dfd0
AD
2023 '3955.6.1.2048.1' => array
2024 (
2025 'dict_key' => 1624,
2026 'text' => 'Linksys SRW2048: 44 RJ-45/10-100-1000T(X) + 4 combo ports',
2027 'processors' => array ('generic-g45-to-g48-combo-1000SFP', 'generic-g-any-1000T'),
2028 'ifDescrOID' => 'ifName',
2029 ),
74aee2dc
DO
2030);
2031
536e7323 2032global $swtype_pcre;
1f54e1ba
DO
2033$swtype_pcre = array
2034(
2035 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.30 /s' => 1360,
2036 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.50 /s' => 1361,
8732faac 2037 '/Huawei Versatile Routing Platform Software.+VRP.+Software,\s*Version 5.70 /is' => 1369,
1f54e1ba
DO
2038 // FIXME: get sysDescr for IronWare 5 and add a pattern
2039 '/^Brocade Communications Systems.+, IronWare Version 07\./' => 1364,
2040 '/^Juniper Networks,.+JUNOS 9\./' => 1366,
2041 '/^Juniper Networks,.+JUNOS 10\./' => 1367,
2042);
2043
74aee2dc
DO
2044function updateStickerForCell ($cell, $attr_id, $new_value)
2045{
472510e7
AA
2046 if
2047 (
2048 isset ($cell['attrs'][$attr_id])
2049 and !strlen ($cell['attrs'][$attr_id]['value'])
2050 and strlen ($new_value)
2051 )
74aee2dc
DO
2052 commitUpdateAttrValue ($cell['id'], $attr_id, $new_value);
2053}
2054
bdc91a5c
DO
2055// Accept "X-Y" on input and make sure, that PortInterfaceCompat contains
2056// a record with IIF id = X and OIF id = Y.
2057function checkPIC ($port_type_id)
2058{
f2005400
AA
2059 // cache PortInterfaceCompat
2060 static $compat_array = NULL;
2061 if (! isset ($compat_array))
bdc91a5c 2062 {
f2005400
AA
2063 $compat_array = array();
2064 foreach (getPortInterfaceCompat() as $record)
2065 {
2066 $key = $record['iif_id'] . '-' . $record['oif_id'];
2067 $compat_array[$key] = 1;
2068 }
2069 }
92df4b0e 2070
f2005400
AA
2071 if (preg_match ('/^(\d+-)?(\d+)$/', $port_type_id, $m))
2072 {
2073 $iif_id = $m[1];
2074 $oif_id = $m[2];
2075 if (empty ($iif_id[1]))
2076 {
2077 $iif_id = 1;
2078 $port_type_id = $iif_id . '-' . $port_type_id;
2079 }
2080 if (! array_key_exists ($port_type_id, $compat_array))
2081 {
2082 commitSupplementPIC ($iif_id, $oif_id);
2083 $compat_array[$port_type_id] = 1;
2084 }
bdc91a5c 2085 }
bdc91a5c
DO
2086}
2087
8536e20a
DO
2088$msgcode['doSNMPmining']['ERR1'] = 161;
2089$msgcode['doSNMPmining']['ERR2'] = 162;
8228bdb4 2090function doSNMPmining ($object_id, $snmpsetup)
74aee2dc 2091{
74aee2dc
DO
2092 $objectInfo = spotEntity ('object', $object_id);
2093 $objectInfo['attrs'] = getAttrValues ($object_id);
2094 $endpoints = findAllEndpoints ($object_id, $objectInfo['name']);
2095 if (count ($endpoints) == 0)
8ab645cf 2096 return showFuncMessage (__FUNCTION__, 'ERR1'); // endpoint not found
74aee2dc 2097 if (count ($endpoints) > 1)
8ab645cf 2098 return showFuncMessage (__FUNCTION__, 'ERR2'); // can't pick an address
4848a7e3
DO
2099
2100 switch ($objectInfo['objtype_id'])
2101 {
24a6e3a2 2102 case 7:
4848a7e3 2103 case 8:
7b2a1a90 2104 $device = new RTSNMPDevice ($endpoints[0], $snmpsetup);
8228bdb4 2105 return doSwitchSNMPmining ($objectInfo, $device);
4848a7e3 2106 case 2:
7b2a1a90 2107 $device = new APCPowerSwitch ($endpoints[0], $snmpsetup);
8228bdb4 2108 return doPDUSNMPmining ($objectInfo, $device);
92df4b0e 2109 }
4848a7e3
DO
2110}
2111
24a6e3a2 2112$msgcode['doSwitchSNMPmining']['ERR3'] = 188;
e22f9600 2113$msgcode['doSwitchSNMPmining']['ERR4'] = 189;
8228bdb4 2114function doSwitchSNMPmining ($objectInfo, $device)
4848a7e3 2115{
4848a7e3 2116 global $known_switches, $iftable_processors;
92df4b0e 2117
8228bdb4 2118 if (FALSE === ($sysObjectID = $device->snmpget ('sysObjectID.0')))
8ab645cf 2119 return showFuncMessage (__FUNCTION__, 'ERR3'); // // fatal SNMP failure
ac02ab69 2120 $sysObjectID = preg_replace ('/^.*(enterprises\.|joint-iso-ccitt\.)([\.[:digit:]]+)$/', '\\2', $sysObjectID);
8228bdb4
DO
2121 $sysName = substr ($device->snmpget ('sysName.0'), strlen ('STRING: '));
2122 $sysDescr = substr ($device->snmpget ('sysDescr.0'), strlen ('STRING: '));
74aee2dc 2123 $sysDescr = str_replace (array ("\n", "\r"), " ", $sysDescr); // Make it one line
92df4b0e 2124 $ifDescr_tablename = (isset($known_switches[$sysObjectID]['ifDescrOID'])) ? $known_switches[$sysObjectID]['ifDescrOID'] : 'ifDescr';
74aee2dc 2125 if (!isset ($known_switches[$sysObjectID]))
8ab645cf 2126 return showFuncMessage (__FUNCTION__, 'ERR4', array ($sysObjectID)); // unknown OID
7e577e27 2127 showSuccess ($known_switches[$sysObjectID]['text']);
5e193b67
DO
2128 foreach (array_keys ($known_switches[$sysObjectID]['processors']) as $pkey)
2129 if (!array_key_exists ($known_switches[$sysObjectID]['processors'][$pkey], $iftable_processors))
2130 {
8ab645cf 2131 showWarning ('processor "' . $known_switches[$sysObjectID]['processors'][$pkey] . '" not found');
5e193b67
DO
2132 unset ($known_switches[$sysObjectID]['processors'][$pkey]);
2133 }
56a797ef 2134 updateStickerForCell ($objectInfo, 2, $known_switches[$sysObjectID]['dict_key']);
74aee2dc
DO
2135 updateStickerForCell ($objectInfo, 3, $sysName);
2136 switch (1)
2137 {
56a797ef 2138 case preg_match ('/^9\.1\./', $sysObjectID): // Catalyst
84986395
DO
2139 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
2140 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
74aee2dc
DO
2141 $ios_codes = array
2142 (
2143 '12.0' => 244,
2144 '12.1' => 251,
2145 '12.2' => 252,
2146 );
2147 updateStickerForCell ($objectInfo, 5, $exact_release);
6be06cbb
DO
2148 if (array_key_exists ($major_line, $ios_codes))
2149 updateStickerForCell ($objectInfo, 4, $ios_codes[$major_line]);
8228bdb4 2150 $sysChassi = $device->snmpget ('1.3.6.1.4.1.9.3.6.3.0');
74aee2dc
DO
2151 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2152 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
bdc91a5c
DO
2153 checkPIC ('1-29');
2154 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
b3f84e8e
AD
2155 if (preg_match ('/Cisco IOS Software, C2600/', $sysDescr))
2156 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'auxillary', ''); // RJ-45 RS-232 aux port
facd0235
DO
2157 // blade devices are powered through internal circuitry of chassis
2158 if ($sysObjectID != '9.1.749' and $sysObjectID != '9.1.920')
2159 {
2160 checkPIC ('1-16'); // AC input
2161 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2162 }
74aee2dc 2163 break;
869d4ff4
DO
2164 case preg_match ('/^9\.6\.1\./', $sysObjectID): // Cisco SF series
2165 checkPIC ('1-681');
2166 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
b0021c43
AD
2167 checkPIC ('1-16');
2168 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2169 break;
56a797ef 2170 case preg_match ('/^9\.12\.3\.1\.3\./', $sysObjectID): // Nexus
84986395
DO
2171 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
2172 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
74aee2dc
DO
2173 $nxos_codes = array
2174 (
2175 '4.0' => 963,
2176 '4.1' => 964,
2177 );
6be06cbb
DO
2178 if (array_key_exists ($major_line, $nxos_codes))
2179 updateStickerForCell ($objectInfo, 4, $nxos_codes[$major_line]);
74aee2dc 2180 updateStickerForCell ($objectInfo, 5, $exact_release);
0533b64d
DO
2181 $sysChassi = $device->snmpget ('1.3.6.1.2.1.47.1.1.1.1.11.149');
2182 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2183 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
bdc91a5c 2184 checkPIC ('1-29');
24a6e3a2 2185 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
dcfa87d7
DO
2186 checkPIC ('1-16'); // AC input
2187 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2188 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
74aee2dc 2189 break;
13b28c20
DO
2190 case preg_match ('/^11\.2\.3\.7\.11\.(\d+)$/', $sysObjectID, $matches): // ProCurve
2191 $console_per_product = array
2192 (
5d930daf
AD
2193 33 => '1-29', # RJ-45 RS-232
2194 63 => '1-29',
83aedacd
AD
2195 78 => '1-29',
2196 79 => '1-29',
2197 80 => '1-29',
13b28c20
DO
2198 86 => '1-29',
2199 87 => '1-29',
13b28c20
DO
2200 19 => '1-681', # DB-9 RS-232
2201 );
2202 if (array_key_exists ($matches[1], $console_per_product))
2203 {
2204 checkPIC ($console_per_product[$matches[1]]);
5d930daf 2205 commitAddPort ($objectInfo['id'], 'console', $console_per_product[$matches[1]], 'console', '');
13b28c20 2206 }
5d930daf
AD
2207 $oom_per_product = array
2208 (
2209 33 => '1-24', # RJ-45 100Mb
2210 );
2211 if (array_key_exists ($matches[1], $oom_per_product))
2212 {
2213 checkPIC ($oom_per_product[$matches[1]]);
2214 commitAddPort ($objectInfo['id'], 'mgmt', $oom_per_product[$matches[1]], 'mgmt', '');
2215 }
2216 checkPIC ('1-16');
2217 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
84986395 2218 $exact_release = preg_replace ('/^.* revision ([^ ]+), .*$/', '\\1', $sysDescr);
74aee2dc
DO
2219 updateStickerForCell ($objectInfo, 5, $exact_release);
2220 break;
5f2354ce 2221 case preg_match ('/^4526\.100\./', $sysObjectID): // NETGEAR
bdc91a5c
DO
2222 checkPIC ('1-681');
2223 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
6be06cbb 2224 break;
7d69a266 2225 case preg_match ('/^2011\.2\.23\./', $sysObjectID): // Huawei
1f54e1ba 2226 detectSoftwareType ($objectInfo, $sysDescr);
bdc91a5c 2227 checkPIC ('1-681');
b55f8de3 2228 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
7d69a266 2229 break;
e68824f6 2230 case preg_match ('/^2636\.1\.1\.1\.2\.3(0|1)/', $sysObjectID): // Juniper EX3200/EX4200
1f54e1ba 2231 detectSoftwareType ($objectInfo, $sysDescr);
e68824f6
AD
2232 $sw_version = preg_replace ('/^.*, kernel JUNOS ([^ ]+).*$/', '\\1', $sysDescr);
2233 updateStickerForCell ($objectInfo, 5, $sw_version);
2234 // one RJ-45 RS-232 and one AC port (it could be DC, but chances are it's AC)
1f54e1ba
DO
2235 checkPIC ('1-29');
2236 commitAddPort ($objectInfo['id'], 'con', '1-29', 'CON', ''); // RJ-45 RS-232 console
e68824f6
AD
2237 checkPIC ('1-16');
2238 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2239 // Juniper uses the same sysObjectID for multiple HW models, override if necessary
2240 if (preg_match ('/^Juniper Networks, Inc. ex3200-48t internet router/', $sysDescr))
2241 updateStickerForCell ($objectInfo, 2, 902);
1f54e1ba
DO
2242 if (preg_match ('/^Juniper Networks, Inc. ex4200-48t internet router/', $sysDescr))
2243 updateStickerForCell ($objectInfo, 2, 907);
1f54e1ba 2244 break;
7d69a266 2245 case preg_match ('/^2636\.1\.1\.1\.2\./', $sysObjectID): // Juniper
1f54e1ba 2246 detectSoftwareType ($objectInfo, $sysDescr);
bdc91a5c
DO
2247 checkPIC ('1-681');
2248 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
661b3fdb
DO
2249 break;
2250 case preg_match ('/^1991\.1\.3\.45\./', $sysObjectID): // snFGSFamily
6c32c3ff 2251 case preg_match ('/^1991\.1\.3\.46\./', $sysObjectID): // snFLSFamily
ec523868 2252 case preg_match ('/^1991\.1\.3\.54\.2\.4\.1\.1$/', $sysObjectID): // FCX 648
1f54e1ba 2253 detectSoftwareType ($objectInfo, $sysDescr);
84986395 2254 $exact_release = preg_replace ('/^.*, IronWare Version ([^ ]+) .*$/', '\\1', $sysDescr);
661b3fdb
DO
2255 updateStickerForCell ($objectInfo, 5, $exact_release);
2256 # FOUNDRY-SN-AGENT-MIB::snChasSerNum.0
8228bdb4 2257 $sysChassi = $device->snmpget ('enterprises.1991.1.1.1.1.2.0');
661b3fdb
DO
2258 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2259 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
2260
2261 # Type of uplink module installed.
2262 # table: FOUNDRY-SN-AGENT-MIB::snAgentBrdMainBrdDescription
2263 # Possible part numbers are:
2264 # FGS-1XG1XGC (one fixed CX4 port)
2265 # FGS-2XGC (two fixed CX4 ports)
2266 # FGS-2XG (two XFP slots)
6c32c3ff
AA
2267 # And for FLS result (which is not handled here) would be:
2268 # 1991.1.1.2.2.1.1.2.1 = STRING: "FLS-24G 24-port Management Module"
2269 # 1991.1.1.2.2.1.1.2.3 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
2270 # 1991.1.1.2.2.1.1.2.4 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
2271 # (assuming, that the device has 2 XFP modules in slots 3 and 4).
2272
8228bdb4 2273 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.2.2.1.1.2') as $module_raw)
661b3fdb
DO
2274 if (preg_match ('/^STRING: "(FGS-1XG1XGC|FGS-2XGC) /i', $module_raw))
2275 {
2276 $iftable_processors['fgs-uplinks']['dict_key'] = '1-40'; // CX4
2277 break;
2278 }
2279
2280 # AC inputs
2281 # table: FOUNDRY-SN-AGENT-MIB::snChasPwrSupplyDescription
2282 # "Power supply 1 "
2283 # "Power supply 2 "
8228bdb4 2284 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.1.2.1.1.2') as $PSU_raw)
661b3fdb
DO
2285 {
2286 $count = 0;
2287 $PSU_cooked = trim (preg_replace ('/^string: "(.+)"$/i', '\\1', $PSU_raw, 1, $count));
2288 if ($count)
2289 {
2290 checkPIC ('1-16');
2291 commitAddPort ($objectInfo['id'], $PSU_cooked, '1-16', '', '');
2292 }
2293 }
2294 # fixed console port
2295 checkPIC ('1-681');
2296 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
661b3fdb 2297 break;
4eeadb79
DO
2298 case preg_match ('/^1916\.2\./', $sysObjectID): // Extreme Networks Summit
2299 $xos_release = preg_replace ('/^ExtremeXOS version ([[:digit:]]+)\..*$/', '\\1', $sysDescr);
2300 $xos_codes = array
2301 (
2302 '10' => 1350,
2303 '11' => 1351,
2304 '12' => 1352,
2305 );
2306 if (array_key_exists ($xos_release, $xos_codes))
2307 updateStickerForCell ($objectInfo, 4, $xos_codes[$xos_release]);
2308 checkPIC ('1-681');
2309 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232
2310 checkPIC ('1-16');
2311 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
4eeadb79 2312 break;
8acd246d 2313 case preg_match ('/^6027\.1\./', $sysObjectID): # Force10
1e5a92d8 2314 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'RS-232', ''); // RJ-45 RS-232 console
8acd246d
DO
2315 $m = array();
2316 if (preg_match ('/Force10 Application Software Version: ([\d\.]+)/', $sysDescr, $m))
6dd5c55c 2317 {
8acd246d 2318 updateStickerForCell ($objectInfo, 5, $m[1]);
241db860 2319 $ftos_release = preg_replace ('/^([678])\..+$/', '\\1', $m[1]);
6dd5c55c
DO
2320 $ftos_codes = array
2321 (
2322 '6' => 1592,
2323 '7' => 1593,
2324 '8' => 1594,
2325 );
2326 if (array_key_exists ($ftos_release, $ftos_codes))
2327 updateStickerForCell ($objectInfo, 4, $ftos_codes[$ftos_release]);
2328 }
8acd246d
DO
2329 # F10-S-SERIES-CHASSIS-MIB::chStackUnitSerialNumber.1
2330 $serialNo = $device->snmpget ('enterprises.6027.3.10.1.2.2.1.12.1');
84ea7e6e
DO
2331 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.1
2332 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.1') == 'INTEGER: 1')
2333 {
2334 checkPIC ('1-16');
2335 commitAddPort ($objectInfo['id'], 'PSU0', '1-16', 'PSU0', '');
2336 }
2337 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.2
2338 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.2') == 'INTEGER: 1')
2339 {
2340 checkPIC ('1-16');
2341 commitAddPort ($objectInfo['id'], 'PSU1', '1-16', 'PSU1', '');
2342 }
8acd246d
DO
2343 if (strlen ($serialNo))
2344 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($serialNo, strlen ('STRING: '))));
2345 break;
13b28c20 2346 case preg_match ('/^202\.20\./', $sysObjectID): // SMC TigerSwitch
1ce6a44d
AD
2347 case preg_match ('/^674\.10895\.4/', $sysObjectID): // Dell PowerConnect
2348 case preg_match ('/^674\.10895\.300(3|4|7|9)/', $sysObjectID):
e326551d 2349 case preg_match ('/^674\.10895\.301(0|4|7|9)/', $sysObjectID):
92df4b0e 2350 case preg_match ('/^674\.10895\.302(0|1)/', $sysObjectID):
8595dfd0
AD
2351 case preg_match ('/^3955\.6\.1\.2048\.1/', $sysObjectID): // Linksys
2352 // one DB-9 RS-232 and one AC port
13b28c20
DO
2353 checkPIC ('1-681');
2354 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
2355 checkPIC ('1-16');
2356 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
13b28c20 2357 break;
1b10e7cf
AD
2358 case preg_match ('/^674\.10895\.3000/', $sysObjectID):
2359 // one DB-9 RS-232, one 100Mb OOB mgmt, and one AC port
2360 checkPIC ('1-681');
2361 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
2362 checkPIC ('1-19');
2363 commitAddPort ($objectInfo['id'], 'mgmt', '1-19', '', '');
2364 checkPIC ('1-16');
2365 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2366 break;
1cd6eca3
AD
2367 case preg_match ('/^43\.1\.16\.4\.3\.29/', $sysObjectID): // 3Com
2368 $sw_version = preg_replace('/^.* Version 3Com OS ([^ ]+).*$/', '\\1', $sysDescr);
2369 updateStickerForCell ($objectInfo, 5, $sw_version);
2370
2371 // one RJ-45 RS-232 and one AC port
2372 checkPIC ('1-29');
2373 commitAddPort ($objectInfo['id'], 'console', '1-29', '', ''); // RJ-45 RS-232 console
2374 checkPIC ('1-16');
2375 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2376 break;
ac02ab69
AD
2377 case preg_match ('/^10977\.11825\.11833\.97\.25451\.12800\.100\.4\.4/', $sysObjectID): // Netgear
2378 $sw_version = preg_replace('/^.* V([^ ]+).*$/', '\\1', $sysDescr);
2379 updateStickerForCell ($objectInfo, 5, $sw_version);
2380
2381 // one AC port, no console
2382 checkPIC ('1-16');
2383 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2384 break;
7d69a266 2385 default: // Nortel...
74aee2dc
DO
2386 break;
2387 }
56a797ef 2388 $ifInfo = array();
92df4b0e 2389 foreach ($device->snmpwalkoid ($ifDescr_tablename) as $oid => $value)
56a797ef 2390 {
92df4b0e 2391 $randomindex = preg_replace ("/^.*${ifDescr_tablename}\.(.+)\$/", '\\1', $oid);
5f2354ce 2392 $value = trim (preg_replace ('/^[^:]+: (.+)$/', '\\1', $value), '"');
92df4b0e 2393 $ifInfo[$randomindex]['ifDescr'] = $value;
56a797ef 2394 }
92df4b0e 2395 foreach ($device->snmpwalkoid ('ifPhysAddress') as $oid => $value)
56a797ef 2396 {
92df4b0e 2397 $randomindex = preg_replace ("/^.*ifPhysAddress\.(.+)\$/", '\\1', $oid);
56a797ef
DO
2398 $value = trim ($value);
2399 // NET-SNMP may return MAC addresses in one of two (?) formats depending on
2400 // DISPLAY-HINT internal database. The best we can do about it is to accept both.
2401 // Bug originally reported by Walery Wysotsky against openSUSE 11.0.
6a845dce 2402 if (preg_match ('/^string: [0-9a-f]{1,2}(:[0-9a-f]{1,2}){5}/i', $value)) // STRING: x:yy:z:xx:y:zz
56a797ef
DO
2403 {
2404 list ($dummy, $value) = explode (' ', $value);
2405 $addrbytes = explode (':', $value);
2406 foreach ($addrbytes as $bidx => $bytestr)
2407 if (strlen ($bytestr) == 1)
2408 $addrbytes[$bidx] = '0' . $bytestr;
2409 }
6a845dce 2410 elseif (preg_match ('/^hex-string:( [0-9a-f]{2}){6}/i', $value)) // Hex-STRING: xx yy zz xx yy zz
56a797ef 2411 $addrbytes = explode (' ', substr ($value, -17));
6a845dce
DO
2412 elseif (preg_match ('/22[0-9a-f]{12}22$/', bin2hex ($value))) // STRING: "??????"
2413 $addrbytes = array (substr (bin2hex ($value), -14, 12));
56a797ef
DO
2414 else
2415 continue; // martian format
92df4b0e 2416 $ifInfo[$randomindex]['ifPhysAddress'] = implode ('', $addrbytes);
56a797ef
DO
2417 }
2418 // process each interface only once regardless of how many processors we have to run
2419 foreach ($ifInfo as $iface)
2420 foreach ($known_switches[$sysObjectID]['processors'] as $processor_name)
2421 {
56a797ef 2422 $newname = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['replacement'], $iface['ifDescr'], 1, $count);
1f54e1ba
DO
2423 if ($newname === NULL)
2424 {
8ab645cf 2425 showError ('PCRE pattern error, terminating');
1f54e1ba
DO
2426 break 2;
2427 }
56a797ef
DO
2428 if (!$count)
2429 continue; // try next processor on current port
2430 $newlabel = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['label'], $iface['ifDescr'], 1, $count);
bdc91a5c 2431 checkPIC ($iftable_processors[$processor_name]['dict_key']);
73a9a0a0 2432 commitAddPort ($objectInfo['id'], $newname, $iftable_processors[$processor_name]['dict_key'], $newlabel, $iface['ifPhysAddress']);
56a797ef
DO
2433 if (!$iftable_processors[$processor_name]['try_next_proc']) // done with this port
2434 continue 2;
2435 }
8536e20a 2436 // No failure up to this point, thus leave current tab for the "Ports" one.
8ab645cf 2437 return buildRedirectURL (NULL, 'ports');
74aee2dc
DO
2438}
2439
7b2a1a90 2440function doPDUSNMPmining ($objectInfo, $switch)
38e05b77 2441{
29de85b6 2442 global $known_APC_SKUs;
29de85b6
DO
2443 if (FALSE !== ($dict_key = array_search ($switch->getHWModel(), $known_APC_SKUs)))
2444 updateStickerForCell ($objectInfo, 2, $dict_key);
2445 updateStickerForCell ($objectInfo, 1, $switch->getHWSerial());
4848a7e3 2446 updateStickerForCell ($objectInfo, 3, $switch->getName());
29de85b6 2447 updateStickerForCell ($objectInfo, 5, $switch->getFWRev());
bdc91a5c 2448 checkPIC ('1-16');
29de85b6 2449 commitAddPort ($objectInfo['id'], 'input', '1-16', 'input', '');
4848a7e3
DO
2450 $portno = 1;
2451 foreach ($switch->getPorts() as $name => $port)
29de85b6
DO
2452 {
2453 $label = mb_strlen ($port[0]) ? $port[0] : $portno;
bdc91a5c 2454 checkPIC ('1-1322');
29de85b6
DO
2455 commitAddPort ($objectInfo['id'], $portno, '1-1322', $port[0], '');
2456 $portno++;
2457 }
8ab645cf
AA
2458 showSuccess ("Added ${portno} port(s)");
2459 return buildRedirectURL (NULL, 'ports');
38e05b77
DO
2460}
2461
4848a7e3 2462// APC SNMP code by Russ Garrett
38e05b77
DO
2463define('APC_STATUS_ON', 1);
2464define('APC_STATUS_OFF', 2);
2465define('APC_STATUS_REBOOT', 3);
2466
db5d7da5
AD
2467class RTSNMPDevice
2468{
2469 protected $snmp;
2470
2471 function __construct($hostname, $snmpsetup)
2472 {
2473 switch($snmpsetup['version']) {
2474 case 1:
2475 default:
2476 $this->snmp = new RTSNMPv1($hostname, $snmpsetup);
2477 break;
2478 case 2:
2479 $this->snmp = new RTSNMPv2($hostname, $snmpsetup);
2480 break;
2481 case 3:
2482 $this->snmp = new RTSNMPv3($hostname, $snmpsetup);
2483 break;
2484 }
8228bdb4 2485 }
38e05b77 2486
db5d7da5
AD
2487 function getName()
2488 {
2489 return $this->getString('sysName.0');
2490 }
92cfa92a 2491
db5d7da5
AD
2492 function getDescription()
2493 {
2494 return $this->getString('sysDescr.0');
2495 }
92cfa92a 2496
db5d7da5
AD
2497 function snmpget($oid)
2498 {
2499 return $this->snmp->snmpget($oid);
2500 }
92cfa92a 2501
db5d7da5
AD
2502 function snmpwalkoid($oid)
2503 {
2504 return $this->snmp->snmpwalkoid($oid);
2505 }
2506
2507 protected function snmpSet($oid, $type, $value)
2508 {
2509 return $this->snmp->snmpset($oid, $type, $value);
2510 }
2511
2512 protected function getString($oid)
2513 {
2514 return trim(str_replace('STRING: ', '', $this->snmp->snmpget($oid)), '"');
2515 }
8228bdb4
DO
2516}
2517
db5d7da5
AD
2518abstract class RTSNMP
2519{
2520 protected $hostname;
2521 protected $snmpsetup;
2522
2523 function __construct($hostname, $snmpsetup)
2524 {
2525 $this->hostname = $hostname;
2526 $this->snmpsetup = $snmpsetup;
2527 }
92cfa92a 2528
db5d7da5
AD
2529 abstract function snmpget($oid);
2530 abstract function snmpset($oid, $type, $value);
2531 abstract function snmpwalkoid($oid);
8228bdb4
DO
2532}
2533
db5d7da5
AD
2534class RTSNMPv1 extends RTSNMP
2535{
2536 function snmpget($oid)
2537 {
2538 return snmpget($this->hostname, $this->snmpsetup['community'], $oid);
2539 }
2540
2541 function snmpset($oid, $type, $value)
2542 {
2543 return snmpset($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
2544 }
92cfa92a 2545
db5d7da5
AD
2546 function snmpwalkoid($oid)
2547 {
2548 return snmpwalkoid($this->hostname, $this->snmpsetup['community'], $oid);
2549 }
8228bdb4
DO
2550}
2551
db5d7da5
AD
2552class RTSNMPv2 extends RTSNMP
2553{
2554 function snmpget($oid)
2555 {
2556 return snmp2_get($this->hostname, $this->snmpsetup['community'], $oid);
2557 }
2558
2559 function snmpset($oid, $type, $value)
2560 {
2561 return snmp2_set($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
2562 }
92cfa92a 2563
db5d7da5
AD
2564 function snmpwalkoid($oid)
2565 {
2566 return snmp2_real_walk($this->hostname, $this->snmpsetup['community'], $oid);
2567 }
047d6ee5
DO
2568}
2569
db5d7da5
AD
2570class RTSNMPv3 extends RTSNMP
2571{
2572 function snmpget($oid)
2573 {
2574 return snmp3_get($this->hostname, $this->snmpsetup['sec_name'], $this->snmpsetup['sec_level'], $this->snmpsetup['auth_protocol'], $this->snmpsetup['auth_passphrase'], $this->snmpsetup['priv_protocol'], $this->snmpsetup['priv_passphrase'], $oid);
2575 }
2576
2577 function snmpset($oid, $type, $value)
2578 {
2579 return snmp3_set($this->hostname, $this->snmpsetup['sec_name'], $this->snmpsetup['sec_level'], $this->snmpsetup['auth_protocol'], $this->snmpsetup['auth_passphrase'], $this->snmpsetup['priv_protocol'], $this->snmpsetup['priv_passphrase'], $oid, $type, $value);
2580 }
92cfa92a 2581
db5d7da5
AD
2582 function snmpwalkoid($oid)
2583 {
2584 return snmp3_real_walk($this->hostname, $this->snmpsetup['sec_name'], $this->snmpsetup['sec_level'], $this->snmpsetup['auth_protocol'], $this->snmpsetup['auth_passphrase'], $this->snmpsetup['priv_protocol'], $this->snmpsetup['priv_passphrase'], $oid);
2585 }
38e05b77
DO
2586}
2587
db5d7da5
AD
2588class APCPowerSwitch extends RTSNMPDevice
2589{
2590 protected $snmpMib = 'SNMPv2-SMI::enterprises.318';
2591
2592 function getPorts()
2593 {
92cfa92a
AD
2594 $data = $this->snmpwalkoid("{$this->snmpMib}.1.1.12.3.3.1.1.2");
2595 $status = $this->snmpwalkoid("{$this->snmpMib}.1.1.12.3.3.1.1.4");
db5d7da5
AD
2596 $out = array();
2597 foreach ($data as $id => $d)
3e847fc8 2598 $out[] = array(trim(str_replace('STRING: ', '', $d), '"'), str_replace('INTEGER: ', '', $status[$id]));
db5d7da5
AD
2599 return $out;
2600 }
92cfa92a 2601
db5d7da5
AD
2602 function getPortStatus($id)
2603 {
2604 return trim($this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id"), 'INTEGER: ');
2605 }
2606
2607 function getPortName($id)
2608 {
2609 return trim(str_replace('STRING: ', '', $this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.2.$id")), '"');
2610 }
2611
2612 function setPortName($id, $name)
2613 {
2614 return $this->snmpset("{$this->snmpMib}.1.1.4.5.2.1.3.$id", 's', $name);
2615 }
2616
2617 function portOff($id)
2618 {
2619 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_OFF);
2620 }
2621
2622 function portOn($id)
2623 {
2624 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_ON);
2625 }
2626
2627 function portReboot($id)
2628 {
2629 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_REBOOT);
2630 }
2631
30ad8bc4
DO
2632 // rPDUIdentFirmwareRev.0 == .1.3.6.1.4.1.318.1.1.12.1.3.0 = STRING: "vN.N.N"
2633 function getFWRev()
2634 {
8228bdb4 2635 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.3.0"));
30ad8bc4 2636 }
db5d7da5 2637
30ad8bc4
DO
2638 // rPDUIdentSerialNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.6.0 = STRING: "XXXXXXXXXXX"
2639 function getHWSerial()
2640 {
8228bdb4 2641 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.6.0"));
30ad8bc4 2642 }
db5d7da5 2643
30ad8bc4
DO
2644 // rPDUIdentModelNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.5.0 = STRING: "APnnnn"
2645 function getHWModel()
2646 {
8228bdb4 2647 return preg_replace ('/^STRING: "(.*)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.5.0"));
30ad8bc4 2648 }
38e05b77 2649}
367fcba0 2650
2d511052
DO
2651// Take address in the form XX:XX:XX:XX:XX:XX and return the next
2652// address in the same form.
2653function nextMACAddress ($addr)
2654{
cc000fab
DO
2655 if ($addr == '')
2656 return '';
2d511052
DO
2657 $bytes = array();
2658 foreach (explode (':', $addr) as $hex)
2659 $bytes[] = hexdec ($hex);
2660 for ($i = 5; $i >= 0; $i--)
2661 {
2662 $bytes[$i] += 1;
2663 if ($bytes[$i] <= 255) // FF
2664 break; // no roll over
2665 $bytes[$i] = 0;
2666 }
2667 foreach (array_keys ($bytes) as $key)
2668 $bytes[$key] = sprintf ('%02X', $bytes[$key]);
2669 return implode (':', $bytes);
2670}
2671
2672function generatePortsForCatModule ($object_id, $slotno = 1, $mtype = 'X6748', $mac_address = '')
2673{
2674 global $dbxlink;
2675 $mac_address = l2addressFromDatabase (l2addressForDatabase ($mac_address));
2676 switch ($mtype)
2677 {
cc000fab 2678 case 'WS-X6748-GE-TX':
2d511052
DO
2679 $dbxlink->beginTransaction();
2680 for ($i = 1; $i <= 48; $i++)
2681 {
73a9a0a0 2682 commitAddPort ($object_id, "gi${slotno}/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
cc000fab 2683 $mac_address = nextMACAddress ($mac_address);
2d511052
DO
2684 }
2685 $dbxlink->commit();
2686 break;
cc000fab
DO
2687 case 'WS-X6708-10GE':
2688 for ($i = 1; $i <= 8; $i++)
2689 {
2690 commitAddPort ($object_id, "te${slotno}/${i}", '6-1080', "slot ${slotno} port ${i}", $mac_address);
2691 $mac_address = nextMACAddress ($mac_address);
2692 }
2693 break;
8fe2d6f0
DO
2694 case 'WS-X6704-10GE':
2695 for ($i = 1; $i <= 4; $i++)
2696 {
2697 commitAddPort ($object_id, "te${slotno}/${i}", '5-1079', "slot ${slotno} port ${i}", $mac_address);
2698 $mac_address = nextMACAddress ($mac_address);
2699 }
2700 break;
cc000fab
DO
2701 case 'VS-S720-10G':
2702 commitAddPort ($object_id, "gi${slotno}/1", '4-1077', "slot ${slotno} port 1", $mac_address);
2703 $mac_address = nextMACAddress ($mac_address);
2704 commitAddPort ($object_id, "gi${slotno}/2", '4-1077', "slot ${slotno} port 2", $mac_address);
2705 $mac_address = nextMACAddress ($mac_address);
2706 commitAddPort ($object_id, "gi${slotno}/3", '1-24', "slot ${slotno} port 3", $mac_address);
2707 $mac_address = nextMACAddress ($mac_address);
2708 commitAddPort ($object_id, "te${slotno}/4", '6-1080', "slot ${slotno} port 4", $mac_address);
2709 $mac_address = nextMACAddress ($mac_address);
2710 commitAddPort ($object_id, "te${slotno}/5", '6-1080', "slot ${slotno} port 5", $mac_address);
2711 break;
3e34adae
DO
2712 case '3750G-24TS':
2713 // MAC address of 1st port is the next one after switch's address
cc000fab 2714 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
2715 for ($i = 1; $i <= 24; $i++)
2716 {
2717 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
cc000fab 2718 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
2719 }
2720 for ($i = 25; $i <= 28; $i++)
2721 {
2722 commitAddPort ($object_id, "gi${slotno}/0/${i}", '4-1077', "unit ${slotno} port ${i}", $mac_address);
abd1e9ac
DO
2723 $mac_address = nextMACAddress ($mac_address);
2724 }
2725 break;
2726 case '3750G-24T':
2727 $mac_address = nextMACAddress ($mac_address);
2728 for ($i = 1; $i <= 24; $i++)
2729 {
2730 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
cc000fab 2731 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
2732 }
2733 break;
d423bb7d
DO
2734 case '3750G-16TD':
2735 $mac_address = nextMACAddress ($mac_address);
2736 for ($i = 1; $i <= 16; $i++)
2737 {
2738 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
2739 $mac_address = nextMACAddress ($mac_address);
2740 }
2741 commitAddPort ($object_id, "te${slotno}/0/1", '5-1079', "unit ${slotno} port ${i}", $mac_address);
2742 break;
c5553818
DO
2743 case 'LE02G48TA':
2744 for ($i = 0; $i <= 47; $i++)
2745 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
2746 break;
2747 case 'LE02X12SA':
2748 for ($i = 0; $i <= 11; $i++)
2749 commitAddPort ($object_id, "gi${slotno}/0/${i}", '9-1084', "slot ${slotno} port ${i}", $mac_address);
2750 break;
2d511052
DO
2751 }
2752}
2753
1f54e1ba
DO
2754function detectSoftwareType ($objectInfo, $sysDescr)
2755{
2756 global $swtype_pcre;
2757 foreach ($swtype_pcre as $pattern => $dict_key)
2758 if (preg_match ($pattern, $sysDescr))
2759 {
2760 updateStickerForCell ($objectInfo, 4, $dict_key);
2761 return;
2762 }
2763}
2ffd5a2a 2764?>