Commit 2907d2c0 authored by Mike Hibler's avatar Mike Hibler
Browse files

snmpit: snmpit_cisco returns " ", not null, when it cannot get speed/duplex

so -B now ignores that rather than warning.

snmpit_cisco: hack to get around 2950 switch returning just <port>
rather than <module>.<port> in interface info tables.

Note: snmpit_cisco does not successfully return speed/duplex info for -b,
this may cause problems with whack-on-lan and needs to be fixed!
parent f06ce414
...@@ -997,7 +997,7 @@ sub doRestorePortStatus($@) { ...@@ -997,7 +997,7 @@ sub doRestorePortStatus($@) {
# Set the speed and duplex on the port if given # Set the speed and duplex on the port if given
# #
my $speed = $params{speed}; my $speed = $params{speed};
if ($speed) { if ($speed && $speed ne " ") {
if ($speed eq "autoDetect") { if ($speed eq "autoDetect") {
$errors = $stack->portControl("auto",$port); $errors = $stack->portControl("auto",$port);
} else { } else {
...@@ -1013,7 +1013,7 @@ sub doRestorePortStatus($@) { ...@@ -1013,7 +1013,7 @@ sub doRestorePortStatus($@) {
} }
} }
my $duplex = $params{duplex}; my $duplex = $params{duplex};
if ($duplex) { if ($duplex && $duplex ne " ") {
if ($duplex eq "half") { if ($duplex eq "half") {
$errors = $stack->portControl("half",$port); $errors = $stack->portControl("half",$port);
} elsif ($duplex eq "full") { } elsif ($duplex eq "full") {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-LGPL # EMULAB-LGPL
# Copyright (c) 2000-2004 University of Utah and the Flux Group. # Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -1223,8 +1223,13 @@ sub listPorts($) { ...@@ -1223,8 +1223,13 @@ sub listPorts($) {
@data = @{$ifTable}; @data = @{$ifTable};
} }
if (! defined $self->{IFINDEX}{$data[1]}) { next; } if (! defined $self->{IFINDEX}{$data[1]}) { next; }
my $port = portnum("$self->{NAME}:$data[1]") my $port;
|| portnum("$self->{NAME}:".$self->{IFINDEX}{$data[1]}); if ($data[1] =~ /\d+\.\d+/) {
$port = portnum("$self->{NAME}:$data[1]")
|| portnum("$self->{NAME}:".$self->{IFINDEX}{$data[1]});
} else {
$port = portnum("$self->{NAME}:".$self->{IFINDEX}{$data[1]});
}
if (! defined $port) { next; } if (! defined $port) { next; }
$self->debug("$port\t$data[0]\t$data[2]\n",2); $self->debug("$port\t$data[0]\t$data[2]\n",2);
if ($data[0]=~/AdminStatus/) {$Able{$port}=($data[2]=~/up/?"yes":"no");} if ($data[0]=~/AdminStatus/) {$Able{$port}=($data[2]=~/up/?"yes":"no");}
...@@ -1565,8 +1570,8 @@ sub readifIndex($) { ...@@ -1565,8 +1570,8 @@ sub readifIndex($) {
# #
if (($module == 0) && ($type =~ /^gi/i)) { if (($module == 0) && ($type =~ /^gi/i)) {
$module = 1; $module = 1;
$self->debug("NON_MODULAR_HACK: Moving $descr to mod $self->debug("NON_MODULAR_HACK: ".
$module"); "Moving $descr to mod $module\n");
} }
} }
my $modport = "$module.$port"; my $modport = "$module.$port";
......
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