Skip to content

Commit

Permalink
v0.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Feb 14, 2024
1 parent 496b6c3 commit b3d8da0
Show file tree
Hide file tree
Showing 27 changed files with 466 additions and 258 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ 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.5.9] - 2024-02-14


## [0.5.8] - 2024-01-25

### Chaged
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Only users with Veeam Backup Administrator role assigned can generate a Diagram
This project is compatible with the following PowerShell versions;

<!-- ********** Update supported PowerShell versions ********** -->
| Windows PowerShell 5.1 | PowerShell 7 |
|:----------------------:|:--------------------:|
| :white_check_mark: | :x: |
| Windows PowerShell 5.1 | PowerShell 7 |
| :--------------------: | :----------: |
| :white_check_mark: | :x: |

## :wrench: System Requirements

Expand Down Expand Up @@ -124,7 +124,7 @@ _Note: You are not limited to installing the module to those example paths, you
### **New-VeeamDiagram**
The `New-VeeamDiagram` cmdlet is used to generate a Veeam Backup & Replication diagram. The type of diagram to generate is specified by using the `DiagramType` parameter. The DiagramType parameter relies on additional diagram modules being created alongside the defaults module. The `Target` parameter specifies one or more Veeam VBR servers on which to connect and run the diagram. User credentials to the system are specifed using the `Credential`, or the `Username` and `Password` parameters. One or more document formats, such as `PNG`, `PDF`, `SVG`, `BASE64` or `DOT` can be specified using the `Format` parameter. Additional parameters are outlined below.
The `New-VeeamDiagram` cmdlet is used to generate a Veeam Backup & Replication diagram. The type of diagram to generate is specified by using the `DiagramType` parameter. The DiagramType parameter relies on additional diagram modules being created alongside the defaults module. The `Target` parameter specifies one or more Veeam VBR servers on which to connect and run the diagram. User credentials to the system are specified using the `Credential`, or the `Username` and `Password` parameters. One or more document formats, such as `PNG`, `PDF`, `SVG`, `BASE64` or `DOT` can be specified using the `Format` parameter. Additional parameters are outlined below.
```powershell
.PARAMETER DiagramType
Expand Down
100 changes: 100 additions & 0 deletions Src/Private/Get-DiagBackupServer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
function Get-DiagBackupServer {
<#
.SYNOPSIS
Function to build Backup Server object.
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.8
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.LINK
https://github.com/rebelinux/Veeam.Diagrammer
#>
[CmdletBinding()]

Param
(

)
process {
try {
SubGraph BackupServer -Attributes @{Label = 'Backup Server'; style = "rounded"; bgcolor = "#ceedc4"; fontsize = 18; penwidth = 2 } {
if (($DatabaseServerInfo.Name -ne $BackupServerInfo.Name) -and $EMServerInfo) {
Write-Verbose -Message "Collecting Backup Server, Database Server and Enterprise Manager Information."
$BSHASHTABLE = @{}
$DBHASHTABLE = @{}
$EMHASHTABLE = @{}

$BackupServerInfo.psobject.properties | ForEach-Object { $BSHASHTABLE[$_.Name] = $_.Value }
$DatabaseServerInfo.psobject.properties | ForEach-Object { $DBHASHTABLE[$_.Name] = $_.Value }
$EMServerInfo.psobject.properties | ForEach-Object { $EMHASHTABLE[$_.Name] = $_.Value }

Node $BackupServerInfo.Name -Attributes @{Label = $BSHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }
Node $DatabaseServerInfo.Name -Attributes @{Label = $DBHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }
Node $EMServerInfo.Name -Attributes @{Label = $EMHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }

if ($Dir -eq 'LR') {
Rank $EMServerInfo.Name, $DatabaseServerInfo.Name
Edge -From $EMServerInfo.Name -To $BackupServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; }
Edge -From $DatabaseServerInfo.Name -To $BackupServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; xlabel = $DatabaseServerInfo.DBPort }
} else {
Rank $EMServerInfo.Name, $BackupServerInfo.Name, $DatabaseServerInfo.Name
Edge -From $EMServerInfo.Name -To $BackupServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; }
Edge -From $BackupServerInfo.Name -To $DatabaseServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; xlabel = $DatabaseServerInfo.DBPort }
}
} elseif (($DatabaseServerInfo.Name -ne $BackupServerInfo.Name) -and (-Not $EMServerInfo)) {
Write-Verbose -Message "Not Enterprise Manager Found: Collecting Backup Server and Database server Information."
$BSHASHTABLE = @{}
$DBHASHTABLE = @{}

$BackupServerInfo.psobject.properties | ForEach-Object { $BSHASHTABLE[$_.Name] = $_.Value }
$DatabaseServerInfo.psobject.properties | ForEach-Object { $DBHASHTABLE[$_.Name] = $_.Value }

Node $BackupServerInfo.Name -Attributes @{Label = $BSHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }
Node $DatabaseServerInfo.Name -Attributes @{Label = $DBHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }

if ($Dir -eq 'LR') {
Rank $BackupServerInfo.Name, $DatabaseServerInfo.Name
Edge -From $DatabaseServerInfo.Name -To $BackupServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; xlabel = $DatabaseServerInfo.DBPort }
} else {
Rank $BackupServerInfo.Name, $DatabaseServerInfo.Name
Edge -From $BackupServerInfo.Name -To $DatabaseServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; xlabel = $DatabaseServerInfo.DBPort }
}
} elseif ($EMServerInfo -and ($DatabaseServerInfo.Name -eq $BackupServerInfo.Name)) {
Write-Verbose -Message "Database server colocated with Backup Server: Collecting Backup Server and Enterprise Manager Information."
$BSHASHTABLE = @{}
$EMHASHTABLE = @{}

$BackupServerInfo.psobject.properties | ForEach-Object { $BSHASHTABLE[$_.Name] = $_.Value }
$EMServerInfo.psobject.properties | ForEach-Object { $EMHASHTABLE[$_.Name] = $_.Value }

Node $BackupServerInfo.Name -Attributes @{Label = $BSHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }
Node $EMServerInfo.Name -Attributes @{Label = $EMHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }

if ($Dir -eq 'LR') {
Rank $EMServerInfo.Name, $BackupServerInfo.Name
Edge -From $EMServerInfo.Name -To $BackupServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; }
} else {
Rank $EMServerInfo.Name, $BackupServerInfo.Name
Edge -From $BackupServerInfo.Name -To $EMServerInfo.Name @{arrowtail = "normal"; arrowhead = "normal"; minlen = 3; }
}
} else {
Write-Verbose -Message "Database server colocated with Backup Server and no Enterprise Manager found: Collecting Backup Server Information."
$BSHASHTABLE = @{}
$BackupServerInfo.psobject.properties | ForEach-Object { $BSHASHTABLE[$_.Name] = $_.Value }
Node Left @{Label = 'Left'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain'; fillColor = 'transparent' }
Node Leftt @{Label = 'Leftt'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain'; fillColor = 'transparent' }
Node Right @{Label = 'Right'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain'; fillColor = 'transparent' }
Node $BackupServerInfo.Name -Attributes @{Label = $BSHASHTABLE.Label; fillColor = '#ceedc4'; shape = 'plain' }
Edge Left, Leftt, $BackupServerInfo.Name, Right @{style = $EdgeDebug.style; color = $EdgeDebug.color }
Rank Left, Leftt, $BackupServerInfo.Name, Right
}
}
} catch {
$_
}
}
end {}
}
12 changes: 9 additions & 3 deletions Src/Private/Get-DiagBackupToFileProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToFileProxy {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.6
Version: 0.5.9
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -18,6 +18,12 @@ function Get-DiagBackupToFileProxy {
(

)

begin {
# Get Veeam Backup Server Object
Get-DiagBackupServer
}

process {
try {
$FileBackupProxy = Get-VbrBackupProxyInfo -Type 'nas'
Expand Down Expand Up @@ -58,9 +64,9 @@ function Get-DiagBackupToFileProxy {
}

if ($Dir -eq 'LR') {
Edge $BackupServerInfo.Name -To DummyFileProxy @{minlen = 3; }
Edge $BackupServerInfo.Name -To DummyFileProxy @{minlen = 3; lhead = "clusterMainSubGraph"}
} else {
Edge $BackupServerInfo.Name -To DummyFileProxy @{minlen = 3; }
Edge $BackupServerInfo.Name -To DummyFileProxy @{minlen = 3; lhead = "clusterMainSubGraph"}
}
}
}
Expand Down
12 changes: 9 additions & 3 deletions Src/Private/Get-DiagBackupToHvProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToHvProxy {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.6
Version: 0.5.9
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -18,6 +18,12 @@ function Get-DiagBackupToHvProxy {
(

)

begin {
# Get Veeam Backup Server Object
Get-DiagBackupServer
}

process {
try {
$HyperVBackupProxy = Get-VbrBackupProxyInfo -Type 'hyperv'
Expand Down Expand Up @@ -57,9 +63,9 @@ function Get-DiagBackupToHvProxy {
}

if ($Dir -eq 'LR') {
Edge $BackupServerInfo.Name -To DummyHyperVProxy @{minlen = 3; }
Edge $BackupServerInfo.Name -To DummyHyperVProxy @{minlen = 3; lhead = "clusterMainSubGraph" }
} else {
Edge $BackupServerInfo.Name -To DummyHyperVProxy @{minlen = 3; }
Edge $BackupServerInfo.Name -To DummyHyperVProxy @{minlen = 3; lhead = "clusterMainSubGraph" }
}
}
} catch {
Expand Down
17 changes: 11 additions & 6 deletions Src/Private/Get-DiagBackupToProtectedGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToProtectedGroup {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.7
Version: 0.5.9
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -18,9 +18,14 @@ function Get-DiagBackupToProtectedGroup {
(

)

begin {
# Get Veeam Backup Server Object
Get-DiagBackupServer
}

process {
try {

$ProtectedGroups = Get-VbrBackupProtectedGroupInfo
$ADContainer = $ProtectedGroups | Where-Object { $_.Container -eq 'ActiveDirectory' }
$ManualContainer = $ProtectedGroups | Where-Object { $_.Container -eq 'ManuallyDeployed' }
Expand Down Expand Up @@ -100,7 +105,7 @@ function Get-DiagBackupToProtectedGroup {
Rank DummyPGLeft, DummyPGLeftt, ProtectedGroup, DummyPGRight
}
if ($ADContainer) {
SubGraph ADContainer -Attributes @{Label = (Get-HTMLLabel -Label 'Active Directory Computers' -Type "VBR_AGENT_AD_Logo" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph ADContainer -Attributes @{Label = (Get-HTMLLabel -Label 'Active Directory Computers' -IconType "VBR_AGENT_AD_Logo" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
# Node used for subgraph centering
Node DummyADContainer @{Label = 'DummyADC'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if ($ADContainer.count -le 2) {
Expand Down Expand Up @@ -174,7 +179,7 @@ function Get-DiagBackupToProtectedGroup {
Edge -From ProtectedGroup -To DummyADContainer @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
if ($ManualContainer) {
SubGraph MCContainer -Attributes @{Label = (Get-HTMLLabel -Label 'Manual Computers' -Type "VBR_AGENT_MC" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph MCContainer -Attributes @{Label = (Get-HTMLLabel -Label 'Manual Computers' -IconType "VBR_AGENT_MC" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
# Node used for subgraph centering
Node DummyMCContainer @{Label = 'DummyMC'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if ($ManualContainer.count -le 2) {
Expand Down Expand Up @@ -236,7 +241,7 @@ function Get-DiagBackupToProtectedGroup {
Edge -From ProtectedGroup -To DummyMCContainer @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
if ($IndividualContainer) {
SubGraph ICContainer -Attributes @{Label = (Get-HTMLLabel -Label 'Individual Computers' -Type "VBR_AGENT_IC" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph ICContainer -Attributes @{Label = (Get-HTMLLabel -Label 'Individual Computers' -IconType "VBR_AGENT_IC" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
# Node used for subgraph centering
Node DummyICContainer @{Label = 'DummyIC'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if ($IndividualContainer.count -le 2) {
Expand Down Expand Up @@ -313,7 +318,7 @@ function Get-DiagBackupToProtectedGroup {
Edge -From ProtectedGroup -To DummyICContainer @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
if ($CSVContainer) {
SubGraph CSVContainer -Attributes @{Label = (Get-HTMLLabel -Label 'CSV Computers' -Type "VBR_AGENT_CSV_Logo" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph CSVContainer -Attributes @{Label = (Get-HTMLLabel -Label 'CSV Computers' -IconType "VBR_AGENT_CSV_Logo" -SubgraphLabel); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
# Node used for subgraph centering
Node DummyCSVContainer @{Label = 'DummyCSVC'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if ($CSVContainer.count -le 2) {
Expand Down
11 changes: 8 additions & 3 deletions Src/Private/Get-DiagBackupToRepo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToRepo {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.6
Version: 0.5.9
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -18,9 +18,14 @@ function Get-DiagBackupToRepo {
(

)

begin {
# Get Veeam Backup Server Object
Get-DiagBackupServer
}

process {
try {

$BackupRepo = Get-VbrBackupRepoInfo
$LocalBackupRepo = Get-VbrBackupRepoInfo | Where-Object { $_.Role -like '*Local' }
$RemoteBackupRepo = Get-VbrBackupRepoInfo | Where-Object { $_.Role -like 'Dedup*' }
Expand Down Expand Up @@ -204,7 +209,7 @@ function Get-DiagBackupToRepo {
}
}

Edge -From $BackupServerInfo.Name -To BackupRepository @{minlen = 3 }
Edge -From $BackupServerInfo.Name -To BackupRepository @{minlen = 3; lhead = "clusterMainSubGraph" }
}
}
} catch {
Expand Down
Loading

0 comments on commit b3d8da0

Please sign in to comment.