aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xweb/nms.gathering.org/api/public/switch-state6
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'};