Commit a59466cf authored by Robert Ricci's avatar Robert Ricci
Browse files

To snmpit_cisco, add recognition that IOS switches don't support

setting port speed and duplex. Well, they probably do, in some MIB,
but not in the one we use on CatOS, and these features aren't actually
very important right now.

Also, make snmpit itself handle unsupported port operations.
parent 6eacae5e
......@@ -756,12 +756,20 @@ sub doVlansFromTables($@) {
# If either is not set, we do nothing. We could make
# a 0 mean 'auto'
#
# For now, we ignore it if the switch doesn't support the commands.
if ($speed) {
my $cmd = $speed . "mbit";
$errors += $stack->portControl($cmd, $port);
my $rv = $stack->portControl($cmd, $port);
if ($rv > 0) {
$errors += $rv;
}
}
if ($duplex) {
$errors += $stack->portControl($duplex, $port);
my $rv = $stack->portControl($duplex, $port);
if ($rv > 0) {
$errors += $rv;
}
}
}
}
......
......@@ -172,6 +172,23 @@ sub portControl ($$@) {
$self->debug("portControl: $cmd -> (@ports)\n");
$self->debug("portControl: Checking supported for $cmd on " .
"$self->{OSTYPE}\n");
#
# Check right up front for unsupported operations
#
if ($self->{OSTYPE} eq "IOS" && ($cmd !~ /(en|dis)able/)) {
#
# XXX - Do we silently exit, in which case the caller doesn't know
# we failed, or do we exit with an error, in which case the caller has
# to know what we support before calling us? We'll go with the latter
# for now.
#
$self->debug("portControl: unsupported\n");
return -1;
}
#
# Find the command in the %cmdOIDs hash (defined at the top of this file)
#
......
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