aboutsummaryrefslogtreecommitdiffstats
path: root/web/api
diff options
context:
space:
mode:
authorSjur Fredriksen <sjurtf@ifi.uio.no>2023-01-30 22:02:57 +0100
committerSjur Fredriksen <sjurtf@ifi.uio.no>2023-01-30 22:02:57 +0100
commit039c05406a8cc29ab4867ffdef1b51890ef694dc (patch)
tree9387433c50f208572851771fcd1565e694ae975a /web/api
parentdcf832a28b042687f1d0c742c0804c8eeb747df5 (diff)
tg23 init
Diffstat (limited to 'web/api')
-rwxr-xr-xweb/api/public/switch-state8
1 files changed, 4 insertions, 4 deletions
diff --git a/web/api/public/switch-state b/web/api/public/switch-state
index da108a5..d192504 100755
--- a/web/api/public/switch-state
+++ b/web/api/public/switch-state
@@ -38,7 +38,7 @@ while ( my $ref = $q->fetchrow_hashref() ) {
if ($porti =~ m/\.0$/) {
next;
}
- if ($data{'ports'}{$porti}{'ifAlias'} =~ m/client/i) {
+ if ($data{'ports'}{$porti}{'ifAlias'} =~ m/C:/i) {
$smallport =~ s/[0-9-].*$//;
} else {
$json{'switches'}{$sysname}{ifs}{$smallport}{'ifAlias'} = $port{'ifAlias'};
@@ -55,7 +55,7 @@ while ( my $ref = $q->fetchrow_hashref() ) {
}
}
if ($data{'ports'}{$porti}{'ifType'} ne "propVirtual" and
- $data{'ports'}{$porti}{'ifAlias'} =~ m/Clients/i) {
+ $data{'ports'}{$porti}{'ifAlias'} =~ m/C:/i) {
if ($port{'ifAdminStatus'} eq "up") {
$json{'switches'}{$sysname}{'clients'}{'ifHCInOctets'} += $port{'ifHCInOctets'};
$json{'switches'}{$sysname}{'clients'}{'ifHCOutOctets'} += $port{'ifHCOutOctets'};
@@ -107,7 +107,7 @@ while ( my $ref = $q2->fetchrow_hashref() ) {
if ($porti =~ m/\.0$/) {
next;
}
- if ($data{'ports'}{$porti}{'ifAlias'} =~ m/client/i) {
+ if ($data{'ports'}{$porti}{'ifAlias'} =~ m/C:/i) {
$smallport =~ s/[0-9-].*$//;
} else {
$json{'then'}{$sysname}{ifs}{$smallport}{'ifAlias'} = $port{'ifAlias'};
@@ -124,7 +124,7 @@ while ( my $ref = $q2->fetchrow_hashref() ) {
}
}
if ($data{'ports'}{$porti}{'ifType'} ne "propVirtual" and
- $data{'ports'}{$porti}{'ifAlias'} =~ m/Clients/i) {
+ $data{'ports'}{$porti}{'ifAlias'} =~ m/C:/i) {
if ($port{'ifAdminStatus'} eq "up") {
$json{'then'}{$sysname}{'clients'}{'ifHCInOctets'} += $port{'ifHCInOctets'};
$json{'then'}{$sysname}{'clients'}{'ifHCOutOctets'} += $port{'ifHCOutOctets'};