11function Get-AbrOntapCluster {
22 <#
33 . SYNOPSIS
4- Used by As Built Report to retrieve NetApp ONTAP cluster information from the Cluster Management Network
4+ Used by As Built Report to retrieve NetApp ONTAP cluster information from the Cluster Management Network
55 . DESCRIPTION
66
77 . NOTES
8- Version: 0.5.0
8+ Version: 0.6.3
99 Author: Jonathan Colon
1010 Twitter: @jcolonfzenpr
1111 Github: rebelinux
@@ -23,38 +23,43 @@ function Get-AbrOntapCluster {
2323 }
2424
2525 process {
26- $ClusterInfo = Get-NcCluster - Controller $Array
27- if ($ClusterInfo ) {
28- $ClusterDiag = Get-NcDiagnosisStatus - Controller $Array
29- $ClusterVersion = Get-NcSystemVersion - Controller $Array
30- $ArrayAggr = Get-NcAggr - Controller $Array
31- $ArrayVolumes = Get-NcVol - Controller $Array
32- $ClusterSummary = [PSCustomObject ] @ {
33- ' Cluster Name' = $ClusterInfo.ClusterName
34- ' Cluster UUID' = $ClusterInfo.ClusterUuid
35- ' Cluster Serial' = $ClusterInfo.ClusterSerialNumber
36- ' Cluster Controller' = $ClusterInfo.NcController
37- ' Cluster Contact' = ConvertTo-EmptyToFiller $ClusterInfo.ClusterContact
38- ' Cluster Location' = ConvertTo-EmptyToFiller $ClusterInfo.ClusterLocation
39- ' Ontap Version' = $ClusterVersion.value
40- ' Number of Aggregates' = $ArrayAggr.count
41- ' Number of Volumes' = $ArrayVolumes.count
42- ' Overall System Health' = $ClusterDiag.Status.ToUpper ()
43- }
44- if ($Healthcheck.Cluster.Summary ) {
45- $ClusterSummary | Where-Object { $_ .' Overall System Health' -like ' OK' } | Set-Style - Style OK - Property ' Overall System Health'
46- $ClusterSummary | Where-Object { $_ .' Overall System Health' -notlike ' OK' } | Set-Style - Style Critical - Property ' Overall System Health'
47- }
26+ try {
27+ $ClusterInfo = Get-NcCluster - Controller $Array
28+ if ($ClusterInfo ) {
29+ $ClusterDiag = Get-NcDiagnosisStatus - Controller $Array
30+ $ClusterVersion = Get-NcSystemVersion - Controller $Array
31+ $ArrayAggr = Get-NcAggr - Controller $Array
32+ $ArrayVolumes = Get-NcVol - Controller $Array
33+ $ClusterSummary = [PSCustomObject ] @ {
34+ ' Cluster Name' = $ClusterInfo.ClusterName
35+ ' Cluster UUID' = $ClusterInfo.ClusterUuid
36+ ' Cluster Serial' = $ClusterInfo.ClusterSerialNumber
37+ ' Cluster Controller' = $ClusterInfo.NcController
38+ ' Cluster Contact' = ConvertTo-EmptyToFiller $ClusterInfo.ClusterContact
39+ ' Cluster Location' = ConvertTo-EmptyToFiller $ClusterInfo.ClusterLocation
40+ ' Ontap Version' = $ClusterVersion.value
41+ ' Number of Aggregates' = $ArrayAggr.count
42+ ' Number of Volumes' = $ArrayVolumes.count
43+ ' Overall System Health' = $ClusterDiag.Status.ToUpper ()
44+ }
45+ if ($Healthcheck.Cluster.Summary ) {
46+ $ClusterSummary | Where-Object { $_ .' Overall System Health' -like ' OK' } | Set-Style - Style OK - Property ' Overall System Health'
47+ $ClusterSummary | Where-Object { $_ .' Overall System Health' -notlike ' OK' } | Set-Style - Style Critical - Property ' Overall System Health'
48+ }
4849
49- $TableParams = @ {
50- Name = " Cluster Information - $ ( $ClusterInfo.ClusterName ) "
51- List = $true
52- ColumnWidths = 25 , 75
50+ $TableParams = @ {
51+ Name = " Cluster Information - $ ( $ClusterInfo.ClusterName ) "
52+ List = $true
53+ ColumnWidths = 25 , 75
54+ }
55+ if ($Report.ShowTableCaptions ) {
56+ $TableParams [' Caption' ] = " - $ ( $TableParams.Name ) "
57+ }
58+ $ClusterSummary | Table @TableParams
5359 }
54- if ($Report.ShowTableCaptions ) {
55- $TableParams [' Caption' ] = " - $ ( $TableParams.Name ) "
56- }
57- $ClusterSummary | Table @TableParams
60+ }
61+ catch {
62+ Write-PscriboMessage - IsWarning $_.Exception.Message
5863 }
5964 }
6065
0 commit comments