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