From 447bb32f331432dd0b9401f24c8a81a421088614 Mon Sep 17 00:00:00 2001 From: Max Kosmach Date: Tue, 23 Feb 2016 10:58:01 +0300 Subject: [PATCH] Fix regexp for HP switches --- Netdisco/lib/App/Netdisco/Core/Discover.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Core/Discover.pm b/Netdisco/lib/App/Netdisco/Core/Discover.pm index 5ebe141d..ca9646be 100644 --- a/Netdisco/lib/App/Netdisco/Core/Discover.pm +++ b/Netdisco/lib/App/Netdisco/Core/Discover.pm @@ -760,9 +760,8 @@ sub store_neighbors { # on default vlan for HP switches remote_ip looks like # "myswitchname(012345-012345)" if (!defined $neigh) { - (my $tmpid = $remote_id) =~ s/.([0-9a-f]{6})-([0-9a-f]{6})./$1$2/; + (my $tmpid = $remote_id) =~ s/.*\(([0-9a-f]{6})-([0-9a-f]{6})\).*/$1$2/; my $mac = NetAddr::MAC->new(mac => $tmpid); - if ($mac and not $mac->errstr) { info sprintf '[%s] neigh - found neighbor %s by MAC %s',