-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from rebelinux/dev
v0.5.9 public release
- Loading branch information
Showing
32 changed files
with
1,078 additions
and
930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.