Commit 4975f43a authored by Kirk Webb's avatar Kirk Webb
Browse files

Some hackery to allow us to use switchmac on the Dell PC5548

For use with the Apt control net switches.  Note that this does NOT imply
full support for the PowerConnect 5548.
parent 77d3057f
...@@ -274,17 +274,17 @@ sub readifIndex($) { ...@@ -274,17 +274,17 @@ sub readifIndex($) {
foreach my $result (@{$rows}) { foreach my $result (@{$rows}) {
my ($name,$iid,$descr) = @{$result}; my ($name,$iid,$descr) = @{$result};
$self->debug("got $name, $iid, descr $descr ",2); $self->debug("got $name, $iid, descr $descr\n",2);
if ($name ne "ifDescr") { if ($name ne "ifDescr") {
warn "$id: WARNING: Foreign snmp var returned: $name"; warn "$id: WARNING: Foreign snmp var returned: $name";
return 0; return 0;
} }
# will match "GigabitEthernet 9/47" but not "Vlan 123" # will match "GigabitEthernet 9/47" but not "Vlan 123"
if ($descr =~ /(\w*)\s+(\d+)\/(\d+)$/) { if ($descr =~ /(\w*)\s*(\d+)\/(\d+)\/?(\d+)?$/) {
my $type = $1; my $type = $1;
my $module = $2; my $module = $2;
my $port = $3; my $port = defined($4) ? $4 : $3;
# Note: Force10 modules and ports start at 0 instead of 1. # Note: Force10 modules and ports start at 0 instead of 1.
my $modport = "${module}.${port}"; my $modport = "${module}.${port}";
my $ifIndex = $iid; my $ifIndex = $iid;
......
...@@ -54,6 +54,7 @@ use snmpit_cisco; ...@@ -54,6 +54,7 @@ use snmpit_cisco;
use snmpit_foundry; use snmpit_foundry;
use snmpit_nortel; use snmpit_nortel;
use snmpit_hp; use snmpit_hp;
use snmpit_force10;
my $MASTER_COMMUNITY = "@SNMP_RW_COMMUNITY@"; my $MASTER_COMMUNITY = "@SNMP_RW_COMMUNITY@";
my $ELABINELAB = @ELABINELAB@; my $ELABINELAB = @ELABINELAB@;
...@@ -214,6 +215,8 @@ SWITCH: ...@@ -214,6 +215,8 @@ SWITCH:
$switchtype = "hp"; last;}; $switchtype = "hp"; last;};
(/^foundry/) && do { $snmpversion = "1"; $useindexing = 0; (/^foundry/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "foundry"; last;}; $switchtype = "foundry"; last;};
(/^force10/) && do { $snmpversion = "2c"; $useindexing = 0;
$switchtype = "force10"; last;};
warn "WARNING: Switch type $type is not supported for $switch!\n"; warn "WARNING: Switch type $type is not supported for $switch!\n";
next SWITCHLOOP; next SWITCHLOOP;
...@@ -262,6 +265,9 @@ SWITCH: ...@@ -262,6 +265,9 @@ SWITCH:
if ($switchtype eq "hp") { if ($switchtype eq "hp") {
$device = new snmpit_hp($switch,$debug,$community); $device = new snmpit_hp($switch,$debug,$community);
} }
if ($switchtype eq "force10") {
$device = new snmpit_force10($switch,$debug,$community);
}
} }
# #
...@@ -423,7 +429,8 @@ SWITCH: ...@@ -423,7 +429,8 @@ SWITCH:
# #
my $modport; my $modport;
if (($switchtype eq "cisco") || ($switchtype eq "foundry") || if (($switchtype eq "cisco") || ($switchtype eq "foundry") ||
($switchtype eq "hp") || ($switchtype eq "nortel")) { ($switchtype eq "hp") || ($switchtype eq "nortel") ||
($switchtype eq "force10")) {
($modport) = $device->convertPortFormat(2, $ifIndex); ($modport) = $device->convertPortFormat(2, $ifIndex);
} else { } else {
$modport = "1.$ifIndex"; $modport = "1.$ifIndex";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment