Skip to content

Commit

Permalink
Merge pull request #17 from AsBuiltReport/dev
Browse files Browse the repository at this point in the history
v0.6.3 public release
  • Loading branch information
rebelinux authored Jan 31, 2022
2 parents ed306e8 + 995f48b commit 54a415b
Show file tree
Hide file tree
Showing 101 changed files with 4,031 additions and 2,928 deletions.
4 changes: 2 additions & 2 deletions AsBuiltReport.NetApp.ONTAP.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.NetApp.ONTAP.psm1'

# Version number of this module.
ModuleVersion = '0.6.2'
ModuleVersion = '0.6.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -27,7 +27,7 @@ Author = 'Jonathan Colon Feliciano'
#CompanyName = 'Unknown'

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

# Description of the functionality provided by this module
Description = 'A PowerShell module to generate an as built report on the configuration of NetApp ONTAP.'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# :arrows_counterclockwise: NetApp ONTAP Storage As Built Report Changelog

## [0.6.3] - 2022-01-31

### Changed

- Implemented better error handling.

## [0.6.2] - 2022-01-12

### Added
Expand Down
69 changes: 37 additions & 32 deletions Src/Private/Get-AbrOntapCluster.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Get-AbrOntapCluster {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP cluster information from the Cluster Management Network
Used by As Built Report to retrieve NetApp ONTAP cluster information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.5.0
Version: 0.6.3
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -23,38 +23,43 @@ function Get-AbrOntapCluster {
}

process {
$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'
}
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
$TableParams = @{
Name = "Cluster Information - $($ClusterInfo.ClusterName)"
List = $true
ColumnWidths = 25, 75
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$ClusterSummary | Table @TableParams
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$ClusterSummary | Table @TableParams
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

Expand Down
60 changes: 35 additions & 25 deletions Src/Private/Get-AbrOntapClusterASUP.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Get-AbrOntapClusterASUP {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP cluster autoSupport status from the Cluster Management Network
Used by As Built Report to retrieve NetApp ONTAP cluster autoSupport status from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.2
Version: 0.6.3
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -23,34 +23,44 @@ function Get-AbrOntapClusterASUP {
}

process {
$AutoSupport = Get-NcAutoSupportConfig -Controller $Array
if ($AutoSupport) {
$Outobj = @()
foreach ($NodesAUTO in $AutoSupport) {
$Inobj = [ordered] @{
'Node Name' = $NodesAUTO.NodeName
'Protocol' = $NodesAUTO.Transport
'Enabled' = ConvertTo-TextYN $NodesAUTO.IsEnabled
'Last Time Stamp' = $NodesAUTO.LastTimestampDT
'Last Subject' = $NodesAUTO.LastSubject
}
$Outobj = [PSCustomObject]$Inobj
try {
$AutoSupport = Get-NcAutoSupportConfig -Controller $Array
if ($AutoSupport) {
$Outobj = @()
foreach ($NodesAUTO in $AutoSupport) {
try {
$Inobj = [ordered] @{
'Node Name' = $NodesAUTO.NodeName
'Protocol' = $NodesAUTO.Transport
'Enabled' = ConvertTo-TextYN $NodesAUTO.IsEnabled
'Last Time Stamp' = $NodesAUTO.LastTimestampDT
'Last Subject' = $NodesAUTO.LastSubject
}
$Outobj = [PSCustomObject]$Inobj

if ($Healthcheck.Cluster.AutoSupport) {
$Outobj | Where-Object { $_.'Enabled' -like 'No' } | Set-Style -Style Warning -Property 'Enabled'
}
if ($Healthcheck.Cluster.AutoSupport) {
$Outobj | Where-Object { $_.'Enabled' -like 'No' } | Set-Style -Style Warning -Property 'Enabled'
}

$TableParams = @{
Name = "Cluster AutoSupport Status - $($NodesAUTO.NodeName)"
List = $true
ColumnWidths = 25, 75
$TableParams = @{
Name = "Cluster AutoSupport Status - $($NodesAUTO.NodeName)"
List = $true
ColumnWidths = 25, 75
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$Outobj | Table @TableParams
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$Outobj | Table @TableParams
}
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

end {}
Expand Down
62 changes: 36 additions & 26 deletions Src/Private/Get-AbrOntapClusterHA.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Get-AbrOntapClusterHA {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP cluster HA information from the Cluster Management Network
Used by As Built Report to retrieve NetApp ONTAP cluster HA information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.5.0
Version: 0.6.3
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -23,33 +23,43 @@ function Get-AbrOntapClusterHA {
}

process {
$NodeSum = Get-NcNode -Controller $Array | Where-Object { $null -ne $_.NodeModel }
if ($NodeSum) {
$NodeSummary = foreach ($Nodes in $NodeSum) {
$ClusterHa = Get-NcClusterHa -Node $Nodes.Node -Controller $Array
[PSCustomObject] @{
'Name' = $Nodes.Node
'Partner' = $ClusterHa.Partner
'TakeOver Possible' = ConvertTo-TextYN $ClusterHa.TakeoverPossible
'TakeOver State' = $ClusterHa.TakeoverState
'HA Mode' = $ClusterHa.CurrentMode.ToUpper()
'HA State' = $ClusterHa.State.ToUpper()
try {
$NodeSum = Get-NcNode -Controller $Array | Where-Object { $null -ne $_.NodeModel }
if ($NodeSum) {
$NodeSummary = foreach ($Nodes in $NodeSum) {
try {
$ClusterHa = Get-NcClusterHa -Node $Nodes.Node -Controller $Array
[PSCustomObject] @{
'Name' = $Nodes.Node
'Partner' = $ClusterHa.Partner
'TakeOver Possible' = ConvertTo-TextYN $ClusterHa.TakeoverPossible
'TakeOver State' = $ClusterHa.TakeoverState
'HA Mode' = $ClusterHa.CurrentMode.ToUpper()
'HA State' = $ClusterHa.State.ToUpper()
}
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}
if ($Healthcheck.Cluster.HA) {
$NodeSummary | Where-Object { $_.'TakeOver State' -like 'in_takeover' } | Set-Style -Style Warning -Property 'TakeOver State'
$NodeSummary | Where-Object { $_.'HA State' -notlike 'connected' } | Set-Style -Style Warning -Property 'HA State'
}
}
if ($Healthcheck.Cluster.HA) {
$NodeSummary | Where-Object { $_.'TakeOver State' -like 'in_takeover' } | Set-Style -Style Warning -Property 'TakeOver State'
$NodeSummary | Where-Object { $_.'HA State' -notlike 'connected' } | Set-Style -Style Warning -Property 'HA State'
}

$TableParams = @{
Name = "Cluster HA Status - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 20, 20, 11, 19, 10, 20
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
$TableParams = @{
Name = "Cluster HA Status - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 20, 20, 11, 19, 10, 20
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$NodeSummary | Table @TableParams
}
$NodeSummary | Table @TableParams
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

Expand Down
64 changes: 37 additions & 27 deletions Src/Private/Get-AbrOntapClusterLicense.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Get-AbrOntapClusterLicense {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP cluster licenses information from the Cluster Management Network
Used by As Built Report to retrieve NetApp ONTAP cluster licenses information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.2
Version: 0.6.3
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -23,36 +23,46 @@ function Get-AbrOntapClusterLicense {
}

process {
$Nodes = Get-NcNode -Controller $Array
foreach ($Node in $Nodes) {
Section -Style Heading3 "$Node License Usage" {
$License = Get-NcLicense -Owner $Node -Controller $Array
if ($License) {
$LicenseSummary = foreach ($Licenses in $License) {
$EntitlementRisk = Get-NcLicenseEntitlementRisk -Package $Licenses.Package -Controller $Array
[PSCustomObject] @{
'License' = $TextInfo.ToTitleCase($Licenses.Package)
'Type' = $TextInfo.ToTitleCase($Licenses.Type)
'Description' = $Licenses.Description
'Risk' = ConvertTo-EmptyToFiller $EntitlementRisk.Risk
try {
$Nodes = Get-NcNode -Controller $Array
foreach ($Node in $Nodes) {
try {
Section -Style Heading3 "$Node License Usage" {
$License = Get-NcLicense -Owner $Node -Controller $Array
if ($License) {
$LicenseSummary = foreach ($Licenses in $License) {
$EntitlementRisk = Get-NcLicenseEntitlementRisk -Package $Licenses.Package -Controller $Array
[PSCustomObject] @{
'License' = $TextInfo.ToTitleCase($Licenses.Package)
'Type' = $TextInfo.ToTitleCase($Licenses.Type)
'Description' = $Licenses.Description
'Risk' = ConvertTo-EmptyToFiller $EntitlementRisk.Risk
}
}
if ($Healthcheck.License.RiskSummary) {
$LicenseSummary | Where-Object { $_.'Risk' -like 'medium' -or $_.'Risk' -like 'unknown' -or $_.'Risk' -like 'unlicensed' } | Set-Style -Style Warning -Property 'Risk'
$LicenseSummary | Where-Object { $_.'Risk' -like 'High' } | Set-Style -Style Critical -Property 'Risk'
}
$TableParams = @{
Name = "License Usage - $($Node)"
List = $false
ColumnWidths = 25, 15, 38, 22
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$LicenseSummary | Table @TableParams
}
}
if ($Healthcheck.License.RiskSummary) {
$LicenseSummary | Where-Object { $_.'Risk' -like 'medium' -or $_.'Risk' -like 'unknown' -or $_.'Risk' -like 'unlicensed' } | Set-Style -Style Warning -Property 'Risk'
$LicenseSummary | Where-Object { $_.'Risk' -like 'High' } | Set-Style -Style Critical -Property 'Risk'
}
$TableParams = @{
Name = "License Usage - $($Node)"
List = $false
ColumnWidths = 25, 15, 38, 22
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$LicenseSummary | Table @TableParams
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

end {}
Expand Down
Loading

0 comments on commit 54a415b

Please sign in to comment.