Commit 0e672400 authored by Kirk Webb's avatar Kirk Webb

Add custom module offset hack for snmpit_h3c (Comware) module

The hard-coded per-model offsets aren't always correct.  Need to deal
with this in a different way, but this is a quick hack to move things along
with the Utah stitcher aggregate.
parent f0ecfc3d
......@@ -167,6 +167,15 @@ sub new($$$;$) {
$self->{DOJUMBO} = 0;
}
# module offset hack?
if (exists($options->{'module_offset'})
&& int($options->{'module_offset'}) > 0) {
$self->{MODULE_OFFSET} = $options->{'module_offset'};
print "$self->{NAME}: Using custom module offset: ".
"$self->{MODULE_OFFSET}\n"
if $self->{DEBUG};
}
#
# set up hashes for internal use
#
......@@ -1786,8 +1795,15 @@ my %blade_sizes = (
sub calcModPort($$) {
my ($self, $ifindex) = @_;
my ($j, $port, $mod);
my $bladesize = $blade_sizes{$self->{HPTYPE}};
my ($j, $port, $mod, $bladesize);
# Check to see if a module offset option was passed in during
# initialization (this is a hack...).
if (exists($self->{MODULE_OFFSET}) && $self->{MODULE_OFFSET}) {
$bladesize = $self->{MODULE_OFFSET};
} else {
$bladesize = $blade_sizes{$self->{HPTYPE}};
}
if (defined($bladesize)) {
$j = $ifindex - 1;
$port = 1 + ($j % $bladesize);
......
Markdown is supported
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