From f069a0ca39ad2aaef0bc32e8ccd0d0879bae980a Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 24 Mar 2015 21:22:58 +0000 Subject: [PATCH] [#202] Detect failed OUI and MIB downloads --- Netdisco/Changes | 1 + Netdisco/bin/netdisco-deploy | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index a53d4e45..f3036e80 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -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] diff --git a/Netdisco/bin/netdisco-deploy b/Netdisco/bin/netdisco-deploy index bb0f5a7c..95af76d1 100755 --- a/Netdisco/bin/netdisco-deploy +++ b/Netdisco/bin/netdisco-deploy @@ -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'; }