You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Cisco Small Business Sx200-300-500 switch lines return the port description in ifAlias and the current CiscoSB class not using at all.
SNMP::Info::Layer2::CiscoSB should return ifAlias if it exists in the switch, instead of ifDescription.
Current Behavior
same ifName and ifDescr returned
Possible Solution
add the following to SNMP/Info/Layer2/CiscoSB.pm:
--- CiscoSB.pm-orig 2023-10-02 13:39:04.695835044 +0200
+++ CiscoSB.pm-patch 2023-10-02 13:42:19.385422657 +0200
@@ -41,6 +41,8 @@
use SNMP::Info::CiscoStats;
use SNMP::Info::CiscoConfig;
use SNMP::Info::CDP;
+use SNMP::Info::Layer3;
+
@SNMP::Info::Layer2::CiscoSB::ISA
= qw/SNMP::Info::Layer2 SNMP::Info::EtherLike
@@ -72,6 +74,7 @@
%MIBS = (
%SNMP::Info::Layer2::MIBS,
+ %SNMP::Info::Layer3::MIBS,
%SNMP::Info::EtherLike::MIBS,
%SNMP::Info::CiscoStats::MIBS,
%SNMP::Info::CiscoConfig::MIBS,
@@ -167,6 +170,27 @@
return $interfaces;
}
+sub i_description {
+ my $ciscosb = shift;
+ my $partial = shift;
+ my $i_desc = $ciscosb->orig_i_description($partial);
+ my $i_name = $ciscosb->i_alias($partial) || {};
+ my $i_index = $ciscosb->i_index($partial);
+
+ my %if;
+
+ foreach my $iid ( keys %$i_index ) {
+ my $index = $i_index->{$iid};
+ my $pname = $i_name->{$iid};
+ my $name = $i_desc->{$iid};
+ next unless defined $index;
+ $if{$iid} = defined($pname) && length $pname ? $pname : $name;
+ }
+
+ return \%if;
+}
+
Your Environment
SNMP::Info version used: 3.92
Netdisco version (if used): 2.60.5
The text was updated successfully, but these errors were encountered:
Hi @redaxhu many thanks for this! Can you let me know why Layer3::MIBS is needed?
It seems a bit odd for the Layer2::CiscoSB class to import that, and I wonder if it's a specific MIB we can just import that instead.
(personally I do believe the whole Layer2/Layer3 business is not helpful but we have it in the design)
Expected Behavior
The Cisco Small Business Sx200-300-500 switch lines return the port description in ifAlias and the current CiscoSB class not using at all.
SNMP::Info::Layer2::CiscoSB should return ifAlias if it exists in the switch, instead of ifDescription.
Current Behavior
same ifName and ifDescr returned
Possible Solution
add the following to SNMP/Info/Layer2/CiscoSB.pm:
Your Environment
The text was updated successfully, but these errors were encountered: