Make sure MIB leaf is actually in the MIB we're loading, not the imports

Capture the numeric OS version
Add Layer3::Cumulus test class
This commit is contained in:
Eric A. Miller
2018-04-11 20:43:54 -04:00
parent 87a287e0c9
commit 2e18464635
2 changed files with 97 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ $VERSION = '3.54';
%SNMP::Info::LLDP::MIBS,
%SNMP::Info::IEEE802dot3ad::MIBS,
'UCD-SNMP-MIB' => 'versionTag',
'NET-SNMP-TC' => 'netSnmpAgentOIDs',
'NET-SNMP-TC' => 'netSnmpAliasDomain',
'HOST-RESOURCES-MIB' => 'hrSystem',
);
@@ -86,7 +86,7 @@ sub os_ver {
my $descr = $netsnmp->description();
# STRING: "Cumulus Linux version 3.5.1 running on innotek GmbH VirtualBox"
return $1 if ( $descr =~ /^Cumulus Linux (\S+)\s+/ );
return $1 if ( $descr =~ /^Cumulus Linux.+(\d+\.\d+\.\d+)\s/ );
return;
}