diff options
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") { |