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