Src/Private/Get-AbrOntapCluster.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
function Get-AbrOntapCluster { <# .SYNOPSIS Used by As Built Report to retrieve NetApp ONTAP cluster information from the Cluster Management Network .DESCRIPTION .NOTES Version: 0.6.3 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux .EXAMPLE .LINK #> [CmdletBinding()] param ( ) begin { Write-PscriboMessage "Collecting ONTAP cluster information." } process { try { $ClusterInfo = Get-NcCluster -Controller $Array if ($ClusterInfo) { $ClusterDiag = Get-NcDiagnosisStatus -Controller $Array $ClusterVersion = Get-NcSystemVersion -Controller $Array $ArrayAggr = Get-NcAggr -Controller $Array $ArrayVolumes = Get-NcVol -Controller $Array $ClusterSummary = [PSCustomObject] @{ 'Cluster Name' = $ClusterInfo.ClusterName 'Cluster UUID' = $ClusterInfo.ClusterUuid 'Cluster Serial' = $ClusterInfo.ClusterSerialNumber 'Cluster Controller' = $ClusterInfo.NcController 'Cluster Contact' = ConvertTo-EmptyToFiller $ClusterInfo.ClusterContact 'Cluster Location' = ConvertTo-EmptyToFiller $ClusterInfo.ClusterLocation 'Ontap Version' = $ClusterVersion.value 'Number of Aggregates' = $ArrayAggr.count 'Number of Volumes' = $ArrayVolumes.count 'Overall System Health' = $ClusterDiag.Status.ToUpper() } if ($Healthcheck.Cluster.Summary) { $ClusterSummary | Where-Object { $_.'Overall System Health' -like 'OK' } | Set-Style -Style OK -Property 'Overall System Health' $ClusterSummary | Where-Object { $_.'Overall System Health' -notlike 'OK' } | Set-Style -Style Critical -Property 'Overall System Health' } $TableParams = @{ Name = "Cluster Information - $($ClusterInfo.ClusterName)" List = $true ColumnWidths = 25, 75 } if ($Report.ShowTableCaptions) { $TableParams['Caption'] = "- $($TableParams.Name)" } $ClusterSummary | Table @TableParams } } catch { Write-PscriboMessage -IsWarning $_.Exception.Message } } end {} } |