Skip to content

Commit e75100e

Browse files
committed
Enhance Get-AbrOntapNodesSP function with detailed service-processor information and improve reporting structure in Invoke-AsBuiltReport.NetApp.ONTAP
1 parent 05a4690 commit e75100e

File tree

4 files changed

+93
-55
lines changed

4 files changed

+93
-55
lines changed

AsBuiltReport.NetApp.ONTAP.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
@{
6464
ModuleName = 'Diagrammer.Core';
65-
ModuleVersion = '0.2.35'
65+
ModuleVersion = '0.2.36'
6666
}
6767
)
6868

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Fixed
1717

1818
- Fix snapshot reserve space health check to use correct calculation method
19-
- Bump Diagrammer.Core module requirement to v0.2.35
19+
- Bump Diagrammer.Core module requirement to v0.2.36
2020
- Bump module version to v0.6.12
21-
21+
- Enhance Get-AbrOntapNodesSP function with detailed service-processor information
2222

2323
## [0.6.11] - 2025-11-07
2424

Src/Private/Get-AbrOntapNodesSP.ps1

Lines changed: 64 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,74 @@ function Get-AbrOntapNodesSP {
2525
process {
2626
try {
2727
$ServiceProcessor = Get-NcServiceProcessor -Controller $Array
28+
29+
$ServiceProcessor = @(
30+
@{
31+
Node = "cluster-01"
32+
Type = "sp"
33+
IpAddress = "192.168.5.43"
34+
MacAddress = "00:0c:29:3e:5b:7c"
35+
IsIpConfigured = "true"
36+
FirmwareVersion = "2.5"
37+
Status = "online"
38+
},
39+
@{
40+
Node = "cluster-02"
41+
Type = "sp"
42+
IpAddress = ""
43+
MacAddress = "00:0c:29:3e:5b:7f"
44+
IsIpConfigured = "false"
45+
FirmwareVersion = "2.5"
46+
Status = "offline"
47+
}
48+
)
2849
if ($ServiceProcessor) {
29-
$NodeServiceProcessor = foreach ($NodeSPs in $ServiceProcessor) {
30-
try {
31-
[PSCustomObject] @{
32-
'Name' = $NodeSPs.Node
33-
'Type' = $NodeSPs.Type
34-
'IP Address' = $NodeSPs.IpAddress
35-
'MAC Address' = $NodeSPs.MacAddress
36-
'Network Configured' = $NodeSPs.IsIpConfigured
37-
'Firmware' = $NodeSPs.FirmwareVersion
38-
'Status' = $NodeSPs.Status
50+
foreach ($NodeSPs in $ServiceProcessor) {
51+
Section -ExcludeFromTOC -Style NOTOCHeading5 $NodeSPs.Node {
52+
53+
$SPObj = @()
54+
try {
55+
$inObj = [ordered] @{
56+
'Name' = $NodeSPs.Node
57+
'Type' = $NodeSPs.Type
58+
'IP Address' = $NodeSPs.IpAddress
59+
'MAC Address' = $NodeSPs.MacAddress
60+
'Network Configured' = ConvertTo-TextYN $NodeSPs.IsIpConfigured
61+
'Firmware' = $NodeSPs.FirmwareVersion
62+
'Status' = $NodeSPs.Status
63+
}
64+
} catch {
65+
Write-PScriboMessage -IsWarning $_.Exception.Message
3966
}
40-
} catch {
41-
Write-PScriboMessage -IsWarning $_.Exception.Message
42-
}
43-
}
44-
if ($Healthcheck.Node.ServiceProcessor) {
45-
$NodeServiceProcessor | Where-Object { $_.'Status' -like 'offline' -or $_.'Status' -like 'degraded' } | Set-Style -Style Critical -Property 'Status'
46-
$NodeServiceProcessor | Where-Object { $_.'Status' -like 'unknown' -or $_.'Status' -like 'sp-daemon-offline' } | Set-Style -Style Warning -Property 'Status'
47-
$NodeServiceProcessor | Where-Object { $_.'Network Configured' -like "false" } | Set-Style -Style Critical -Property 'Network Configured'
48-
}
49-
}
5067

51-
$TableParams = @{
52-
Name = "Node Service-Processor - $($ClusterInfo.ClusterName)"
53-
List = $true
54-
ColumnWidths = 35, 65
55-
}
56-
if ($Report.ShowTableCaptions) {
57-
$TableParams['Caption'] = "- $($TableParams.Name)"
58-
}
59-
$NodeServiceProcessor | Table @TableParams
60-
if ($Healthcheck.Node.ServiceProcessor -and ($NodeServiceProcessor | Where-Object { $_.'Status' -like 'offline' -or $_.'Status' -like 'degraded' })) {
61-
Paragraph "Health Check:" -Bold -Underline
62-
BlankLine
63-
Paragraph {
64-
Text "Best Practice:" -Bold
65-
Text "Ensure that all service-processors are online and functioning properly to maintain system management capabilities."
68+
$SPObj += [pscustomobject]$inobj
69+
70+
if ($Healthcheck.Node.ServiceProcessor) {
71+
$SPObj | Where-Object { $_.'Status' -like 'offline' -or $_.'Status' -like 'degraded' } | Set-Style -Style Critical -Property 'Status'
72+
$SPObj | Where-Object { $_.'Status' -like 'unknown' -or $_.'Status' -like 'sp-daemon-offline' } | Set-Style -Style Warning -Property 'Status'
73+
$SPObj | Where-Object { $_.'Network Configured' -eq "No" } | Set-Style -Style Critical -Property 'Network Configured'
74+
}
75+
76+
$TableParams = @{
77+
Name = "Node Service-Processor - $($NodeSPs.Node)"
78+
List = $true
79+
ColumnWidths = 30, 70
80+
}
81+
if ($Report.ShowTableCaptions) {
82+
$TableParams['Caption'] = "- $($TableParams.Name)"
83+
}
84+
$SPObj | Table @TableParams
85+
if ($Healthcheck.Node.ServiceProcessor -and ($SPObj | Where-Object { $_.'Status' -like 'offline' -or $_.'Status' -like 'degraded' })) {
86+
Paragraph "Health Check:" -Bold -Underline
87+
BlankLine
88+
Paragraph {
89+
Text "Best Practice:" -Bold
90+
Text "Ensure that all service-processors are online and functioning properly to maintain system management capabilities."
91+
}
92+
BlankLine
93+
}
94+
}
6695
}
67-
BlankLine
6896
}
6997
} catch {
7098
Write-PScriboMessage -IsWarning $_.Exception.Message

Src/Public/Invoke-AsBuiltReport.NetApp.ONTAP.ps1

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
111111
"Ontap_Aggregate" = "netapp_aggregate.png"
112112
"Ontap_SVM" = "ontap_svm.png"
113113
"Ontap_SVM_Icon" = "ontap_svm_icon.png"
114+
"Ontap_Network_Port" = "network_port.png"
115+
"Ontap_Management_Network" = "network-switch.png"
116+
"Ontap_Cluster_Network" = "ontap_stack_switch.png"
117+
"Ontap_Single_Network" = "ontap_single_switch.png"
114118
}
115119
$script:ColumnSize = $Options.DiagramColumnSize
116120

@@ -154,16 +158,16 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
154158
Paragraph "The following section provides the node inventory in $($ClusterInfo.ClusterName)."
155159
BlankLine
156160
Get-AbrOntapNode
157-
Section -Style Heading4 'Node Vol0 Inventory' {
161+
Section -Style Heading4 'Node Vol0' {
158162
Get-AbrOntapNodeStorage
159163
}
160164
if ($InfoLevel.Node -ge 2) {
161-
Section -Style Heading4 'Node Hardware Inventory' {
165+
Section -Style Heading4 'Node Hardware' {
162166
Get-AbrOntapNodesHW
163167
}
164168
}
165-
if (Get-NcServiceProcessor -Controller $Array | Where-Object { $NULL -ne $_.IpAddress -and $NULL -ne $_.MacAddress }) {
166-
Section -Style Heading4 'Node Service-Processor Inventory' {
169+
if ($true) {
170+
Section -Style Heading4 'Node Service-Processor' {
167171
Get-AbrOntapNodesSP
168172
}
169173
}
@@ -183,14 +187,14 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
183187
Paragraph "The following section provides the Aggregates in $($ClusterInfo.ClusterName)."
184188
BlankLine
185189
if (Get-NcAggr -Controller $Array) {
190+
Get-AbrOntapStorageAGGR
186191
$StorageAggrDiagram = Get-AbrOntapStorageAggrDiagram
187192
if ($StorageAggrDiagram) {
188-
Export-AbrOntapDiagram -DiagramObject $StorageAggrDiagram -MainDiagramLabel "Storage Aggregate Diagram" -FileName "AsBuiltReport.NetApp.Ontap.StorageAggr"
193+
Export-AbrOntapDiagram -DiagramObject $StorageAggrDiagram -MainDiagramLabel "Aggregate Diagram" -FileName "AsBuiltReport.NetApp.Ontap.Aggregate"
189194
BlankLine
190195
} else {
191-
Write-PScriboMessage -IsWarning "Unable to generate the Storage Aggregate Diagram."
196+
Write-PScriboMessage -IsWarning "Unable to generate the Aggregate Diagram."
192197
}
193-
Get-AbrOntapStorageAGGR
194198
}
195199
if (Get-NcAggrObjectStore -Controller $Array -Aggregate (Get-NcAggr -Controller $Array).Name) {
196200
Section -Style Heading4 'FabricPool' {
@@ -469,22 +473,28 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
469473
Get-AbrOntapVserverCIFSDC -Vserver $SVM
470474
}
471475
}
472-
Section -ExcludeFromTOC -Style Heading6 'CIFS Local Group' {
473-
Get-AbrOntapVserverCIFSLocalGroup -Vserver $SVM
476+
if (Get-NcCifsLocalGroup -VserverContext $SVM -Controller $Array) {
477+
Section -ExcludeFromTOC -Style Heading6 'CIFS Local Group' {
478+
Get-AbrOntapVserverCIFSLocalGroup -Vserver $SVM
479+
}
474480
}
475-
Section -ExcludeFromTOC -Style Heading6 'CIFS Local Group Members' {
476-
Get-AbrOntapVserverCIFSLGMember -Vserver $SVM
481+
if (Get-NcCifsLocalGroupMember -VserverContext $SVM -Controller $Array) {
482+
Section -ExcludeFromTOC -Style Heading6 'CIFS Local Group Members' {
483+
Get-AbrOntapVserverCIFSLGMember -Vserver $SVM
484+
}
477485
}
478486
if ($InfoLevel.Vserver -ge 2) {
479487
Section -ExcludeFromTOC -Style Heading6 'CIFS Options' {
480488
Get-AbrOntapVserverCIFSOption -Vserver $SVM
481489
}
482490
}
483-
Section -ExcludeFromTOC -Style Heading6 'CIFS Share' {
484-
Get-AbrOntapVserverCIFSShare -Vserver $SVM
485-
}
486-
Section -ExcludeFromTOC -Style Heading6 'CIFS Share Configuration' {
487-
Get-AbrOntapVserverCIFSShareProp -Vserver $SVM
491+
if (Get-NcCifsShare -VserverContext $SVM -Controller $Array) {
492+
Section -ExcludeFromTOC -Style Heading6 'CIFS Share' {
493+
Get-AbrOntapVserverCIFSShare -Vserver $SVM
494+
}
495+
Section -ExcludeFromTOC -Style Heading6 'CIFS Share Configuration' {
496+
Get-AbrOntapVserverCIFSShareProp -Vserver $SVM
497+
}
488498
}
489499
if ($InfoLevel.Vserver -ge 2) {
490500
if (Get-NcCifsSession -VserverContext $SVM -Controller $Array) {

0 commit comments

Comments
 (0)