diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 17:48:19 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 17:48:19 +0100 |
commit | 79d9099cf563c276f67b07ca2e62fc51f40288be (patch) | |
tree | 146061eab74cd38ad240e272a2d5094800feae54 | |
parent | 1ed577bcb4b6650e89659485e69e6ffc29bcf7fd (diff) |
NMS: Expose trunks (ae*) fully publicly
Thanks to mrglass and sjurtf.
-rwxr-xr-x | web/nms.gathering.org/api/public/switch-state | 6 |
1 files changed, 5 insertions, 1 deletions
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'}; |