Skip to content

Commit 1f7c30d

Browse files
committed
router: Add display of interface alias on route monitor (for interface)
only if it is available
1 parent 145ef86 commit 1f7c30d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Src/Private/Get-AbrFgtRoute.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function Get-AbrFgtRoute {
4343
$BGPSchema = (Invoke-FGTRestMethod 'api/v2/cmdb/router/bgp?&action=schema').results.children
4444
$OSPF = Get-FGTRouterOSPF
4545
$OSPFSchema = (Invoke-FGTRestMethod 'api/v2/cmdb/router/ospf?&action=schema').results.children
46+
$interfaces = Get-FGTSystemInterface -skip
4647

4748
if ($InfoLevel.Route -ge 1) {
4849
Section -Style Heading3 'Summary' {
@@ -79,6 +80,11 @@ function Get-AbrFgtRoute {
7980
$interface = "Blackhole"
8081
} else {
8182
$interface = $route.interface
83+
#Search interface on system interface (for get alias)
84+
$int = $interfaces | Where-Object { $_.name -eq $interface }
85+
if ($int.alias ) {
86+
$interface += " ($($int.alias))"
87+
}
8288
}
8389

8490
$OutObj += [pscustomobject]@{
@@ -426,7 +432,7 @@ function Get-AbrFgtRoute {
426432
$TableParams['Caption'] = "- $($TableParams.Name)"
427433
}
428434

429-
$OutObj | Where-Object { $_.value -NE $_.default } | Set-Style -Style Critical
435+
$OutObj | Where-Object { $_.value -ne $_.default } | Set-Style -Style Critical
430436
$OutObj | Table @TableParams
431437
}
432438
}

0 commit comments

Comments
 (0)