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