sub translate_ifindex() { my $ports_ini_dir = "/home/portal/bin/conf/snmp_set"; my $slot; my $port; for ($t = 0; $t < @ifindex; $t++) { #print "IFINDEX: $ifindex[$t]\n"; if ($ifindex[$t] >= 204 && $ifindex[$t] <= 381) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot02.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 22 && $ifindex[$t] <= 199) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot04.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 513 && $ifindex[$t] <= 690) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot06.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 823 && $ifindex[$t] <= 1000) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot08.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 1067 && $ifindex[$t] <= 1244) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot10.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 1311 && $ifindex[$t] <= 1488) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot12.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 1555 && $ifindex[$t] <= 1732) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot14.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 1799 && $ifindex[$t] <= 1976) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot16.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 2043 && $ifindex[$t] <= 2220) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot18.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } if ($ifindex[$t] >= 2287 && $ifindex[$t] <= 2464) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_slot20.txt" ); $slot = $cfg->val("$ifindex[$t]", "slot"); $port = $cfg->val("$ifindex[$t]", "port"); push @msan_slot, $slot; push @msan_port, $port; } } }