[#202] Detect failed OUI and MIB downloads

This commit is contained in:
Oliver Gorwits
2015-03-24 21:22:58 +00:00
parent eb8c2f056a
commit f069a0ca39
2 changed files with 10 additions and 4 deletions

View File

@@ -13,6 +13,7 @@
* Be more strict about Node Search matching ports/wifi within date range
* Allow filtering out of Device Ports on Node (MAC) search
* Display Voice VLAN on Cisco devices
* [#202] Detect failed OUI and MIB downloads
[BUG FIXES]

View File

@@ -195,7 +195,7 @@ sub deploy_oui {
@lines = split /\n/, $resp->{content};
}
if (scalar @lines) {
if (scalar @lines > 50) {
foreach my $line (@lines) {
if ($line =~ m/^\s*(.{2}-.{2}-.{2})\s+\(hex\)\s+(.*)\s*$/i) {
my ($oui, $company) = ($1, $2);
@@ -225,7 +225,7 @@ sub deploy_oui {
}
else {
print color 'bold red';
say 'OUI update failed.';
say 'OUI update failed!';
}
print color 'reset';
@@ -276,10 +276,15 @@ sub deploy_mibs {
my $ae = Archive::Extract->new(archive => $file, type => 'tgz');
$ae->extract(to => $mibhome->parent->stringify);
unlink $file;
print color 'bold blue';
say 'MIBs update complete.';
}
else {
print color 'bold red';
say 'MIB download failed!';
}
print color 'bold blue';
say 'MIBs update complete.';
print color 'reset';
}