From 8c8b2ec48a05fb8f566b8a2060b8a72d9c64dcdb Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Mon, 11 Nov 2024 00:23:26 -0400 Subject: [PATCH 1/7] Misc Fixes --- CHANGELOG.md | 10 ++++++++++ Src/Private/Get-VbrBackupvSphereInfo.ps1 | 4 ++-- Veeam.Diagrammer.psd1 | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1607d7f..ce123bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.13] - Unreleased + +### Added + +- Add support for vCenter Information (Infrastructure Diagram) + +### Changed + +- Increase Diagrammer.Core minimum version requirement + ## [0.6.12] - 2024-10-30 ### Added diff --git a/Src/Private/Get-VbrBackupvSphereInfo.ps1 b/Src/Private/Get-VbrBackupvSphereInfo.ps1 index 3c54819..5c473d5 100644 --- a/Src/Private/Get-VbrBackupvSphereInfo.ps1 +++ b/Src/Private/Get-VbrBackupvSphereInfo.ps1 @@ -28,7 +28,7 @@ function Get-VbrBackupvSphereInfo { foreach ($HyObj in $HyObjs) { $Rows = @{ - IP = Get-NodeIP -Hostname $HyObjS.Name + IP = Get-NodeIP -Hostname $HyObj.Info.DnsName Version = $HyObj.Info.ViVersion } @@ -39,7 +39,7 @@ function Get-VbrBackupvSphereInfo { Childs = & { foreach ($Esxi in $HyObj.GetChilds() ) { $Rows = @{ - IP = Get-NodeIP -Hostname $Esxi.Name + IP = Get-NodeIP -Hostname $Esxi.Info.DnsName Version = $Esxi.Info.ViVersion } [PSCustomObject]@{ diff --git a/Veeam.Diagrammer.psd1 b/Veeam.Diagrammer.psd1 index e54da0d..419b06d 100644 --- a/Veeam.Diagrammer.psd1 +++ b/Veeam.Diagrammer.psd1 @@ -12,7 +12,7 @@ RootModule = 'Veeam.Diagrammer.psm1' # Version number of this module. - ModuleVersion = '0.6.12' + ModuleVersion = '0.6.13' # Supported PSEditions # CompatiblePSEditions = @() @@ -58,7 +58,7 @@ }, @{ ModuleName = 'Diagrammer.Core'; - ModuleVersion = '0.2.11'; + ModuleVersion = '0.2.12'; } ) From 1bff17f2dd0c7ccbeeb19761ae60fd28706449a9 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Mon, 11 Nov 2024 23:40:37 -0400 Subject: [PATCH 2/7] Add support for HyperVisor Information (Infrastructure Diagram) --- CHANGELOG.md | 5 +- Src/Private/Get-VbrBackupvSphereInfo.ps1 | 24 +++++--- Src/Private/Get-VbrInfraDiagram.ps1 | 70 ++++++++++++++++++------ Src/Private/Images.ps1 | 1 + 4 files changed, 72 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce123bf..f183790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add support for vCenter Information (Infrastructure Diagram) +- Add support for HyperVisor Information (Infrastructure Diagram) + - vCenter information + - vSphere Cluster Information + - Esxi Host information ### Changed diff --git a/Src/Private/Get-VbrBackupvSphereInfo.ps1 b/Src/Private/Get-VbrBackupvSphereInfo.ps1 index 5c473d5..dfc0c3e 100644 --- a/Src/Private/Get-VbrBackupvSphereInfo.ps1 +++ b/Src/Private/Get-VbrBackupvSphereInfo.ps1 @@ -26,7 +26,7 @@ function Get-VbrBackupvSphereInfo { $HyObjsInfo = @() if ($HyObjs) { foreach ($HyObj in $HyObjs) { - + $ESXis = Find-VBRViEntity -Server $HyObj | Where-Object { ($_.type -eq "esx") } $Rows = @{ IP = Get-NodeIP -Hostname $HyObj.Info.DnsName Version = $HyObj.Info.ViVersion @@ -37,15 +37,21 @@ function Get-VbrBackupvSphereInfo { Label = Get-DiaNodeIcon -Name $HyObj.Name -IconType "VBR_vCenter_Server" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug AditionalInfo = $Rows Childs = & { - foreach ($Esxi in $HyObj.GetChilds() ) { - $Rows = @{ - IP = Get-NodeIP -Hostname $Esxi.Info.DnsName - Version = $Esxi.Info.ViVersion - } + foreach ($Cluster in (Find-VBRViEntity -Server $HyObj | Where-Object { ($_.type -eq "cluster") }) ) { [PSCustomObject]@{ - Name = $Esxi.Name - Label = Get-DiaNodeIcon -Name $Esxi.Name -IconType "VBR_ESXi_Server" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug - AditionalInfo = $Rows + Name = $Cluster.Name + Label = Get-DiaNodeIcon -Name $Esxi.Name -IconType "VBR_vSphere_Cluster" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug + EsxiHost = foreach ($Esxi in $ESXis | Where-Object { $_.path -match $Cluster.Name }) { + $Rows = @{ + IP = Get-NodeIP -Hostname $Esxi.Info.DnsName + Version = $Esxi.Info.ViVersion + } + [PSCustomObject]@{ + Name = $Esxi.Name + Label = Get-DiaNodeIcon -Name $Esxi.Name -IconType "VBR_ESXi_Server" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug + AditionalInfo = $Rows + } + } } } } diff --git a/Src/Private/Get-VbrInfraDiagram.ps1 b/Src/Private/Get-VbrInfraDiagram.ps1 index 7f577de..0d7afe1 100644 --- a/Src/Private/Get-VbrInfraDiagram.ps1 +++ b/Src/Private/Get-VbrInfraDiagram.ps1 @@ -103,8 +103,8 @@ function Get-VbrInfraDiagram { } } - # HyperVisors Graphviz Cluster - if ($vSphereObj = Get-VbrBackupvSphereInfo) { + # vCenter Graphviz Cluster + if ($vSphereObj = Get-VbrBackupvSphereInfo | Sort-Object) { $vSphereNode = try { Node vCenterServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $vSphereObj.Name -Align "Center" -iconType "VBR_vCenter_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $vSphereObj.AditionalInfo -Subgraph -SubgraphLabel "vCenter Servers" -SubgraphLabelPos "top" -SubgraphIconType "VBR_vCenter_Server" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } } catch { @@ -116,7 +116,32 @@ function Get-VbrInfraDiagram { $vSphereNode } - SubGraph OnpremStorage -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Backup Infrastructure" -IconType "VBR_Veeam_Repository" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = 'dashed,rounded' } { + # vSphere Graphviz Cluster + $ViClustersNodes = @() + foreach ($vCenter in $vSphereObj) { + $ViClustersChildsNodes = try { + foreach ($ViCluster in $vCenter.Childs) { + Get-DiaHTMLTable -ImagesObj $Images -Rows $ViCluster.EsxiHost.Name -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold + } + } catch { + Write-PScriboMessage "Error: Unable to create vSphere Clusters Objects. Disabling the section" + Write-PScriboMessage "Error Message: $($_.Exception.Message)" + } + if ($ViClustersChildsNodes) { + $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vCenter_Server' -Label $vCenter.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2 + } + } + + if ($ViClustersNodes) { + $ViClustersSubgraphNode = Node -Name "ViCluster" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vSphere_Cluster' -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + + if ($ViClustersSubgraphNode) { + $ViClustersSubgraphNode + } + } + + # Repository Graphviz Cluster + SubGraph OnpremStorage -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Repository Infrastructure" -IconType "VBR_Veeam_Repository" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = 'dashed,rounded' } { # Repositories Graphviz Cluster if ($RepositoriesInfo = Get-VbrRepositoryInfo) { $RepositoriesNode = try { @@ -253,11 +278,6 @@ function Get-VbrInfraDiagram { } } if ($TapeServerInfo -and $TapeServerNode) { - # SubGraph TapeInfra -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Tape Infrastructure" -IconType "VBR_Tape" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = 'dashed,rounded' } { - - - # } - $TapeServerNode if ($TapeLibraryInfo -and $TapeLibraryNode) { @@ -272,17 +292,23 @@ function Get-VbrInfraDiagram { # ServiceProvider Graphviz Cluster if ($ServiceProviderInfo = Get-VbrServiceProviderInfo) { $ServiceProviderNode = try { - Node ServiceProvider @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ServiceProviderInfo.Name -Align "Center" -iconType "VBR_Service_Providers_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ServiceProviderInfo.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } + Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ServiceProviderInfo.Name -Align "Center" -iconType "VBR_Service_Providers_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ServiceProviderInfo.AditionalInfo } catch { Write-Verbose "Error: Unable to create ServiceProvider Objects. Disabling the section" Write-Verbose "Error Message: $($_.Exception.Message)" } } if ($ServiceProviderInfo -and $ServiceProviderNode) { - SubGraph ServiceProviders -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Service Providers" -IconType "VBR_Service_Providers" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } { - $ServiceProviderNode + $ServiceProviderSubgraphNode = try { + Node -Name ServiceProviders -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ServiceProviderNode -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Service_Providers' -Label 'Service Providers' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + } catch { + Write-Verbose "Error: Unable to create ServiceProviders SubGraph Objects. Disabling the section" + Write-Verbose "Error Message: $($_.Exception.Message)" + } + if ($ServiceProviderSubgraphNode) { + $ServiceProviderSubgraphNode } } @@ -504,13 +530,21 @@ function Get-VbrInfraDiagram { # Connect Veeam Proxies Server to the Dummy line if ($ProxiesSubgraphNode) { - Edge -From VBRProxyPoint -To Proxies @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } + Edge -From VBRProxyPoint -To Proxies @{minlen = 1; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } } + + # Connect vCenter Servers Cluster to the Dummy line if ($vSphereNode) { Edge -From Proxies -To vCenterServer @{minlen = 1; arrowtail = 'dot'; arrowhead = 'dot'; style = 'dashed' } } + + # Connect vSphere Cluster to the Dummy line + if ($vSphereNode -and $ViClustersSubgraphNode) { + Edge -From vCenterServer -To ViCluster @{minlen = 1; arrowtail = 'dot'; arrowhead = 'dot'; style = 'dashed' } + } + # Connect Veeam Repository to the Dummy line - Edge -From VBRRepoPoint -To Repositories @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } + Edge -From VBRRepoPoint -To Repositories @{minlen = 1; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } # Connect Veeam Object Repository to the Dummy line if ($ObjStorageSubgraphNode) { @@ -524,19 +558,19 @@ function Get-VbrInfraDiagram { # Connect Veeam Tape Infra to VBRTapePoint Dummy line if ($TapeServerInfo -and $TapeServerNode) { - Edge -From VBRTapePoint -To TapeServer @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } + Edge -From VBRTapePoint -To TapeServer @{minlen = 1; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } if ($TapeLibraryNode) { Rank TapeServer, TapeLibrary - Edge -From TapeServer -To TapeLibrary @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } + Edge -From TapeServer -To TapeLibrary @{minlen = 1; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } } if ($TapeVaultNode) { - Edge -From TapeLibrary -To TapeVault @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } + Edge -From TapeLibrary -To TapeVault @{minlen = 1; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' } } } # Connect Veeam ServiceProvider Infra to VBRServiceProviderPoint Dummy line - if ($ServiceProviderInfo -and $ServiceProviderNode) { - Edge -From ServiceProvider -To VBRServiceProviderPoint @{minlen = 2; arrowtail = 'dot'; arrowhead = 'none'; style = 'dashed' } + if ($ServiceProviderSubgraphNode) { + Edge -From ServiceProviders -To VBRServiceProviderPoint @{minlen = 2; arrowtail = 'dot'; arrowhead = 'none'; style = 'dashed' } } # Connect Veeam Object Repository to the Dummy line diff --git a/Src/Private/Images.ps1 b/Src/Private/Images.ps1 index 2e8f041..0ac7ebe 100644 --- a/Src/Private/Images.ps1 +++ b/Src/Private/Images.ps1 @@ -50,4 +50,5 @@ $script:Images = @{ "VBR_Virtual_Lab" = "Virtual_host.png" "VBR_SureBackup" = "SureBackup.png" "VBR_Application_Groups" = "Service-Application.png" + "VBR_vSphere_Cluster" = "Server_Cluster.png" } \ No newline at end of file From f0e4e2ebce2de1b5aa3fa82d37b07d7c4f9957c9 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 12 Nov 2024 16:36:56 -0400 Subject: [PATCH 3/7] Improve logging --- CHANGELOG.md | 1 + Src/Private/Get-DiagBackupServer.ps1 | 2 +- Src/Private/Get-DiagBackupToFileProxy.ps1 | 2 +- Src/Private/Get-DiagBackupToHvProxy.ps1 | 2 +- .../Get-DiagBackupToProtectedGroup.ps1 | 4 +- Src/Private/Get-DiagBackupToRepo.ps1 | 2 +- Src/Private/Get-DiagBackupToSobr.ps1 | 41 +++-- Src/Private/Get-DiagBackupToTape.ps1 | 34 ++--- Src/Private/Get-DiagBackupToViProxy.ps1 | 122 +-------------- Src/Private/Get-DiagBackupToWanAccel.ps1 | 6 +- Src/Private/Get-VbrBackupArchObjRepoInfo.ps1 | 2 +- Src/Private/Get-VbrBackupHyperVInfo.ps1 | 69 +++++++++ Src/Private/Get-VbrBackupObjectRepoInfo.ps1 | 2 +- .../Get-VbrBackupProtectedGroupInfo.ps1 | 2 +- Src/Private/Get-VbrBackupProxyInfo.ps1 | 2 +- Src/Private/Get-VbrBackupRepoInfo.ps1 | 2 +- Src/Private/Get-VbrBackupServerInfo.ps1 | 2 +- Src/Private/Get-VbrBackupSobrInfo.ps1 | 2 +- Src/Private/Get-VbrBackupTapeDrivesInfo.ps1 | 2 +- Src/Private/Get-VbrBackupTapeLibraryInfo.ps1 | 2 +- Src/Private/Get-VbrBackupTapeServerInfo.ps1 | 2 +- Src/Private/Get-VbrBackupWanAccelInfo.ps1 | 2 +- Src/Private/Get-VbrBackupvSphereInfo.ps1 | 2 +- Src/Private/Get-VbrDiagramObjects.ps1 | 22 +-- Src/Private/Get-VbrInfraDiagram.ps1 | 142 +++++++++--------- Src/Private/Get-VbrServerConnection.ps1 | 4 +- 26 files changed, 216 insertions(+), 261 deletions(-) create mode 100644 Src/Private/Get-VbrBackupHyperVInfo.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index f183790..a1865da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Increase Diagrammer.Core minimum version requirement +- Improve logging ## [0.6.12] - 2024-10-30 diff --git a/Src/Private/Get-DiagBackupServer.ps1 b/Src/Private/Get-DiagBackupServer.ps1 index f118f9d..2e10907 100644 --- a/Src/Private/Get-DiagBackupServer.ps1 +++ b/Src/Private/Get-DiagBackupServer.ps1 @@ -135,7 +135,7 @@ function Get-DiagBackupServer { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToFileProxy.ps1 b/Src/Private/Get-DiagBackupToFileProxy.ps1 index 42ea613..ba2cb01 100644 --- a/Src/Private/Get-DiagBackupToFileProxy.ps1 +++ b/Src/Private/Get-DiagBackupToFileProxy.ps1 @@ -37,7 +37,7 @@ function Get-DiagBackupToFileProxy { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToHvProxy.ps1 b/Src/Private/Get-DiagBackupToHvProxy.ps1 index c5c80a4..6d49602 100644 --- a/Src/Private/Get-DiagBackupToHvProxy.ps1 +++ b/Src/Private/Get-DiagBackupToHvProxy.ps1 @@ -36,7 +36,7 @@ function Get-DiagBackupToHvProxy { } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToProtectedGroup.ps1 b/Src/Private/Get-DiagBackupToProtectedGroup.ps1 index b82d0a8..2e9ea23 100644 --- a/Src/Private/Get-DiagBackupToProtectedGroup.ps1 +++ b/Src/Private/Get-DiagBackupToProtectedGroup.ps1 @@ -55,7 +55,7 @@ function Get-DiagBackupToProtectedGroup { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } if ($ProtectedGroups.Container) { @@ -343,7 +343,7 @@ function Get-DiagBackupToProtectedGroup { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToRepo.ps1 b/Src/Private/Get-DiagBackupToRepo.ps1 index 8d01a54..cbfb1f1 100644 --- a/Src/Private/Get-DiagBackupToRepo.ps1 +++ b/Src/Private/Get-DiagBackupToRepo.ps1 @@ -83,7 +83,7 @@ function Get-DiagBackupToRepo { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToSobr.ps1 b/Src/Private/Get-DiagBackupToSobr.ps1 index 94fbd3d..08e0b28 100644 --- a/Src/Private/Get-DiagBackupToSobr.ps1 +++ b/Src/Private/Get-DiagBackupToSobr.ps1 @@ -5,7 +5,7 @@ function Get-DiagBackupToSobr { .DESCRIPTION Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph. .NOTES - Version: 0.6.10 + Version: 0.6.13 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -43,12 +43,11 @@ function Get-DiagBackupToSobr { } if ($SOBROBJ.Performance) { - - $Performance = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Performance.Name -Align "Center" -iconType $SOBROBJ.Performance.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Performance.AditionalInfo -Subgraph -SubgraphLabel "Performance Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $Performance = Get-DiaHTMLNodeTable -ImagesObj $Image -inputObject $SOBROBJ.Performance.Name -Align "Center" -iconType $SOBROBJ.Performance.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Performance.AditionalInfo -Subgraph -SubgraphLabel "Performance Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create SOBR Performance Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($Performance) { @@ -57,11 +56,11 @@ function Get-DiagBackupToSobr { } if ($SOBROBJ.Capacity) { - $Capacity = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Capacity.Name -Align "Center" -iconType $SOBROBJ.Capacity.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Capacity.AditionalInfo -Subgraph -SubgraphLabel "Capacity Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $Capacity = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Capacity.Name -Align "Center" -iconType $SOBROBJ.Capacity.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Capacity.AditionalInfo -Subgraph -SubgraphLabel "Capacity Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create SOBR Capacity Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($Capacity) { @@ -70,12 +69,12 @@ function Get-DiagBackupToSobr { } if ($SOBROBJ.Archive) { - $Archive = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Archive.Name -Align "Center" -iconType $SOBROBJ.Archive.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Archive.AditionalInfo -Subgraph -SubgraphLabel "Archive Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $Archive = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Archive.Name -Align "Center" -iconType $SOBROBJ.Archive.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Archive.AditionalInfo -Subgraph -SubgraphLabel "Archive Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create SOBR Archive Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($Archive) { @@ -83,22 +82,22 @@ function Get-DiagBackupToSobr { } } - $SOBRExtentSubgraphNode = try { - Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRExtentNodesArray -Align 'Center' -IconDebug $IconDebug -Label 'Extents' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3 + try { + $SOBRExtentSubgraphNode = Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRExtentNodesArray -Align 'Center' -IconDebug $IconDebug -Label 'Extents' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3 } catch { Write-Verbose "Error: Unable to create SOBR Extents SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($SOBRExtentSubgraphNode) { $SOBRNodesArray += $SOBRExtentSubgraphNode } - $SOBRSubgraphNode = try { - Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRNodesArray -Align 'Center' -IconDebug $IconDebug -Label $SOBROBJ.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 + try { + $SOBRSubgraphNode = Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRNodesArray -Align 'Center' -IconDebug $IconDebug -Label $SOBROBJ.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 } catch { Write-Verbose "Error: Unable to create SOBR SubGraph Nodes Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($SOBRSubgraphNode) { @@ -106,11 +105,11 @@ function Get-DiagBackupToSobr { } } - $SOBRSubgraph = try { - Node -Name SOBRRepo -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRArray -Align 'Center' -IconDebug $IconDebug -Label 'SOBR Repositories' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $SOBRSubgraph = Node -Name SOBRRepo -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRArray -Align 'Center' -IconDebug $IconDebug -Label 'SOBR Repositories' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create SOBR SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($SOBRSubgraph) { @@ -122,7 +121,7 @@ function Get-DiagBackupToSobr { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToTape.ps1 b/Src/Private/Get-DiagBackupToTape.ps1 index fce1b57..059e505 100644 --- a/Src/Private/Get-DiagBackupToTape.ps1 +++ b/Src/Private/Get-DiagBackupToTape.ps1 @@ -5,7 +5,7 @@ function Get-DiagBackupToTape { .DESCRIPTION Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph. .NOTES - Version: 0.6.10 + Version: 0.6.13 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -55,12 +55,12 @@ function Get-DiagBackupToTape { $TapeLibraryDrives = ($BackupTapeDrives | Where-Object { $_.LibraryId -eq $TSLibraryOBJ.Id } | Sort-Object -Property Name) - $TapeLibraryDrivesNode = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeLibraryDrives.Name -Align "Center" -iconType "VBR_Tape_Drive" -columnSize $TapeLibraryDrives.Name.Count -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeLibraryDrives.AditionalInfo -Subgraph -SubgraphLabel "Tape Drives" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $TapeLibraryDrivesNode = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeLibraryDrives.Name -Align "Center" -iconType "VBR_Tape_Drive" -columnSize $TapeLibraryDrives.Name.Count -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeLibraryDrives.AditionalInfo -Subgraph -SubgraphLabel "Tape Drives" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create Tape Library Drives Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($TapeLibraryDrivesNode) { @@ -68,11 +68,11 @@ function Get-DiagBackupToTape { } } - $TapeLibrarySubgraph = try { - Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeLibraryNodesArray -Align 'Center' -IconDebug $IconDebug -Label "Tape Library" -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 + try { + $TapeLibrarySubgraph = Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeLibraryNodesArray -Align 'Center' -IconDebug $IconDebug -Label "Tape Library" -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 } catch { Write-Verbose "Error: Unable to create Tape Library SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($TapeLibrarySubgraph) { @@ -81,11 +81,11 @@ function Get-DiagBackupToTape { } } - $TapeLibrarySubgraphArray = try { - Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeNodesArray -Align 'Center' -IconDebug $IconDebug -Label " " -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "0" -columnSize 3 + try { + $TapeLibrarySubgraphArray = Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeNodesArray -Align 'Center' -IconDebug $IconDebug -Label " " -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "0" -columnSize 3 } catch { Write-Verbose "Error: Unable to create Tape Library SubGraph Array Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($TapeServerNode) { @@ -96,22 +96,22 @@ function Get-DiagBackupToTape { $TapeLibrarySubArrayTable += $TapeLibrarySubgraphArray } - $TapeServerSubgraph = try { - Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeLibrarySubArrayTable -Align 'Center' -IconDebug $IconDebug -Label $TSOBJ.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 + try { + $TapeServerSubgraph = Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeLibrarySubArrayTable -Align 'Center' -IconDebug $IconDebug -Label $TSOBJ.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 } catch { Write-Verbose "Error: Unable to create Tape Server SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($TapeServerSubgraph) { $TapeArray += $TapeServerSubgraph } } - $TapeSubgraph = try { - Node -Name Tape -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeArray -Align 'Center' -IconDebug $IconDebug -Label 'Tape Servers' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $TapeSubgraph = Node -Name Tape -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeArray -Align 'Center' -IconDebug $IconDebug -Label 'Tape Servers' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create Tape SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($TapeSubgraph) { $TapeSubgraph @@ -120,7 +120,7 @@ function Get-DiagBackupToTape { } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToViProxy.ps1 b/Src/Private/Get-DiagBackupToViProxy.ps1 index 926af92..d6230c0 100644 --- a/Src/Private/Get-DiagBackupToViProxy.ps1 +++ b/Src/Private/Get-DiagBackupToViProxy.ps1 @@ -5,7 +5,7 @@ function Get-DiagBackupToViProxy { .DESCRIPTION Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph. .NOTES - Version: 0.6.9 + Version: 0.6.13 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -34,128 +34,10 @@ function Get-DiagBackupToViProxy { Edge $BackupServerInfo.Name -To ViProxies:n @{minlen = 3 } - - # $VirtObjs = Get-VBRServer | Where-Object {$_.Type -eq 'VC'} - # $EsxiObjs = Get-VBRServer | Where-Object {$_.Type -eq 'Esxi' -and $_.IsStandaloneEsx() -eq 'True'} - # SubGraph MainVMwareProxies -Attributes @{Label=$DiagramLabel; style='dashed,rounded'; color=$SubGraphDebug.color; fontsize=18; penwidth=1.5} { - # node DummyVMwareProxy @{Label='VMwareProxyMain'; shape='plain'; style=$EdgeDebug.style; color=$EdgeDebug.color} - # foreach ($ProxyObj in ($VMwareBackupProxy | Sort-Object)) { - # $PROXYHASHTABLE = @{} - # $ProxyObj.psobject.properties | ForEach-Object { $PROXYHASHTABLE[$_.Name] = $_.Value } - # node $ProxyObj -NodeScript {$_.Name} @{Label=$PROXYHASHTABLE.Label} - # edge -From DummyVMwareProxy -To $ProxyObj.Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # } - # # if ($VirtObjs -or $EsxiObjs) { - # # # Dummy Node used for subgraph centering (Always hidden) - # # node VMWAREBackupProxyMain @{Label='VMWAREBackupProxyMain'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'} - # # # Edge Lines from VMware Backup Proxies to Dummy Node VMWAREBackupProxyMain - # # edge -from ($VMwareBackupProxy | Sort-Object).Name -to VMWAREBackupProxyMain:n @{style=$EdgeDebug.style; color=$EdgeDebug.color;} - # # } - # } - - # if ($VirtObjs -or $EsxiObjs) { - # SubGraph vSphereMAIN -Attributes @{Label='vSphere Infrastructure'; style='dashed,rounded'; color=$SubGraphDebug.color; penwidth=1} { - # if ($EsxiObjs) { - # SubGraph ESXiMAIN -Attributes @{Label='Standalone Servers'; style='dashed,rounded'; color=$SubGraphDebug.color; fontsize=18; penwidth=1} { - # # Dummy Node used for subgraph centering - # node ESXiBackupProxy @{Label='ESXiBackupProxy'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'} - # if (($EsxiObjs | Measure-Object).count -le 4) { - # foreach ($ESxiHost in $EsxiObjs) { - # $ESXiInfo = @{ - # Version = $ESxiHost.Info.ViVersion.ToString() - # IP = try {$ESxiHost.getManagmentAddresses().IPAddressToString} catch {"Unknown"} - # } - # node $ESxiHost.Name @{Label=(Get-NodeIcon -Name $ESxiHost.Name -IconType 'VBR_ESXi_Server' -Align "Center" -Rows $ESXiInfo)} - # edge -From ESXiBackupProxy:s -To $ESxiHost.Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # } - # } - # else { - # $Group = Split-array -inArray $EsxiObjs -size 4 - # $Number = 0 - # while ($Number -ne $Group.Length) { - # $Random = Get-Random - # SubGraph "SAESXiGroup$($Number)_$Random" -Attributes @{Label=' '; style=$SubGraphDebug.style; color=$SubGraphDebug.color; fontsize=18; penwidth=1} { - # $Group[$Number] | ForEach-Object { node $_.Name @{Label=(Get-NodeIcon -Name $_.Name -IconType 'VBR_ESXi_Server' -Align "Center" -Rows ($ESXiInfo = @{Version = $_.Info.ViVersion.ToString(); IP = try {$_.getManagmentAddresses().IPAddressToString} catch {"Unknown"}})) }} - # } - # $Number++ - # } - # edge -From ESXiBackupProxy:n -To $Group[0].Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # $Start = 0 - # $ESXiNum = 1 - # while ($ESXiNum -ne $Group.Length) { - # edge -From $Group[$Start].Name -To $Group[$ESXiNum].Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # $Start++ - # $ESXiNum++ - # } - # } - # } - # if ($EsxiObjs) { - # edge -from vSphereInfraDummy:s -to ESXiBackupProxy:n @{minlen=2; style='dashed'} - # } - # } - - # # Dummy Node used for subgraph centering - # node vSphereInfraDummy @{Label='vSphereInfraDummy'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='box'} - # edge -from VMWAREBackupProxyMain:s -to vSphereInfraDummy:n @{minlen=2; style=$EdgeDebug.style; color=$EdgeDebug.color} - - # if ($VirtObjs) { - # SubGraph VCENTERMAIN -Attributes @{Label='VMware vCenter Servers'; style='dashed,rounded'; color=$SubGraphDebug.color; fontsize=18; penwidth=1} { - # # Dummy Node used for subgraph centering - # node vCenterServers @{Label='vCenterServers'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'} - # foreach ($VirtManager in ($VirtObjs | Sort-Object)) { - # $VCInfo = @{ - # Version = $VirtManager.Info.ViVersion.ToString() - # IP = try {$VirtManager.getManagmentAddresses().IPAddressToString} catch {"Unknown"} - # } - # $vCenterSubGraphName = Remove-SpecialChar -String $VirtManager.Name -SpecialChars '\-. ' - # SubGraph $vCenterSubGraphName -Attributes @{Label=' '; style=$SubGraphDebug.style; color=$SubGraphDebug.color; fontsize=18; penwidth=1} { - # node $VirtManager.Name @{Label=(Get-NodeIcon -Name $VirtManager.Name -IconType 'VBR_vCenter_Server' -Align "Center" -Rows $VCInfo)} - # # foreach ($ESXi in $VirtManager.getchilds()) { - # if ($VirtManager.getchilds().Length -le 4) { - # # Dummy Node used for subgraph centering - # foreach ($ESXi in $VirtManager.getchilds()) { - # $ESXiInfo = @{ - # Version = $ESxi.Info.ViVersion.ToString() - # IP = try {$ESxi.getManagmentAddresses().IPAddressToString} catch {"Unknown"} - # } - # node $ESXi.Name @{Label=(Get-NodeIcon -Name $ESXi.Name -IconType 'VBR_ESXi_Server' -Align "Center" -Rows $ESXiInfo)} - # edge -From "$($VirtManager.Name):s" -To $ESXi.Name @{style='dashed'} - # } - # } - # else { - # $EsxiHosts = $VirtManager.getchilds() - # $Group = Split-array -inArray $EsxiHosts -size 4 - # $Number = 0 - # while ($Number -ne $Group.Length) { - # $Random = Get-Random - # SubGraph "ESXiGroup$($Number)_$Random" -Attributes @{Label=' '; style=$SubGraphDebug.style; color=$SubGraphDebug.color; fontsize=18; penwidth=1} { - # $Group[$Number] | ForEach-Object { node $_.Name @{Label=(Get-NodeIcon -Name $_.Name -IconType 'VBR_ESXi_Server' -Align "Center" -Rows ($ESXiInfo = @{Version = $_.Info.ViVersion.ToString(); IP = try {$_.getManagmentAddresses().IPAddressToString} catch {"Unknown"}}))}} - # } - # $Number++ - # } - # edge -From $VirtManager.Name -To $Group[0].Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # $Start = 0 - # $ESXiNum = 1 - # while ($ESXiNum -ne $Group.Length) { - # edge -From $Group[$Start].Name -To $Group[$ESXiNum].Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # $Start++ - # $ESXiNum++ - # } - # } - # } - # } - # } - # # Edge Lines from Dummy Node vCenter Servers to Dummy Node vSphere Virtual Infrastructure - # edge -from vCenterServers:s -to $VirtObjs.Name @{style=$EdgeDebug.style; color=$EdgeDebug.color} - # # Edge Lines from Dummy Node vSphere Virtual Infrastructure to Dummy Node vCenter Servers - # edge -from vSphereInfraDummy:s -to vCenterServers:n @{minlen=2; style='dashed'} - # } - # } - # } } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-DiagBackupToWanAccel.ps1 b/Src/Private/Get-DiagBackupToWanAccel.ps1 index 6c67464..f24fc4e 100644 --- a/Src/Private/Get-DiagBackupToWanAccel.ps1 +++ b/Src/Private/Get-DiagBackupToWanAccel.ps1 @@ -26,20 +26,16 @@ function Get-DiagBackupToWanAccel { process { try { - $WanAccel = Get-VbrBackupWanAccelInfo - if ($BackupServerInfo) { if ($WanAccel) { - Node WanAccelServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($WanAccel | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Wan_Accel" -columnSize 4 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($WanAccel.AditionalInfo ) -Subgraph -SubgraphIconType "VBR_Wan_Accel" -SubgraphLabel "Wan Accelerators" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1"); shape = 'plain'; fontsize = 14; fontname = "Segoe Ui" } Edge $BackupServerInfo.Name -To WanAccelServer @{minlen = 3; } - } } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupArchObjRepoInfo.ps1 b/Src/Private/Get-VbrBackupArchObjRepoInfo.ps1 index 37edc6a..4bef335 100644 --- a/Src/Private/Get-VbrBackupArchObjRepoInfo.ps1 +++ b/Src/Private/Get-VbrBackupArchObjRepoInfo.ps1 @@ -73,7 +73,7 @@ function Get-VbrBackupArchObjRepoInfo { return $ArchObjStorageInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupHyperVInfo.ps1 b/Src/Private/Get-VbrBackupHyperVInfo.ps1 new file mode 100644 index 0000000..bf164a3 --- /dev/null +++ b/Src/Private/Get-VbrBackupHyperVInfo.ps1 @@ -0,0 +1,69 @@ +function Get-VbrBackupHyperVInfo { + <# + .SYNOPSIS + Function to extract veeam backup & replication hyperv hypervisor information. + .DESCRIPTION + Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph. + .NOTES + Version: 0.6.12 + Author: Jonathan Colon + Twitter: @jcolonfzenpr + Github: rebelinux + .LINK + https://github.com/rebelinux/Veeam.Diagrammer + #> + [CmdletBinding()] + [OutputType([System.Object[]])] + + Param + ( + + ) + process { + Write-Verbose -Message "Collecting HyperV HyperVisor information from $($VBRServer.Name)." + try { + $HyObjs = Get-VBRServer | Where-Object { $_.Type -eq 'HvCluster' } + $HyObjsInfo = @() + if ($HyObjs) { + foreach ($HyObj in $HyObjs) { + $HvHosts = Find-VBRHvEntity -Server $HyObj | Where-Object { ($_.type -eq "HvServer") } + $Rows = @{ + IP = Get-NodeIP -Hostname $HyObj.Info.DnsName + Version = $HyObj.Info.HvVersion + } + + $TempHyObjsInfo = [PSCustomObject]@{ + Name = $HyObj.Name + Label = Get-DiaNodeIcon -Name $HyObj.Name -IconType "VBR_HyperV_Server" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug + AditionalInfo = $Rows + Childs = & { + foreach ($Cluster in (Find-VBRHvEntity -Server $HyObj | Where-Object { ($_.type -eq "cluster") }) ) { + [PSCustomObject]@{ + Name = $Cluster.Name + Label = Get-DiaNodeIcon -Name $HvHosts.Name -IconType "VBR_HyperV_Server" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug + EsxiHost = foreach ($HvHost in $HvHosts | Where-Object {$_.path -match $Cluster.Name}) { + $Rows = @{ + IP = Get-NodeIP -Hostname $HvHosts.Info.DnsName + Version = $HvHosts.Info.HvVersion + } + [PSCustomObject]@{ + Name = $HvHosts.Name + Label = Get-DiaNodeIcon -Name $HvHosts.Name -IconType "VBR_HyperV_Server" -Align "Center" -Rows $Rows -ImagesObj $Images -IconDebug $IconDebug + AditionalInfo = $Rows + } + } + } + } + } + } + $HyObjsInfo += $TempHyObjsInfo + } + } + + return $HyObjsInfo + } catch { + Write-Verbose -Message $_.Exception.Message + } + } + end {} +} \ No newline at end of file diff --git a/Src/Private/Get-VbrBackupObjectRepoInfo.ps1 b/Src/Private/Get-VbrBackupObjectRepoInfo.ps1 index e5c8120..83751c7 100644 --- a/Src/Private/Get-VbrBackupObjectRepoInfo.ps1 +++ b/Src/Private/Get-VbrBackupObjectRepoInfo.ps1 @@ -70,7 +70,7 @@ function Get-VbrBackupObjectRepoInfo { return $ObjStorageInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupProtectedGroupInfo.ps1 b/Src/Private/Get-VbrBackupProtectedGroupInfo.ps1 index fc357b0..f131b51 100644 --- a/Src/Private/Get-VbrBackupProtectedGroupInfo.ps1 +++ b/Src/Private/Get-VbrBackupProtectedGroupInfo.ps1 @@ -52,7 +52,7 @@ function Get-VbrBackupProtectedGroupInfo { return $ProtectedGroupInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupProxyInfo.ps1 b/Src/Private/Get-VbrBackupProxyInfo.ps1 index e082e66..a4e39d7 100644 --- a/Src/Private/Get-VbrBackupProxyInfo.ps1 +++ b/Src/Private/Get-VbrBackupProxyInfo.ps1 @@ -104,7 +104,7 @@ function Get-VbrBackupProxyInfo { return $BackupProxyInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupRepoInfo.ps1 b/Src/Private/Get-VbrBackupRepoInfo.ps1 index 7c9208f..dcd090c 100644 --- a/Src/Private/Get-VbrBackupRepoInfo.ps1 +++ b/Src/Private/Get-VbrBackupRepoInfo.ps1 @@ -77,7 +77,7 @@ function Get-VbrBackupRepoInfo { return $BackupRepoInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupServerInfo.ps1 b/Src/Private/Get-VbrBackupServerInfo.ps1 index 15380f9..3fbf7b3 100644 --- a/Src/Private/Get-VbrBackupServerInfo.ps1 +++ b/Src/Private/Get-VbrBackupServerInfo.ps1 @@ -144,7 +144,7 @@ function Get-VbrBackupServerInfo { Write-Verbose "Unabe to create EMServer Object" } } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end { diff --git a/Src/Private/Get-VbrBackupSobrInfo.ps1 b/Src/Private/Get-VbrBackupSobrInfo.ps1 index 40b03d7..426f71b 100644 --- a/Src/Private/Get-VbrBackupSobrInfo.ps1 +++ b/Src/Private/Get-VbrBackupSobrInfo.ps1 @@ -144,7 +144,7 @@ function Get-VbrBackupSobrInfo { return $SobrInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupTapeDrivesInfo.ps1 b/Src/Private/Get-VbrBackupTapeDrivesInfo.ps1 index f2006ba..62c92ad 100644 --- a/Src/Private/Get-VbrBackupTapeDrivesInfo.ps1 +++ b/Src/Private/Get-VbrBackupTapeDrivesInfo.ps1 @@ -53,7 +53,7 @@ function Get-VbrBackupTapeDrivesInfo { return $BackupTapeDriveInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupTapeLibraryInfo.ps1 b/Src/Private/Get-VbrBackupTapeLibraryInfo.ps1 index ea15df7..edd27fd 100644 --- a/Src/Private/Get-VbrBackupTapeLibraryInfo.ps1 +++ b/Src/Private/Get-VbrBackupTapeLibraryInfo.ps1 @@ -51,7 +51,7 @@ function Get-VbrBackupTapeLibraryInfo { return $BackupTapelibraryInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupTapeServerInfo.ps1 b/Src/Private/Get-VbrBackupTapeServerInfo.ps1 index ba99291..376c7bd 100644 --- a/Src/Private/Get-VbrBackupTapeServerInfo.ps1 +++ b/Src/Private/Get-VbrBackupTapeServerInfo.ps1 @@ -50,7 +50,7 @@ function Get-VbrBackupTapeServerInfo { return $BackupTapeServersInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupWanAccelInfo.ps1 b/Src/Private/Get-VbrBackupWanAccelInfo.ps1 index d093601..0668483 100644 --- a/Src/Private/Get-VbrBackupWanAccelInfo.ps1 +++ b/Src/Private/Get-VbrBackupWanAccelInfo.ps1 @@ -50,7 +50,7 @@ function Get-VbrBackupWanAccelInfo { return $WANACCELInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrBackupvSphereInfo.ps1 b/Src/Private/Get-VbrBackupvSphereInfo.ps1 index dfc0c3e..65c4ce2 100644 --- a/Src/Private/Get-VbrBackupvSphereInfo.ps1 +++ b/Src/Private/Get-VbrBackupvSphereInfo.ps1 @@ -62,7 +62,7 @@ function Get-VbrBackupvSphereInfo { return $HyObjsInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } end {} diff --git a/Src/Private/Get-VbrDiagramObjects.ps1 b/Src/Private/Get-VbrDiagramObjects.ps1 index dcd79c3..4ff4914 100644 --- a/Src/Private/Get-VbrDiagramObjects.ps1 +++ b/Src/Private/Get-VbrDiagramObjects.ps1 @@ -38,7 +38,7 @@ function Get-VbrProxyInfo { return $ProxiesInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -82,7 +82,7 @@ function Get-VbrNASProxyInfo { return $ProxiesInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -117,7 +117,7 @@ function Get-VbrWanAccelInfo { return $WanAccelsInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -315,7 +315,7 @@ function Get-VbrSOBRInfo { return $SOBRInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -361,7 +361,7 @@ function Get-VbrSANInfo { return $SANHostInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -400,7 +400,7 @@ function Get-VbrTapeServersInfo { return $TapeServernfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -436,7 +436,7 @@ function Get-VbrTapeLibraryInfo { return $TapeLibrariesInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -474,7 +474,7 @@ function Get-VbrTapeVaultInfo { return $TapeVaultsInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -518,7 +518,7 @@ function Get-VbrServiceProviderInfo { return $ServiceProvidersInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -559,7 +559,7 @@ function Get-VbrVirtualLabInfo { return $VirtualLabInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } @@ -595,6 +595,6 @@ function Get-VbrApplicationGroupsInfo { return $ApplicationGroupsInfo } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message } } \ No newline at end of file diff --git a/Src/Private/Get-VbrInfraDiagram.ps1 b/Src/Private/Get-VbrInfraDiagram.ps1 index 0d7afe1..338ebc8 100644 --- a/Src/Private/Get-VbrInfraDiagram.ps1 +++ b/Src/Private/Get-VbrInfraDiagram.ps1 @@ -5,7 +5,7 @@ function Get-VbrInfraDiagram { .DESCRIPTION Diagram the configuration of Veeam Backup & Replication infrastructure in PDF/SVG/DOT/PNG formats using PSGraph and Graphviz. .NOTES - Version: 0.6.12 + Version: 0.6.13 Author(s): Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -43,26 +43,26 @@ function Get-VbrInfraDiagram { # Proxy Graphviz Cluster if ($Proxies = Get-VbrProxyInfo) { - $ProxiesVi = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject (($Proxies | Where-Object { $_.AditionalInfo.Type -eq "vSphere" }) | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($Proxies.AditionalInfo | Where-Object { $_.Type -eq "vSphere" }) -Subgraph -SubgraphIconType "VBR_vSphere" -SubgraphLabel "VMware Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $ProxiesVi = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject (($Proxies | Where-Object { $_.AditionalInfo.Type -eq "vSphere" }) | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($Proxies.AditionalInfo | Where-Object { $_.Type -eq "vSphere" }) -Subgraph -SubgraphIconType "VBR_vSphere" -SubgraphLabel "VMware Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create ProxiesVSphere Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } - $ProxiesHv = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject (($Proxies | Where-Object { $_.AditionalInfo.Type -eq "Off host" -or $_.AditionalInfo.Type -eq "On host" }).Name | ForEach-Object { $_.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($Proxies.AditionalInfo | Where-Object { $_.Type -eq "Off host" -or $_.Type -eq "On host" }) -Subgraph -SubgraphIconType "VBR_HyperV" -SubgraphLabel "Hyper-V Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $ProxiesHv = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject (($Proxies | Where-Object { $_.AditionalInfo.Type -eq "Off host" -or $_.AditionalInfo.Type -eq "On host" }).Name | ForEach-Object { $_.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($Proxies.AditionalInfo | Where-Object { $_.Type -eq "Off host" -or $_.Type -eq "On host" }) -Subgraph -SubgraphIconType "VBR_HyperV" -SubgraphLabel "Hyper-V Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create ProxiesHyperV Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($NASProxies = Get-VbrNASProxyInfo) { - $ProxiesNas = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject (($NASProxies).Name | ForEach-Object { $_.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($NASProxies.AditionalInfo) -Subgraph -SubgraphIconType "VBR_NAS" -SubgraphLabel "NAS Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $ProxiesNas = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject (($NASProxies).Name | ForEach-Object { $_.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($NASProxies.AditionalInfo) -Subgraph -SubgraphIconType "VBR_NAS" -SubgraphLabel "NAS Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create ProxiesNas Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } } @@ -85,11 +85,11 @@ function Get-VbrInfraDiagram { $ProxyNodesArray += $ProxiesNas } - $ProxiesSubgraphNode = try { - Node -Name "Proxies" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ProxyNodesArray -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Proxy' -Label 'Backup Proxies' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $ProxiesSubgraphNode = Node -Name "Proxies" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ProxyNodesArray -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Proxy' -Label 'Backup Proxies' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create SureBackup SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($ProxiesSubgraphNode) { @@ -105,27 +105,30 @@ function Get-VbrInfraDiagram { # vCenter Graphviz Cluster if ($vSphereObj = Get-VbrBackupvSphereInfo | Sort-Object) { - $vSphereNode = try { - Node vCenterServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $vSphereObj.Name -Align "Center" -iconType "VBR_vCenter_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $vSphereObj.AditionalInfo -Subgraph -SubgraphLabel "vCenter Servers" -SubgraphLabelPos "top" -SubgraphIconType "VBR_vCenter_Server" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } + try { + $vSphereNode = Node vCenterServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $vSphereObj.Name -Align "Center" -iconType "VBR_vCenter_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $vSphereObj.AditionalInfo -Subgraph -SubgraphLabel "vCenter Servers" -SubgraphLabelPos "top" -SubgraphIconType "VBR_vCenter_Server" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create vSphere HyperVisors Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } + } else { + Write-Verbose "Info: No vCenter information to diagram" } - if ($vSphereObj -and $vSphereNode) { + + if ($vSphereNode) { $vSphereNode } # vSphere Graphviz Cluster $ViClustersNodes = @() foreach ($vCenter in $vSphereObj) { - $ViClustersChildsNodes = try { - foreach ($ViCluster in $vCenter.Childs) { + try { + $ViClustersChildsNodes = foreach ($ViCluster in $vCenter.Childs) { Get-DiaHTMLTable -ImagesObj $Images -Rows $ViCluster.EsxiHost.Name -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold } } catch { - Write-PScriboMessage "Error: Unable to create vSphere Clusters Objects. Disabling the section" - Write-PScriboMessage "Error Message: $($_.Exception.Message)" + Write-Verbose "Error: Unable to create vSphere Clusters Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($ViClustersChildsNodes) { $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vCenter_Server' -Label $vCenter.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2 @@ -133,7 +136,12 @@ function Get-VbrInfraDiagram { } if ($ViClustersNodes) { - $ViClustersSubgraphNode = Node -Name "ViCluster" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vSphere_Cluster' -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $ViClustersSubgraphNode = Node -Name "ViCluster" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vSphere_Cluster' -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + } catch { + Write-Verbose "Error: Unable to create ViCluster Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" + } if ($ViClustersSubgraphNode) { $ViClustersSubgraphNode @@ -144,11 +152,11 @@ function Get-VbrInfraDiagram { SubGraph OnpremStorage -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Repository Infrastructure" -IconType "VBR_Veeam_Repository" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = 'dashed,rounded' } { # Repositories Graphviz Cluster if ($RepositoriesInfo = Get-VbrRepositoryInfo) { - $RepositoriesNode = try { - Node Repositories @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $RepositoriesInfo.Name -Align "Center" -iconType $RepositoriesInfo.IconType -columnSize 4 -IconDebug $IconDebug -MultiIcon -AditionalInfo $RepositoriesInfo.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } + try { + $RepositoriesNode = Node Repositories @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $RepositoriesInfo.Name -Align "Center" -iconType $RepositoriesInfo.IconType -columnSize 4 -IconDebug $IconDebug -MultiIcon -AditionalInfo $RepositoriesInfo.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create Repositories Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } if ($RepositoriesInfo -and $RepositoriesNode) { @@ -166,11 +174,11 @@ function Get-VbrInfraDiagram { # SOBR Graphviz Cluster if ($SOBR = Get-VbrSOBRInfo) { - $SOBRNode = try { - Node SOBRRepo @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBR.Name -Align "Center" -iconType "VBR_SOBR_Repo" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBR.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } + try { + $SOBRNode = Node SOBRRepo @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBR.Name -Align "Center" -iconType "VBR_SOBR_Repo" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBR.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create SOBR Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } @@ -182,11 +190,11 @@ function Get-VbrInfraDiagram { # SAN Infrastructure Graphviz Cluster if ($SAN = Get-VbrSANInfo) { - $SANNode = try { - Node SANRepo @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SAN.Name -Align "Center" -iconType $SAN.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SAN.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } + try { + $SANNode = Node SANRepo @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SAN.Name -Align "Center" -iconType $SAN.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SAN.AditionalInfo); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create SAN Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } @@ -199,21 +207,21 @@ function Get-VbrInfraDiagram { # Object Repositories Graphviz Cluster if ($ObjectRepositoriesInfo = Get-VbrObjectRepoInfo) { - $ObjectRepositoriesNode = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ObjectRepositoriesInfo.Name -Align "Center" -iconType $ObjectRepositoriesInfo.Icontype -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ObjectRepositoriesInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_vSphere" -SubgraphLabel "Object Repositories" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $ObjectRepositoriesNode = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ObjectRepositoriesInfo.Name -Align "Center" -iconType $ObjectRepositoriesInfo.Icontype -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ObjectRepositoriesInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_vSphere" -SubgraphLabel "Object Repositories" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create ObjectRepositories Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } # Archive Object Repositories Graphviz Cluster if ($ArchObjRepositoriesInfo = Get-VbrArchObjectRepoInfo) { - $ArchObjRepositoriesNode = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ArchObjRepositoriesInfo.Name -Align "Center" -iconType $ArchObjRepositoriesInfo.Icontype -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ArchObjRepositoriesInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_vSphere" -SubgraphLabel "Archives Object Repositories" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $ArchObjRepositoriesNode = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ArchObjRepositoriesInfo.Name -Align "Center" -iconType $ArchObjRepositoriesInfo.Icontype -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ArchObjRepositoriesInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_vSphere" -SubgraphLabel "Archives Object Repositories" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create ArchiveObjectRepositories Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } if (($ObjectRepositoriesInfo -or $ArchObjRepositoriesInfo) -and ($ObjectRepositoriesNode -or $ArchObjRepositoriesNode)) { @@ -227,11 +235,11 @@ function Get-VbrInfraDiagram { $ObjStorageNodeArray += $ArchObjRepositoriesNode } - $ObjStorageSubgraphNode = try { - Node -Name "ObjectRepos" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ObjStorageNodeArray -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Object' -Label 'Object Storage' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $ObjStorageSubgraphNode = Node -Name "ObjectRepos" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ObjStorageNodeArray -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Object' -Label 'Object Storage' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create SureBackup SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($ObjStorageSubgraphNode) { @@ -241,11 +249,11 @@ function Get-VbrInfraDiagram { # WanAccels Graphviz Cluster if ($WanAccels = Get-VbrWanAccelInfo) { - $WanAccelsNode = try { - Node WanAccelServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($WanAccels | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Wan_Accel" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $WanAccels.AditionalInfo -Subgraph -SubgraphLabel "Wan Accelerators" -SubgraphLabelPos "top" -SubgraphIconType "VBR_Wan_Accel" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } + try { + $WanAccelsNode = Node WanAccelServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($WanAccels | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Wan_Accel" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $WanAccels.AditionalInfo -Subgraph -SubgraphLabel "Wan Accelerators" -SubgraphLabelPos "top" -SubgraphIconType "VBR_Wan_Accel" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create WanAccelerators Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } if ($WanAccels -and $WanAccelsNode) { @@ -254,26 +262,26 @@ function Get-VbrInfraDiagram { # Tapes Graphviz Cluster if ($TapeServerInfo = Get-VbrTapeServersInfo) { - $TapeServerNode = try { - Node TapeServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeServerInfo.Name -Align "Center" -iconType "VBR_Tape_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeServerInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_Tape_Server" -SubgraphLabel "Tape Servers" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } + try { + $TapeServerNode = Node TapeServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeServerInfo.Name -Align "Center" -iconType "VBR_Tape_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeServerInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_Tape_Server" -SubgraphLabel "Tape Servers" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create TapeServers Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($TapeLibraryInfo = Get-VbrTapeLibraryInfo) { - $TapeLibraryNode = try { - Node TapeLibrary @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeLibraryInfo.Name -Align "Center" -iconType "VBR_Tape_Library" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeLibraryInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_Tape_Library" -SubgraphLabel "Tape Libraries" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } + try { + $TapeLibraryNode = Node TapeLibrary @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeLibraryInfo.Name -Align "Center" -iconType "VBR_Tape_Library" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeLibraryInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_Tape_Library" -SubgraphLabel "Tape Libraries" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create TapeLibrary Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } if ($TapeVaultInfo = Get-VbrTapeVaultInfo) { - $TapeVaultNode = try { - Node TapeVault @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeVaultInfo.Name -Align "Center" -iconType "VBR_Tape_Vaults" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeVaultInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_Tape_Vaults" -SubgraphLabel "Tape Vaults" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } + try { + $TapeVaultNode = Node TapeVault @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $TapeVaultInfo.Name -Align "Center" -iconType "VBR_Tape_Vaults" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $TapeVaultInfo.AditionalInfo -Subgraph -SubgraphIconType "VBR_Tape_Vaults" -SubgraphLabel "Tape Vaults" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create TapeVault Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } } @@ -291,20 +299,20 @@ function Get-VbrInfraDiagram { # ServiceProvider Graphviz Cluster if ($ServiceProviderInfo = Get-VbrServiceProviderInfo) { - $ServiceProviderNode = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ServiceProviderInfo.Name -Align "Center" -iconType "VBR_Service_Providers_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ServiceProviderInfo.AditionalInfo + try { + $ServiceProviderNode = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ServiceProviderInfo.Name -Align "Center" -iconType "VBR_Service_Providers_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ServiceProviderInfo.AditionalInfo } catch { Write-Verbose "Error: Unable to create ServiceProvider Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } if ($ServiceProviderInfo -and $ServiceProviderNode) { - $ServiceProviderSubgraphNode = try { - Node -Name ServiceProviders -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ServiceProviderNode -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Service_Providers' -Label 'Service Providers' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $ServiceProviderSubgraphNode = Node -Name ServiceProviders -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ServiceProviderNode -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_Service_Providers' -Label 'Service Providers' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create ServiceProviders SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($ServiceProviderSubgraphNode) { @@ -315,19 +323,19 @@ function Get-VbrInfraDiagram { # SureBackup Graphviz Cluster if (($VirtualLab = Get-VbrVirtualLabInfo -and ($ApplicationGroups = Get-VbrApplicationGroupsInfo))) { if ($VirtualLab) { - $VirtualLabNode = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $VirtualLab.Name -Align "Center" -iconType $VirtualLab.IconType -columnSize 2 -IconDebug $IconDebug -MultiIcon -AditionalInfo $VirtualLab.AditionalInfo -Subgraph -SubgraphIconType "VBR_Virtual_Lab" -SubgraphLabel "Virtual Labs" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $VirtualLabNode = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $VirtualLab.Name -Align "Center" -iconType $VirtualLab.IconType -columnSize 2 -IconDebug $IconDebug -MultiIcon -AditionalInfo $VirtualLab.AditionalInfo -Subgraph -SubgraphIconType "VBR_Virtual_Lab" -SubgraphLabel "Virtual Labs" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create VirtualLab Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } if ($ApplicationGroups) { - $ApplicationGroupsNode = try { - Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ApplicationGroups.Name -Align "Center" -iconType $ApplicationGroups.IconType -columnSize 2 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ApplicationGroups.AditionalInfo -Subgraph -SubgraphIconType "VBR_Virtual_Lab" -SubgraphLabel "Application Groups" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + try { + $ApplicationGroupsNode = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $ApplicationGroups.Name -Align "Center" -iconType $ApplicationGroups.IconType -columnSize 2 -IconDebug $IconDebug -MultiIcon -AditionalInfo $ApplicationGroups.AditionalInfo -Subgraph -SubgraphIconType "VBR_Virtual_Lab" -SubgraphLabel "Application Groups" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create VirtualLab Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } } @@ -344,11 +352,11 @@ function Get-VbrInfraDiagram { $SureBackupSubgraphNodeArray += $ApplicationGroupsNode } - $SureBackupSubgraphNode = try { - Node -Name "SureBackup" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SureBackupSubgraphNodeArray -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_SureBackup' -Label 'SureBackup' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + try { + $SureBackupSubgraphNode = Node -Name "SureBackup" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SureBackupSubgraphNodeArray -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_SureBackup' -Label 'SureBackup' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } } catch { Write-Verbose "Error: Unable to create SureBackup SubGraph Objects. Disabling the section" - Write-Verbose "Error Message: $($_.Exception.Message)" + Write-Debug "Error Message: $($_.Exception.Message)" } if ($SureBackupSubgraphNode) { diff --git a/Src/Private/Get-VbrServerConnection.ps1 b/Src/Private/Get-VbrServerConnection.ps1 index 00e4b7f..f541d35 100644 --- a/Src/Private/Get-VbrServerConnection.ps1 +++ b/Src/Private/Get-VbrServerConnection.ps1 @@ -50,14 +50,14 @@ function Get-VbrServerConnection { Write-Verbose -Message "Trying to open a new connection to $($System)" Connect-VBRServer -Server $System -Credential $Credential -Port $Port } catch { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message Throw "Failed to connect to Veeam Backup Server Host $($System):$($Port) with username $($Credential.USERNAME)" } } Write-Verbose -Message "Validating connection to $($System)" $NewConnection = (Get-VBRServerSession).Server if ($null -eq $NewConnection) { - Write-Verbose $_.Exception.Message + Write-Verbose -Message $_.Exception.Message Throw "Failed to connect to Veeam Backup Server Host $($System):$($Port) with username $($Credential.USERNAME)" } elseif ($NewConnection) { Write-Verbose -Message "Successfully connected to $($System):$($Port) Backup Server." From 21f14e0c8dfba366afe5356239bae007faf530a5 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 12 Nov 2024 23:39:29 -0400 Subject: [PATCH 4/7] Fix SOBR Performace extent issue --- Src/Private/Get-DiagBackupToSobr.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Private/Get-DiagBackupToSobr.ps1 b/Src/Private/Get-DiagBackupToSobr.ps1 index 08e0b28..c07f9ad 100644 --- a/Src/Private/Get-DiagBackupToSobr.ps1 +++ b/Src/Private/Get-DiagBackupToSobr.ps1 @@ -44,7 +44,7 @@ function Get-DiagBackupToSobr { if ($SOBROBJ.Performance) { try { - $Performance = Get-DiaHTMLNodeTable -ImagesObj $Image -inputObject $SOBROBJ.Performance.Name -Align "Center" -iconType $SOBROBJ.Performance.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Performance.AditionalInfo -Subgraph -SubgraphLabel "Performance Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" + $Performance = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Performance.Name -Align "Center" -iconType $SOBROBJ.Performance.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Performance.AditionalInfo -Subgraph -SubgraphLabel "Performance Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1" } catch { Write-Verbose "Error: Unable to create SOBR Performance Objects. Disabling the section" Write-Debug "Error Message: $($_.Exception.Message)" From 1a8560c81529f863726918008ffb48576e0bfa56 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 12 Nov 2024 23:48:19 -0400 Subject: [PATCH 5/7] Add support for displaying HyperVisor Information --- CHANGELOG.md | 4 +-- Src/Private/Get-DiagBackupToViProxy.ps1 | 45 ++++++++++++++++++++++++- Src/Private/SharedUtilsFunctions.ps1 | 18 +++++----- 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1865da..0f4f0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add support for HyperVisor Information (Infrastructure Diagram) +- Add support for displaying HyperVisor Information - vCenter information - vSphere Cluster Information - - Esxi Host information + - Esxi Host table ### Changed diff --git a/Src/Private/Get-DiagBackupToViProxy.ps1 b/Src/Private/Get-DiagBackupToViProxy.ps1 index d6230c0..a9030d4 100644 --- a/Src/Private/Get-DiagBackupToViProxy.ps1 +++ b/Src/Private/Get-DiagBackupToViProxy.ps1 @@ -32,8 +32,51 @@ function Get-DiagBackupToViProxy { Node ViProxies @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($VMwareBackupProxy | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Proxy_Server" -columnSize 4 -IconDebug $IconDebug -MultiIcon -AditionalInfo $VMwareBackupProxy.AditionalInfo -Subgraph -SubgraphIconType "VBR_Proxy" -SubgraphLabel "VMware Backup Proxies" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1"); shape = 'plain'; fontsize = 14; fontname = "Segoe Ui" } + Edge $BackupServerInfo.Name -To ViProxies:n @{minlen = 2 } + } + + $vSphereObj = Get-VbrBackupvSphereInfo | Sort-Object + + # vSphere Graphviz Cluster + $VivCenterNodes = @() + foreach ($vCenter in $vSphereObj | Where-Object {$_.Name -ne '192.168.5.2'}) { + $vCenterNodeArray = @() + $ViClustersNodes = @() + $vCenterNodeArray += $vCenter.Label + try { + $ViClustersChildsNodes = foreach ($ViCluster in $vCenter.Childs) { + if ($ViCluster.EsxiHost.Name) { + Get-DiaHTMLTable -ImagesObj $Images -Rows $ViCluster.EsxiHost.Name -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold + } else { + Get-DiaHTMLTable -ImagesObj $Images -Rows 'No Esxi Host' -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold + } + } + } catch { + Write-Verbose "Error: Unable to create vSphere Clusters Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" + } + if ($ViClustersChildsNodes) { + $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3 + $vCenterNodeArray += $ViClustersNodes + } + if ($vCenterNodeArray) { + $VivCenterNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $vCenterNodeArray -Align 'Center' -IconDebug $IconDebug -Label 'vCenter Server' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 + + } + } + + if ($VivCenterNodes) { + try { + $ViClustersSubgraphNode = Node -Name "ViCluster" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $VivCenterNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vSphere' -Label 'VMware vSphere Infrastructure' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + } catch { + Write-Verbose "Error: Unable to create ViCluster Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" + } - Edge $BackupServerInfo.Name -To ViProxies:n @{minlen = 3 } + if ($ViClustersSubgraphNode) { + $ViClustersSubgraphNode + Edge ViProxies -To ViCluster @{minlen = 2 } + } } } } catch { diff --git a/Src/Private/SharedUtilsFunctions.ps1 b/Src/Private/SharedUtilsFunctions.ps1 index 118ea74..b840bb0 100644 --- a/Src/Private/SharedUtilsFunctions.ps1 +++ b/Src/Private/SharedUtilsFunctions.ps1 @@ -86,30 +86,32 @@ function Get-RoleType { function ConvertTo-TextYN { <# .SYNOPSIS - Used by As Built Report to convert true or false automatically to Yes or No. + Used by As Built Report to convert true or false automatically to Yes or No. .DESCRIPTION + .NOTES Version: 0.3.0 Author: LEE DAILEY + .EXAMPLE + .LINK + #> [CmdletBinding()] [OutputType([String])] - - Param - ( + Param ( [Parameter ( Position = 0, Mandatory)] [AllowEmptyString()] - [string] - $TEXT + [string] $TEXT ) switch ($TEXT) { - "" { "-" } - $Null { "-" } + "" { "--"; break } + " " { "--"; break } + $Null { "--"; break } "True" { "Yes"; break } "False" { "No"; break } default { $TEXT } From d70327870e3e9509bd2a022a17416eea02db3d57 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 13 Nov 2024 10:26:57 -0400 Subject: [PATCH 6/7] v0.6.13 release --- CHANGELOG.md | 2 +- Src/Private/Get-DiagBackupServer.ps1 | 4 ++-- Src/Private/Get-DiagBackupToViProxy.ps1 | 23 ++++++++++++++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f4f0f7..c181364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.6.13] - Unreleased +## [0.6.13] - 2024-11-13 ### Added diff --git a/Src/Private/Get-DiagBackupServer.ps1 b/Src/Private/Get-DiagBackupServer.ps1 index 2e10907..8e380d9 100644 --- a/Src/Private/Get-DiagBackupServer.ps1 +++ b/Src/Private/Get-DiagBackupServer.ps1 @@ -5,7 +5,7 @@ function Get-DiagBackupServer { .DESCRIPTION Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph. .NOTES - Version: 0.6.9 + Version: 0.6.13 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -73,7 +73,7 @@ function Get-DiagBackupServer { Edge -From $BackupServerInfo.Name -To $DatabaseServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; xlabel = $DatabaseServerInfo.DBPort } } } elseif (($EMServerInfo.Name -eq $BackupServerInfo.Name) -and ($DatabaseServerInfo.Name -eq $BackupServerInfo.Name)) { - Write-Verbose -Message "Database and Enterprise Maneger server colocated with Backup Server: Collecting Backup Server and Enterprise Manager Information." + Write-Verbose -Message "Database and Enterprise Manager server collocated with Backup Server: Collecting Backup Server and Enterprise Manager Information." $BSHASHTABLE = @{} $BackupServerInfo.psobject.properties | ForEach-Object { $BSHASHTABLE[$_.Name] = $_.Value } diff --git a/Src/Private/Get-DiagBackupToViProxy.ps1 b/Src/Private/Get-DiagBackupToViProxy.ps1 index a9030d4..c0957db 100644 --- a/Src/Private/Get-DiagBackupToViProxy.ps1 +++ b/Src/Private/Get-DiagBackupToViProxy.ps1 @@ -52,16 +52,25 @@ function Get-DiagBackupToViProxy { } } } catch { - Write-Verbose "Error: Unable to create vSphere Clusters Objects. Disabling the section" + Write-Verbose "Error: Unable to create vSphere Esxi table Objects. Disabling the section" Write-Debug "Error Message: $($_.Exception.Message)" } - if ($ViClustersChildsNodes) { - $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3 - $vCenterNodeArray += $ViClustersNodes + try { + if ($ViClustersChildsNodes) { + $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3 + $vCenterNodeArray += $ViClustersNodes + } + } catch { + Write-Verbose "Error: Unable to create vSphere Clusters Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" } - if ($vCenterNodeArray) { - $VivCenterNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $vCenterNodeArray -Align 'Center' -IconDebug $IconDebug -Label 'vCenter Server' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 - + try { + if ($vCenterNodeArray) { + $VivCenterNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $vCenterNodeArray -Align 'Center' -IconDebug $IconDebug -Label 'vCenter Server' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 + } + } catch { + Write-Verbose "Error: Unable to create vCenter Server Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" } } From 91be00c3d6eb3304eaafde93a847d2ae3a3fedd9 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 13 Nov 2024 11:18:10 -0400 Subject: [PATCH 7/7] Enhance Vi Infra Section --- Src/Private/Get-VbrInfraDiagram.ps1 | 90 +++++++++++++++-------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/Src/Private/Get-VbrInfraDiagram.ps1 b/Src/Private/Get-VbrInfraDiagram.ps1 index 338ebc8..d69ea1b 100644 --- a/Src/Private/Get-VbrInfraDiagram.ps1 +++ b/Src/Private/Get-VbrInfraDiagram.ps1 @@ -103,48 +103,55 @@ function Get-VbrInfraDiagram { } } - # vCenter Graphviz Cluster - if ($vSphereObj = Get-VbrBackupvSphereInfo | Sort-Object) { - try { - $vSphereNode = Node vCenterServer @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $vSphereObj.Name -Align "Center" -iconType "VBR_vCenter_Server" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $vSphereObj.AditionalInfo -Subgraph -SubgraphLabel "vCenter Servers" -SubgraphLabelPos "top" -SubgraphIconType "VBR_vCenter_Server" -SubgraphTableStyle "dashed,rounded" -TableBorderColor "#71797E" -TableBorder "1"); shape = 'plain'; fontname = "Segoe Ui" } - } catch { - Write-Verbose "Error: Unable to create vSphere HyperVisors Objects. Disabling the section" - Write-Debug "Error Message: $($_.Exception.Message)" - } - } else { - Write-Verbose "Info: No vCenter information to diagram" - } - - if ($vSphereNode) { - $vSphereNode - } - # vSphere Graphviz Cluster - $ViClustersNodes = @() - foreach ($vCenter in $vSphereObj) { - try { - $ViClustersChildsNodes = foreach ($ViCluster in $vCenter.Childs) { - Get-DiaHTMLTable -ImagesObj $Images -Rows $ViCluster.EsxiHost.Name -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold + if ($vSphereObj = Get-VbrBackupvSphereInfo | Sort-Object) { + $VivCenterNodes = @() + foreach ($vCenter in $vSphereObj | Where-Object { $_.Name -ne '192.168.5.2' }) { + $vCenterNodeArray = @() + $ViClustersNodes = @() + $vCenterNodeArray += $vCenter.Label + try { + $ViClustersChildsNodes = foreach ($ViCluster in $vCenter.Childs) { + if ($ViCluster.EsxiHost.Name) { + Get-DiaHTMLTable -ImagesObj $Images -Rows $ViCluster.EsxiHost.Name -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold + } else { + Get-DiaHTMLTable -ImagesObj $Images -Rows 'No Esxi Host' -Align 'Center' -ColumnSize 3 -IconDebug $IconDebug -Subgraph -SubgraphIconType "VBR_ESXi_Server" -SubgraphLabel $ViCluster.Name -SubgraphLabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -NoFontBold + } + } + } catch { + Write-Verbose "Error: Unable to create vSphere Esxi table Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" + } + try { + if ($ViClustersChildsNodes) { + $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3 + $vCenterNodeArray += $ViClustersNodes + } + } catch { + Write-Verbose "Error: Unable to create vSphere Clusters Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" + } + try { + if ($vCenterNodeArray) { + $VivCenterNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $vCenterNodeArray -Align 'Center' -IconDebug $IconDebug -Label 'vCenter Server' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1 + } + } catch { + Write-Verbose "Error: Unable to create vCenter Server Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" } - } catch { - Write-Verbose "Error: Unable to create vSphere Clusters Objects. Disabling the section" - Write-Debug "Error Message: $($_.Exception.Message)" - } - if ($ViClustersChildsNodes) { - $ViClustersNodes += Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersChildsNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vCenter_Server' -Label $vCenter.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 2 } - } - if ($ViClustersNodes) { - try { - $ViClustersSubgraphNode = Node -Name "ViCluster" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $ViClustersNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vSphere_Cluster' -Label 'vSphere Clusters' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } - } catch { - Write-Verbose "Error: Unable to create ViCluster Objects. Disabling the section" - Write-Debug "Error Message: $($_.Exception.Message)" - } + if ($VivCenterNodes) { + try { + $ViClustersSubgraphNode = Node -Name "ViInfra" -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $VivCenterNodes -Align 'Center' -IconDebug $IconDebug -IconType 'VBR_vSphere' -Label 'VMware vSphere Infrastructure' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" } + } catch { + Write-Verbose "Error: Unable to create ViCluster Objects. Disabling the section" + Write-Debug "Error Message: $($_.Exception.Message)" + } - if ($ViClustersSubgraphNode) { - $ViClustersSubgraphNode + if ($ViClustersSubgraphNode) { + $ViClustersSubgraphNode + } } } @@ -542,13 +549,8 @@ function Get-VbrInfraDiagram { } # Connect vCenter Servers Cluster to the Dummy line - if ($vSphereNode) { - Edge -From Proxies -To vCenterServer @{minlen = 1; arrowtail = 'dot'; arrowhead = 'dot'; style = 'dashed' } - } - - # Connect vSphere Cluster to the Dummy line - if ($vSphereNode -and $ViClustersSubgraphNode) { - Edge -From vCenterServer -To ViCluster @{minlen = 1; arrowtail = 'dot'; arrowhead = 'dot'; style = 'dashed' } + if ($ViClustersSubgraphNode) { + Edge -From Proxies -To ViInfra @{minlen = 1; arrowtail = 'dot'; arrowhead = 'dot'; style = 'dashed' } } # Connect Veeam Repository to the Dummy line