Skip to content

Commit

Permalink
Merge pull request #34 from AsBuiltReport/dev
Browse files Browse the repository at this point in the history
v0.6.5 public release
  • Loading branch information
rebelinux authored Nov 7, 2022
2 parents f99ec94 + fbac2a9 commit e77834f
Show file tree
Hide file tree
Showing 44 changed files with 668 additions and 130 deletions.
1 change: 1 addition & 0 deletions AsBuiltReport.NetApp.ONTAP.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"Status": true,
"Iscsi": true,
"FCP": true,
"CG": true,
"NFS": true,
"Quota": true,
"CIFS": true,
Expand Down
2 changes: 1 addition & 1 deletion 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.4'
ModuleVersion = '0.6.5'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# :arrows_counterclockwise: NetApp ONTAP Storage As Built Report Changelog

## [0.6.5] - 2022-11-06

### Added

- Added aggregate spare reporting [#26](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/26)
- Added Ontap Multi Admin Approval [#29](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/29)
- Added Consistency Group Support [#28](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/28)
- Added Audit Logs Support [#31](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/31)
- Added Audit log destination [#30](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/30)

### Fixed

- Fix #22
- Fix #23
- Fix #24
- Close #29
- Close #26
- Close #28
- Close #30
- Close #31
- Fixed SNMP section not shown in report.

## [0.6.4] - 2022-05-14

### Added
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<a href="https://twitter.com/AsBuiltReport" alt="Twitter">
<img src="https://img.shields.io/twitter/follow/AsBuiltReport.svg?style=social"/></a>
</p>
<p align="center">
<a href='https://ko-fi.com/F1F8DEV80' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
</p>

# NetApp ONTAP Arrays AsBuiltReport

Expand All @@ -48,14 +51,15 @@ Below are the instructions on how to install, configure and generate a NetApp ON
The ONTAP Storage As Built Report supports the following ONTAP versions;

- ONTAP 9.x
- Tested on v9.5, 9.7, 9.8, 9.9.1, 9.10.1, 9.11.1

### **PowerShell**

This report is compatible with the following PowerShell versions;

| Windows PowerShell 5.1 | PowerShell Core | PowerShell 7 |
|:----------------------:|:---------------:|:------------:|
| :white_check_mark: | :white_check_mark: | :white_check_mark: |
| PowerShell 5.1 | PowerShell 7 |
|:----------------------:|:---------------:|
| :white_check_mark: | :white_check_mark:|

## :wrench: System Requirements

Expand All @@ -69,14 +73,6 @@ These modules may also be manually installed.
| AsBuiltReport.Core | 1.2.0 | [Link](https://www.powershellgallery.com/packages/AsBuiltReport.Core) | [Link](https://github.com/AsBuiltReport/AsBuiltReport.Core/releases/latest) |
| Netapp.ONTAP | 9.10.1.2111 | [Link](https://www.powershellgallery.com/packages/NetApp.ONTAP) | |

### Linux & macOS

- .NET Core is required for cover page image support on Linux and macOS operating systems.
- [Installing .NET Core for macOS](https://docs.microsoft.com/en-us/dotnet/core/install/macos)
- [Installing .NET Core for Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux)

❗ If you are unable to install .NET Core, you must set `ShowCoverPageImage` to `False` in the report JSON configuration file.

## :package: Module Installation

### PowerShell
Expand Down Expand Up @@ -195,3 +191,6 @@ PS C:\> New-AsBuiltReport -Report NetApp.ONTAP -Target 192.168.7.60 -Credential
PS C:\> New-AsBuiltReport -Report NetApp.ONTAP -Target 192.168.7.60 -Username 'admin' -Password 'P@ssw0rd' -Format Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -SendEmail
```
## :x: Known Issues

- There are known issues with the NetApp.ONTAP module v9.11.1.2208. Therefore, v9.10.1.2111 is the recommended module version.
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrOntapClusterLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Get-AbrOntapClusterLicense {
$License = Get-NcLicense -Owner $Node -Controller $Array
if ($License) {
$LicenseSummary = foreach ($Licenses in $License) {
$EntitlementRisk = Get-NcLicenseEntitlementRisk -Package $Licenses.Package -Controller $Array
$EntitlementRisk = Try {Get-NcLicenseEntitlementRisk -Package $Licenses.Package -Controller $Array -ErrorAction SilentlyContinue} catch {Write-PscriboMessage -IsWarning $_.Exception.Message}
[PSCustomObject] @{
'License' = $TextInfo.ToTitleCase($Licenses.Package)
'Type' = $TextInfo.ToTitleCase($Licenses.Type)
Expand Down
52 changes: 28 additions & 24 deletions Src/Private/Get-AbrOntapEfficiencyAggr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,42 @@ function Get-AbrOntapEfficiencyAggr {
$Data = Get-NcAggr -Controller $Array | Where-Object {$_.AggrRaidAttributes.HasLocalRoot -ne 'True'}
$Savingfilter = (Get-NcAggrEfficiency -Controller $Array | Select-Object -ExpandProperty AggrEfficiencyAdditionalDetailsInfo).NumberOfSisDisabledVolumes | Measure-Object -Sum
if ($Data -and $Savingfilter.Sum -gt 0 -and $Healthcheck.Storage.Efficiency) {
Section -Style Heading4 'HealthCheck - Volume with Disabled Deduplication' {
Paragraph "The following section provides the Volume efficiency healthcheck Information on $($ClusterInfo.ClusterName)."
BlankLine
$OutObj = @()
foreach ($Item in $Data) {
try {
$Saving = Get-NcAggrEfficiency -Aggregate $Item.Name -Controller $Array | Select-Object -ExpandProperty AggrEfficiencyAdditionalDetailsInfo
$VolInAggr = Get-NcVol -Aggregate $Item.Name -Controller $Array
$VolFilter = $VolInAggr | Where-Object { $_.VolumeSisAttributes.IsSisStateEnabled -ne "True"}
$OutObj = @()
foreach ($Item in $Data) {
try {
$Saving = (Get-NcAggrEfficiency -Aggregate $Item.Name -Controller $Array | Select-Object -ExpandProperty AggrEfficiencyAdditionalDetailsInfo).NumberOfSisDisabledVolumes
$VolInAggr = Get-NcVol -Aggregate $Item.Name -Controller $Array | Where-Object {$_.VolumeStateAttributes.IsVserverRoot -ne 'True'}
$VolFilter = $VolInAggr | Where-Object { $_.VolumeSisAttributes.IsSisStateEnabled -ne "True"}
if ($Saving -ne 0 -and $VolFilter) {
$inObj = [ordered] @{
'Aggregate' = $Item.Name
'Volumes without Deduplication' = $VolFilter.Name
'Volumes without Deduplication' = $VolFilter.Name -join ", "
}
$OutObj += [pscustomobject]$inobj
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

if ($Healthcheck.Storage.Efficiency) {
$OutObj | Set-Style -Style Warning -Property 'Aggregate','Volumes without Deduplication'
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

$TableParams = @{
Name = "HealthCheck - Volume without deduplication - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 45, 55
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
if ($Healthcheck.Storage.Efficiency) {
$OutObj | Set-Style -Style Warning -Property 'Aggregate','Volumes without Deduplication'
}

$TableParams = @{
Name = "HealthCheck - Volume without deduplication - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 45, 55
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
}
if ($OutObj) {
Section -Style Heading4 'HealthCheck - Volume with Disabled Deduplication' {
Paragraph "The following section provides the Volume efficiency healthcheck Information on $($ClusterInfo.ClusterName)."
BlankLine
$OutObj | Table @TableParams
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrOntapRepVserverPeer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Get-AbrOntapRepVserverPeer {
}

$TableParams = @{
Name = "Vserver Peer - $($ClusterInfo.ClusterName)"
Name = "Peer - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 20, 20, 20 ,20, 20
}
Expand Down
70 changes: 70 additions & 0 deletions Src/Private/Get-AbrOntapSecurityMAP.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
function Get-AbrOntapSecurityMAP {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP Security Multi-Admin Approval information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.5
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.EXAMPLE
.LINK
#>
[CmdletBinding()]
param (
)

begin {
Write-PscriboMessage "Collecting ONTAP Security Vserver Multi-Admin Approval information."
}

process {
try {
$Data = Get-NetAppOntapAPI -uri "/api/security/multi-admin-verify/approval-groups?fields=**&return_records=true&return_timeout=15"
$OutObj = @()
if ($Data) {
foreach ($Item in $Data) {
try {
$inObj = [ordered] @{
'Name' = $Item.Name
'Approvers' = Switch ([string]::IsNullOrEmpty($Item.Approvers)) {
$true {'-'}
$false {$Item.Approvers -join ', '}
default {'-'}
}
'Email' = Switch ([string]::IsNullOrEmpty($Item.Email)) {
$true {'-'}
$false {$Item.Email -join ', '}
default {'-'}
}
}
$OutObj += [pscustomobject]$inobj
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

$TableParams = @{
Name = "Multi-Admin Approval - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 34,33, 33
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
}
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

end {}

}
69 changes: 69 additions & 0 deletions Src/Private/Get-AbrOntapSecurityMAPRule.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
function Get-AbrOntapSecurityMAPRule {
<#
.SYNOPSIS
Used by As Built Report to retrieve NetApp ONTAP Security Multi-Admin Approval rules information from the Cluster Management Network
.DESCRIPTION
.NOTES
Version: 0.6.5
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.EXAMPLE
.LINK
#>
[CmdletBinding()]
param (
)

begin {
Write-PscriboMessage "Collecting ONTAP Security Vserver Multi-Admin Approval rules information."
}

process {
try {
$Data = Get-NetAppOntapAPI -uri "/api/security/multi-admin-verify/rules?fields=**&return_records=true&return_timeout=15"
$OutObj = @()
if ($Data) {
foreach ($Item in $Data) {
try {
$inObj = [ordered] @{
'operation' = $Item.operation
'query' = ConvertTo-EmptyToFiller $Item.query
'Approval Groups' = Switch ([string]::IsNullOrEmpty($Item.approval_groups.name)) {
$true {'-'}
$false {$Item.approval_groups.name}
default {'-'}
}
'Required Approvers' = ConvertTo-EmptyToFiller $Item.required_approvers
'System Defined' = ConvertTo-TextYN $Item.system_defined

}
$OutObj += [pscustomobject]$inobj
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

$TableParams = @{
Name = "Multi-Admin Approval Rules - $($ClusterInfo.ClusterName)"
List = $false
ColumnWidths = 26, 25, 25, 12, 12
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Sort-Object -Property 'System Defined' | Table @TableParams
}
}
catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}

end {}

}
6 changes: 5 additions & 1 deletion Src/Private/Get-AbrOntapSecuritySSLDetailed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ function Get-AbrOntapSecuritySSLDetailed {
'Protocol' = $Item.Protocol
'Hash Function' = $Item.HashFunction
'Serial Number' = $Item.SerialNumber
'Expiration' = ($Item.ExpirationDateDT).ToString().Split(" ")[0]
'Expiration' = Switch ([string]::IsNullOrEmpty($Item.ExpirationDateDT)) {
$true {'-'}
$false {($Item.ExpirationDateDT).ToString().Split(" ")[0]}
default {'Unknown'}
}
'Vserver' = $Item.Vserver
}
$OutObj += [pscustomobject]$inobj
Expand Down
Loading

0 comments on commit e77834f

Please sign in to comment.