Skip to content

Commit 995f48b

Browse files
authored
Merge pull request #16 from rebelinux:dev
v0.6.3
2 parents 027375a + f19b12d commit 995f48b

File tree

101 files changed

+4031
-2928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+4031
-2928
lines changed

AsBuiltReport.NetApp.ONTAP.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.NetApp.ONTAP.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.6.2'
15+
ModuleVersion = '0.6.3'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -27,7 +27,7 @@ Author = 'Jonathan Colon Feliciano'
2727
#CompanyName = 'Unknown'
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2021 Jonathan Colon Feliciano. All rights reserved.'
30+
Copyright = '(c) 2022 Jonathan Colon Feliciano. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'A PowerShell module to generate an as built report on the configuration of NetApp ONTAP.'

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# :arrows_counterclockwise: NetApp ONTAP Storage As Built Report Changelog
22

3+
## [0.6.3] - 2022-01-31
4+
5+
### Changed
6+
7+
- Implemented better error handling.
8+
39
## [0.6.2] - 2022-01-12
410

511
### Added

Src/Private/Get-AbrOntapCluster.ps1

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function 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

Src/Private/Get-AbrOntapClusterASUP.ps1

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function Get-AbrOntapClusterASUP {
22
<#
33
.SYNOPSIS
4-
Used by As Built Report to retrieve NetApp ONTAP cluster autoSupport status from the Cluster Management Network
4+
Used by As Built Report to retrieve NetApp ONTAP cluster autoSupport status from the Cluster Management Network
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.6.2
8+
Version: 0.6.3
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -23,34 +23,44 @@ function Get-AbrOntapClusterASUP {
2323
}
2424

2525
process {
26-
$AutoSupport = Get-NcAutoSupportConfig -Controller $Array
27-
if ($AutoSupport) {
28-
$Outobj = @()
29-
foreach ($NodesAUTO in $AutoSupport) {
30-
$Inobj = [ordered] @{
31-
'Node Name' = $NodesAUTO.NodeName
32-
'Protocol' = $NodesAUTO.Transport
33-
'Enabled' = ConvertTo-TextYN $NodesAUTO.IsEnabled
34-
'Last Time Stamp' = $NodesAUTO.LastTimestampDT
35-
'Last Subject' = $NodesAUTO.LastSubject
36-
}
37-
$Outobj = [PSCustomObject]$Inobj
26+
try {
27+
$AutoSupport = Get-NcAutoSupportConfig -Controller $Array
28+
if ($AutoSupport) {
29+
$Outobj = @()
30+
foreach ($NodesAUTO in $AutoSupport) {
31+
try {
32+
$Inobj = [ordered] @{
33+
'Node Name' = $NodesAUTO.NodeName
34+
'Protocol' = $NodesAUTO.Transport
35+
'Enabled' = ConvertTo-TextYN $NodesAUTO.IsEnabled
36+
'Last Time Stamp' = $NodesAUTO.LastTimestampDT
37+
'Last Subject' = $NodesAUTO.LastSubject
38+
}
39+
$Outobj = [PSCustomObject]$Inobj
3840

39-
if ($Healthcheck.Cluster.AutoSupport) {
40-
$Outobj | Where-Object { $_.'Enabled' -like 'No' } | Set-Style -Style Warning -Property 'Enabled'
41-
}
41+
if ($Healthcheck.Cluster.AutoSupport) {
42+
$Outobj | Where-Object { $_.'Enabled' -like 'No' } | Set-Style -Style Warning -Property 'Enabled'
43+
}
4244

43-
$TableParams = @{
44-
Name = "Cluster AutoSupport Status - $($NodesAUTO.NodeName)"
45-
List = $true
46-
ColumnWidths = 25, 75
45+
$TableParams = @{
46+
Name = "Cluster AutoSupport Status - $($NodesAUTO.NodeName)"
47+
List = $true
48+
ColumnWidths = 25, 75
49+
}
50+
if ($Report.ShowTableCaptions) {
51+
$TableParams['Caption'] = "- $($TableParams.Name)"
52+
}
53+
$Outobj | Table @TableParams
54+
}
55+
catch {
56+
Write-PscriboMessage -IsWarning $_.Exception.Message
57+
}
4758
}
48-
if ($Report.ShowTableCaptions) {
49-
$TableParams['Caption'] = "- $($TableParams.Name)"
50-
}
51-
$Outobj | Table @TableParams
5259
}
5360
}
61+
catch {
62+
Write-PscriboMessage -IsWarning $_.Exception.Message
63+
}
5464
}
5565

5666
end {}

Src/Private/Get-AbrOntapClusterHA.ps1

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function Get-AbrOntapClusterHA {
22
<#
33
.SYNOPSIS
4-
Used by As Built Report to retrieve NetApp ONTAP cluster HA information from the Cluster Management Network
4+
Used by As Built Report to retrieve NetApp ONTAP cluster HA 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,33 +23,43 @@ function Get-AbrOntapClusterHA {
2323
}
2424

2525
process {
26-
$NodeSum = Get-NcNode -Controller $Array | Where-Object { $null -ne $_.NodeModel }
27-
if ($NodeSum) {
28-
$NodeSummary = foreach ($Nodes in $NodeSum) {
29-
$ClusterHa = Get-NcClusterHa -Node $Nodes.Node -Controller $Array
30-
[PSCustomObject] @{
31-
'Name' = $Nodes.Node
32-
'Partner' = $ClusterHa.Partner
33-
'TakeOver Possible' = ConvertTo-TextYN $ClusterHa.TakeoverPossible
34-
'TakeOver State' = $ClusterHa.TakeoverState
35-
'HA Mode' = $ClusterHa.CurrentMode.ToUpper()
36-
'HA State' = $ClusterHa.State.ToUpper()
26+
try {
27+
$NodeSum = Get-NcNode -Controller $Array | Where-Object { $null -ne $_.NodeModel }
28+
if ($NodeSum) {
29+
$NodeSummary = foreach ($Nodes in $NodeSum) {
30+
try {
31+
$ClusterHa = Get-NcClusterHa -Node $Nodes.Node -Controller $Array
32+
[PSCustomObject] @{
33+
'Name' = $Nodes.Node
34+
'Partner' = $ClusterHa.Partner
35+
'TakeOver Possible' = ConvertTo-TextYN $ClusterHa.TakeoverPossible
36+
'TakeOver State' = $ClusterHa.TakeoverState
37+
'HA Mode' = $ClusterHa.CurrentMode.ToUpper()
38+
'HA State' = $ClusterHa.State.ToUpper()
39+
}
40+
}
41+
catch {
42+
Write-PscriboMessage -IsWarning $_.Exception.Message
43+
}
44+
}
45+
if ($Healthcheck.Cluster.HA) {
46+
$NodeSummary | Where-Object { $_.'TakeOver State' -like 'in_takeover' } | Set-Style -Style Warning -Property 'TakeOver State'
47+
$NodeSummary | Where-Object { $_.'HA State' -notlike 'connected' } | Set-Style -Style Warning -Property 'HA State'
3748
}
38-
}
39-
if ($Healthcheck.Cluster.HA) {
40-
$NodeSummary | Where-Object { $_.'TakeOver State' -like 'in_takeover' } | Set-Style -Style Warning -Property 'TakeOver State'
41-
$NodeSummary | Where-Object { $_.'HA State' -notlike 'connected' } | Set-Style -Style Warning -Property 'HA State'
42-
}
4349

44-
$TableParams = @{
45-
Name = "Cluster HA Status - $($ClusterInfo.ClusterName)"
46-
List = $false
47-
ColumnWidths = 20, 20, 11, 19, 10, 20
48-
}
49-
if ($Report.ShowTableCaptions) {
50-
$TableParams['Caption'] = "- $($TableParams.Name)"
50+
$TableParams = @{
51+
Name = "Cluster HA Status - $($ClusterInfo.ClusterName)"
52+
List = $false
53+
ColumnWidths = 20, 20, 11, 19, 10, 20
54+
}
55+
if ($Report.ShowTableCaptions) {
56+
$TableParams['Caption'] = "- $($TableParams.Name)"
57+
}
58+
$NodeSummary | Table @TableParams
5159
}
52-
$NodeSummary | Table @TableParams
60+
}
61+
catch {
62+
Write-PscriboMessage -IsWarning $_.Exception.Message
5363
}
5464
}
5565

Src/Private/Get-AbrOntapClusterLicense.ps1

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function Get-AbrOntapClusterLicense {
22
<#
33
.SYNOPSIS
4-
Used by As Built Report to retrieve NetApp ONTAP cluster licenses information from the Cluster Management Network
4+
Used by As Built Report to retrieve NetApp ONTAP cluster licenses information from the Cluster Management Network
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.6.2
8+
Version: 0.6.3
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -23,36 +23,46 @@ function Get-AbrOntapClusterLicense {
2323
}
2424

2525
process {
26-
$Nodes = Get-NcNode -Controller $Array
27-
foreach ($Node in $Nodes) {
28-
Section -Style Heading3 "$Node License Usage" {
29-
$License = Get-NcLicense -Owner $Node -Controller $Array
30-
if ($License) {
31-
$LicenseSummary = foreach ($Licenses in $License) {
32-
$EntitlementRisk = Get-NcLicenseEntitlementRisk -Package $Licenses.Package -Controller $Array
33-
[PSCustomObject] @{
34-
'License' = $TextInfo.ToTitleCase($Licenses.Package)
35-
'Type' = $TextInfo.ToTitleCase($Licenses.Type)
36-
'Description' = $Licenses.Description
37-
'Risk' = ConvertTo-EmptyToFiller $EntitlementRisk.Risk
26+
try {
27+
$Nodes = Get-NcNode -Controller $Array
28+
foreach ($Node in $Nodes) {
29+
try {
30+
Section -Style Heading3 "$Node License Usage" {
31+
$License = Get-NcLicense -Owner $Node -Controller $Array
32+
if ($License) {
33+
$LicenseSummary = foreach ($Licenses in $License) {
34+
$EntitlementRisk = Get-NcLicenseEntitlementRisk -Package $Licenses.Package -Controller $Array
35+
[PSCustomObject] @{
36+
'License' = $TextInfo.ToTitleCase($Licenses.Package)
37+
'Type' = $TextInfo.ToTitleCase($Licenses.Type)
38+
'Description' = $Licenses.Description
39+
'Risk' = ConvertTo-EmptyToFiller $EntitlementRisk.Risk
40+
}
41+
}
42+
if ($Healthcheck.License.RiskSummary) {
43+
$LicenseSummary | Where-Object { $_.'Risk' -like 'medium' -or $_.'Risk' -like 'unknown' -or $_.'Risk' -like 'unlicensed' } | Set-Style -Style Warning -Property 'Risk'
44+
$LicenseSummary | Where-Object { $_.'Risk' -like 'High' } | Set-Style -Style Critical -Property 'Risk'
45+
}
46+
$TableParams = @{
47+
Name = "License Usage - $($Node)"
48+
List = $false
49+
ColumnWidths = 25, 15, 38, 22
50+
}
51+
if ($Report.ShowTableCaptions) {
52+
$TableParams['Caption'] = "- $($TableParams.Name)"
53+
}
54+
$LicenseSummary | Table @TableParams
3855
}
3956
}
40-
if ($Healthcheck.License.RiskSummary) {
41-
$LicenseSummary | Where-Object { $_.'Risk' -like 'medium' -or $_.'Risk' -like 'unknown' -or $_.'Risk' -like 'unlicensed' } | Set-Style -Style Warning -Property 'Risk'
42-
$LicenseSummary | Where-Object { $_.'Risk' -like 'High' } | Set-Style -Style Critical -Property 'Risk'
43-
}
44-
$TableParams = @{
45-
Name = "License Usage - $($Node)"
46-
List = $false
47-
ColumnWidths = 25, 15, 38, 22
48-
}
49-
if ($Report.ShowTableCaptions) {
50-
$TableParams['Caption'] = "- $($TableParams.Name)"
51-
}
52-
$LicenseSummary | Table @TableParams
57+
}
58+
catch {
59+
Write-PscriboMessage -IsWarning $_.Exception.Message
5360
}
5461
}
5562
}
63+
catch {
64+
Write-PscriboMessage -IsWarning $_.Exception.Message
65+
}
5666
}
5767

5868
end {}

0 commit comments

Comments
 (0)