diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 19:53:30 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 19:53:30 +0100 |
commit | 05fedaa7461c6fd67c402671f0e129b3d1772fbf (patch) | |
tree | a973895e01934566f57ccbd1ec46380950bbf8d6 /web/nms-public.gathering.org/api/public/switch-state | |
parent | 79d9099cf563c276f67b07ca2e62fc51f40288be (diff) |
NMS: Tweak NMS public API and draw linknets
Diffstat (limited to 'web/nms-public.gathering.org/api/public/switch-state')
-rwxr-xr-x | web/nms-public.gathering.org/api/public/switch-state | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/nms-public.gathering.org/api/public/switch-state b/web/nms-public.gathering.org/api/public/switch-state index 6f7573c..7fa6ff5 100755 --- a/web/nms-public.gathering.org/api/public/switch-state +++ b/web/nms-public.gathering.org/api/public/switch-state @@ -19,8 +19,12 @@ 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 ($porti =~ /ge-0\/0\/4[4-7]/) { + 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'}; if ($port{'ifOperStatus'} eq "up") { |