Skip to content

Commit

Permalink
Merge pull request #40 from rebelinux/dev
Browse files Browse the repository at this point in the history
v0.6.10
  • Loading branch information
rebelinux authored Oct 19, 2024
2 parents 0aa93d2 + f503bd4 commit cba2fba
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 77 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +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.10] - 2024-10-19

### Changed

- Enhance Diagram design
- Increase Diagrammer.Core minimum version requirement

## [0.6.9] - 2024-10-10

### Added
### Added

- Add DependaBot action

Expand Down
121 changes: 86 additions & 35 deletions Src/Private/Get-DiagBackupToSobr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.9
Version: 0.6.10
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -30,43 +30,94 @@ function Get-DiagBackupToSobr {

if ($SobrRepo) {
if ($SobrRepo) {
SubGraph MainSubGraph -Attributes @{Label = 'SOBR Repositories' ; fontsize = 22; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded'; color = $SubGraphDebug.color } {
foreach ($SOBROBJ in $SobrRepo) {
$SubGraphName = Remove-SpecialChar -String $SOBROBJ.Name -SpecialChars '\- '
SubGraph $SubGraphName -Attributes @{Label = $SOBROBJ.Name; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
$SOBROBJ | ForEach-Object { Node $_.Name @{Label = $_.Label; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
if ($SOBROBJ.Performance) {
SubGraph "$($SubGraphName)Performance" -Attributes @{Label = "Performance Extent"; fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = "dashed,rounded"; } {

$SOBROBJ.Performance | ForEach-Object { Node $_.Name @{Label = Get-DiaNodeIcon -Name $_.Name -IconType $_.IconType -Align "Center" -Rows $_.AditionalInfo -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
}
}
if ($SOBROBJ.Capacity) {
SubGraph "$($SubGraphName)Capacity" -Attributes @{Label = "Capacity Extent"; fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = "dashed,rounded" } {

$SOBROBJ.Capacity | ForEach-Object { Node $_.Name @{Label = Get-DiaNodeIcon -Name $_.Name -IconType $_.IconType -Align "Center" -Rows $_.AditionalInfo -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
}
}
if ($SOBROBJ.Archive) {
SubGraph "$($SubGraphName)Archive" -Attributes @{Label = "Archive Extent"; fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = "dashed,rounded" } {

$SOBROBJ.Archive | ForEach-Object { Node $_.Name @{Label = Get-DiaNodeIcon -Name $_.Name -IconType $_.Icon -Align "Center" -Rows $_.Rows -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
}
}

if ($SOBROBJ.Archive) {
$SOBROBJ.Performance | ForEach-Object { Edge -From $SOBROBJ.Name -To $SOBROBJ.Archive.Name, $SOBROBJ.Capacity.Name, $_.Name @{minlen = 2 } } | Select-Object -Unique

} else {
$SOBROBJ.Performance | ForEach-Object { Edge -From $SOBROBJ.Name -To $_.Name @{minlen = 2 } } | Select-Object -Unique
$SOBROBJ.Capacity | ForEach-Object { Edge -From $SOBROBJ.Name -To $_.Name @{minlen = 2 } } | Select-Object -Unique

}
$SOBRArray = @()
foreach ($SOBROBJ in $SobrRepo) {

$SOBRExtentNodesArray = @()
$SOBRNodesArray = @()

$SOBROBJNode = $SOBROBJ.Label

if ($SOBROBJNode) {
$SOBRNodesArray += $SOBROBJNode
}

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"
} catch {
Write-Verbose "Error: Unable to create SOBR Performance Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($Performance) {
$SOBRExtentNodesArray += $Performance
}
}
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"
} catch {
Write-Verbose "Error: Unable to create SOBR Capacity Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($Capacity) {
$SOBRExtentNodesArray += $Capacity
}
}
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"

} catch {
Write-Verbose "Error: Unable to create SOBR Archive Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($Archive) {
$SOBRExtentNodesArray += $Archive
}
Edge -From MainSubGraph:s -To $SOBROBJ.Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}

$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
} catch {
Write-Verbose "Error: Unable to create SOBR Extents SubGraph Objects. Disabling the section"
Write-Verbose "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
} catch {
Write-Verbose "Error: Unable to create SOBR SubGraph Nodes Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($SOBRSubgraphNode) {
$SOBRArray += $SOBRSubgraphNode
}
}

$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" }
} catch {
Write-Verbose "Error: Unable to create SOBR SubGraph Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($SOBRSubgraph) {
$SOBRSubgraph
}
Edge -From $BackupServerInfo.Name -To MainSubGraph @{minlen = 3 }

Edge -From $BackupServerInfo.Name -To SOBRRepo @{minlen = 3 }

}
}
Expand Down
114 changes: 81 additions & 33 deletions Src/Private/Get-DiagBackupToTape.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.9
Version: 0.6.10
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -32,43 +32,91 @@ function Get-DiagBackupToTape {

if ($BackupServerInfo) {
if ($BackupTapeServers) {
SubGraph MainSubGraph -Attributes @{Label = 'Tape Servers'; fontsize = 22; penwidth = 1; labelloc = 't'; style = 'dashed,rounded'; color = $SubGraphDebug.color } {
if ($BackupTapeServers) {
SubGraph TapeServers -Attributes @{Label = ' '; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = $SubGraphDebug.style; color = $SubGraphDebug.color } {
foreach ($TSOBJ in ($BackupTapeServers | Sort-Object -Property Name)) {
$TSSubGraph = Remove-SpecialChar -String $TSOBJ.id -SpecialChars '\-'
SubGraph $TSSubGraph -Attributes @{Label = ' '; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
$TSHASHTABLE = @{}
$TSOBJ.psobject.properties | ForEach-Object { $TSHASHTABLE[$_.Name] = $_.Value }
Node $TSOBJ -NodeScript { $_.Name } @{Label = $TSHASHTABLE.Label; fontname = "Segoe Ui"; fillColor = 'transparent' }
if ($BackupTapeLibrary) {
$BKPTLOBJ = ($BackupTapeLibrary | Where-Object { $_.TapeServerId -eq $TSOBJ.Id } | Sort-Object -Property Name)
foreach ($TSLibraryOBJ in $BKPTLOBJ) {
$TLSubGraph = Remove-SpecialChar -String $TSLibraryOBJ.id -SpecialChars '\-'
SubGraph $TLSubGraph -Attributes @{Label = ' '; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
$TSLHASHTABLE = @{}
$TSLibraryOBJ.psobject.properties | ForEach-Object { $TSLHASHTABLE[$_.Name] = $_.Value }
Node $TSLibraryOBJ -NodeScript { $_.Id } @{Label = $TSLHASHTABLE.Label; fontname = "Segoe Ui"; fillColor = 'transparent' }
if ($BackupTapeDrives) {
$TSLibraryOBJName = "$((Remove-SpecialChar -String $TSLibraryOBJ.Name -SpecialChars ' \_').toUpper())"
$TapeLibraryDrives = ($BackupTapeDrives | Where-Object { $_.LibraryId -eq $TSLibraryOBJ.Id } | Sort-Object -Property Name)

Node "$($TSLibraryOBJName)Drives" @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($TapeLibraryDrives | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_Tape_Drive" -columnSize 4 -IconDebug $IconDebug -MultiIcon -AditionalInfo ($TapeLibraryDrives.AditionalInfo )); shape = 'plain'; fontsize = 14; fontname = "Segoe Ui" }

Edge -From $TSLibraryOBJ.id -To "$($TSLibraryOBJName)Drives"

}
}
}
$BKPTLOBJ | ForEach-Object { Edge -From $TSOBJ.Name -To $_.id }
}
$TapeArray = @()
foreach ($TSOBJ in ($BackupTapeServers | Sort-Object -Property Name)) {
$TapeNodesArray = @()

$TapeServerNode = $TSOBJ.Label

if ($BackupTapeLibrary) {
$BKPTLOBJ = ($BackupTapeLibrary | Where-Object { $_.TapeServerId -eq $TSOBJ.Id } | Sort-Object -Property Name)
foreach ($TSLibraryOBJ in $BKPTLOBJ) {

$TapeLibraryNodesArray = @()
$TapeLibrarySubArrayTable = @()

$TapeLibraryOBJNode = $TSLibraryOBJ.Label

if ($TapeLibraryOBJNode) {
$TapeLibraryNodesArray += $TapeLibraryOBJNode
}

if ($BackupTapeDrives) {

$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"

} catch {
Write-Verbose "Error: Unable to create Tape Library Drives Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($TapeLibraryDrivesNode) {
$TapeLibraryNodesArray += $TapeLibraryDrivesNode
}
}

$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
} catch {
Write-Verbose "Error: Unable to create Tape Library SubGraph Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($TapeLibrarySubgraph) {
$TapeNodesArray += $TapeLibrarySubgraph
}
($BackupTapeServers | Sort-Object -Property Name) | ForEach-Object { Edge -From MainSubGraph:s -To $_.Name @{style = $EdgeDebug.style; color = $EdgeDebug.color; } }
}
}

$TapeLibrarySubgraphArray = try {
Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $TapeNodesArray -Align 'Center' -IconDebug $IconDebug -Label "Library" -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)"
}

if ($TapeServerNode) {
$TapeLibrarySubArrayTable += $TapeServerNode
}

if ($TapeLibrarySubgraphArray) {
$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
} catch {
Write-Verbose "Error: Unable to create Tape Server SubGraph Objects. Disabling the section"
Write-Verbose "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" }
} catch {
Write-Verbose "Error: Unable to create Tape SubGraph Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}
if ($TapeSubgraph) {
$TapeSubgraph
Edge -From $BackupServerInfo.Name -To Tape @{minlen = 3 }
}
Edge -From $BackupServerInfo.Name -To MainSubGraph @{minlen = 3 }
}
}
} catch {
Expand Down
Loading

0 comments on commit cba2fba

Please sign in to comment.