From f8a1d5bc7a65629da38625b48a12b44b06aed798 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 17 Mar 2018 15:35:55 +0000 Subject: [PATCH] set fallback for nonmatching interfaces --- lib/SNMP/Info/Layer2/Ubiquiti.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/SNMP/Info/Layer2/Ubiquiti.pm b/lib/SNMP/Info/Layer2/Ubiquiti.pm index 08ec4fd0..c3b2457b 100644 --- a/lib/SNMP/Info/Layer2/Ubiquiti.pm +++ b/lib/SNMP/Info/Layer2/Ubiquiti.pm @@ -219,11 +219,15 @@ sub interfaces { # Slot: 0 Port: 4 Gigabit - Level if ($i_descr->{$iid} =~ m/([0-9]+)[^0-9]+([0-9]+)/) { $return->{$iid} = $1 .'/'. $2; + next; } # Link Aggregate 4 if ($i_descr->{$iid} =~ m/Link Aggregate (\d+)/) { $return->{$iid} = '3/'. $1; + next; } + # else + $return->{$iid} = $i_descr->{$iid}; } return $return;