From 79d9099cf563c276f67b07ca2e62fc51f40288be Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Tue, 22 Mar 2016 17:48:19 +0100 Subject: NMS: Expose trunks (ae*) fully publicly Thanks to mrglass and sjurtf. --- web/nms.gathering.org/api/public/switch-state | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'web/nms.gathering.org/api') diff --git a/web/nms.gathering.org/api/public/switch-state b/web/nms.gathering.org/api/public/switch-state index 4907449..7fa6ff5 100755 --- a/web/nms.gathering.org/api/public/switch-state +++ b/web/nms.gathering.org/api/public/switch-state @@ -19,7 +19,11 @@ while ( my $ref = $q->fetchrow_hashref() ) { for my $porti (keys %{$data{'ports'}}) { my %port = %{$data{'ports'}{$porti}}; my $smallport = $porti; - $smallport =~ s/[0-9-].*$//; + if (not $smallport =~ m/^ae/) { + $smallport =~ s/[0-9-].*$//; + } else { + $json{'switches'}{$sysname}{ifs}{$smallport}{'ifAlias'} = $port{'ifAlias'}; + } if ($porti =~ /ge-0\/0\/4[4-7]$/) { $json{'switches'}{$sysname}{'uplinks'}{'ifHCInOctets'} += $port{'ifHCInOctets'}; $json{'switches'}{$sysname}{'uplinks'}{'ifHCOutOctets'} += $port{'ifHCOutOctets'}; -- cgit v1.2.3