Src/Private/Get-AbrOntapVserverFcpSummary.ps1
|
function Get-AbrOntapVserverFcpSummary { <# .SYNOPSIS Used by As Built Report to retrieve NetApp ONTAP Vserver FCP information from the Cluster Management Network .DESCRIPTION .NOTES Version: 0.6.12 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux .EXAMPLE .LINK #> param ( [Parameter ( Position = 0, Mandatory)] [string] $Vserver ) begin { Write-PScriboMessage 'Collecting ONTAP Vserver FCP information.' } process { try { $VserverData = Get-NcFcpService -VserverContext $Vserver -Controller $Array $VserverObj = @() if ($VserverData) { foreach ($Item in $VserverData) { try { $inObj = [ordered] @{ 'FCP WWNN' = $Item.NodeName 'Status' = $Item.IsAvailable -eq $true ? 'Up': 'Down' } $VserverObj += [pscustomobject](ConvertTo-HashToYN $inObj) } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } if ($Healthcheck.Vserver.FCP) { $VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status' } $TableParams = @{ Name = "FCP Service - $($Vserver)" List = $false ColumnWidths = 70, 30 } if ($Report.ShowTableCaptions) { $TableParams['Caption'] = "- $($TableParams.Name)" } $VserverObj | Table @TableParams if ($Healthcheck.Vserver.FCP -and ($VserverObj | Where-Object { $_.'Status' -like 'Down' } )) { Paragraph 'Health Check:' -Bold -Underline BlankLine Paragraph { Text 'Best Practice:' -Bold Text 'Ensure that all FCP services are operational to maintain optimal storage connectivity.' } BlankLine } } } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } end {} } |