Skip to content

Commit

Permalink
v0.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Sep 16, 2024
1 parent 4f4ed31 commit 2728559
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 336 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ 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.7] - 2024-09-16

### Fixed

- Fix Backup Server section if Enterprise Manager is collocated with the Backup Server
- Fix a issue in the SOBR diagram if there are multiple CapacityExtend configured
- Fix a issue in the SOBR diagram if there are multiple Extend configured

## [0.6.6] - 2024-09-12

### Fixed
Expand Down
50 changes: 45 additions & 5 deletions Src/Private/Get-DiagBackupServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ function Get-DiagBackupServer {
try {
SubGraph BackupServers -Attributes @{Label = 'Management'; labelloc = 'b'; labeljust = "r"; style = "rounded"; bgcolor = "#ceedc4"; fontcolor = '#696969'; fontsize = 14; penwidth = 2 } {
SubGraph BackupServer -Attributes @{Label = 'Backup Server'; style = "rounded"; bgcolor = "#ceedc4"; fontsize = 18; fontcolor = '#005f4b'; penwidth = 0; labelloc = 't'; labeljust = "c"; } {
if (($DatabaseServerInfo.Name -ne $BackupServerInfo.Name) -and $EMServerInfo) {
if (( -Not $DatabaseServerInfo.Name ) -and ( -Not $EMServerInfo.Name )) {
Write-Verbose -Message "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 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, $BackupServerInfo.Name, Right @{style = $EdgeDebug.style; color = $EdgeDebug.color }
Rank Left, $BackupServerInfo.Name, Right
} elseif (($DatabaseServerInfo.Name -ne $BackupServerInfo.Name) -and ($EMServerInfo.Name -ne $BackupServerInfo.Name )) {
Write-Verbose -Message "Collecting Backup Server, Database Server and Enterprise Manager Information."
$BSHASHTABLE = @{}
$DBHASHTABLE = @{}
Expand Down Expand Up @@ -63,6 +72,38 @@ function Get-DiagBackupServer {
Rank $BackupServerInfo.Name, $DatabaseServerInfo.Name
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."
$BSHASHTABLE = @{}

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

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

Node Left @{Label = 'Left'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain'; fillColor = 'transparent' }
Node Right @{Label = 'Right'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain'; fillColor = 'transparent' }
Edge Left, $BackupServerInfo.Name, Right @{style = $EdgeDebug.style; color = $EdgeDebug.color }
Rank Left, $BackupServerInfo.Name, Right

} elseif (($EMServerInfo.Name -eq $BackupServerInfo.Name) -and ($DatabaseServerInfo.Name -ne $BackupServerInfo.Name)) {
Write-Verbose -Message "Enterprise Maneger server colocated with Backup Server: Collecting Backup Server and Enterprise Manager 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 = @{}
Expand All @@ -82,15 +123,14 @@ function Get-DiagBackupServer {
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."
Write-Verbose -Message "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
Edge Left, $BackupServerInfo.Name, Right @{style = $EdgeDebug.style; color = $EdgeDebug.color }
Rank Left, $BackupServerInfo.Name, Right
}
}
}
Expand Down
14 changes: 8 additions & 6 deletions Src/Private/Get-DiagBackupToSobr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,17 @@ function Get-DiagBackupToSobr {
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' } {
$SOBRHASHTABLE = @{}
$SOBROBJ.psobject.properties | ForEach-Object { $SOBRHASHTABLE[$_.Name] = $_.Value }
Node $SOBROBJ -NodeScript { $_.Name } @{Label = $SOBRHASHTABLE.Label; fontname = "Segoe Ui"; shape = "plain"; }
$SOBROBJ | ForEach-Object { Node $_.Name @{Label = $_.Label; fontname = "Segoe Ui"; shape = "plain"; }}
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 $_.Icon -Align "Center" -Rows $_.Rows -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain" } }
$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" } }
}
}
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 $_.Icon -Align "Center" -Rows $_.Rows -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain" } }
$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" } }
}
}
if ($SOBROBJ.Archive) {
Expand All @@ -59,7 +57,11 @@ function Get-DiagBackupToSobr {
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 $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

}
}
Edge -From MainSubGraph:s -To $SOBROBJ.Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
Expand Down
16 changes: 11 additions & 5 deletions Src/Private/Get-VbrBackupServerInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ function Get-VbrBackupServerInfo {
)
process {
try {
$CimSession = New-CimSession $VBRServer.Name -Credential $Credential -Authentication Negotiate
$PssSession = New-PSSession $VBRServer.Name -Credential $Credential -Authentication Negotiate
$CimSession = try { New-CimSession $VBRServer.Name -Credential $Credential -Authentication Negotiate -Name 'CIMBackupServerDiagram' -ErrorAction Stop } catch { Write-Verbose "Backup Server Section: New-CimSession: Unable to connect to $($VBRServer.Name): $($_.Exception.MessageId)" }

$PssSession = try { New-PSSession $VBRServer.Name -Credential $Credential -Authentication Negotiate -ErrorAction Stop -Name 'PSSBackupServerDiagram' } catch {
if (-Not $_.Exception.MessageId) {
$ErrorMessage = $_.FullyQualifiedErrorId
} else { $ErrorMessage = $_.Exception.MessageId }
Write-Verbose "Backup Server Section: New-PSSession: Unable to connect to $($VBRServer.Name): $ErrorMessage"
}
Write-Verbose -Message "Collecting Backup Server information from $($VBRServer.Name)."
try {
$VeeamVersion = Invoke-Command -Session $PssSession -ErrorAction SilentlyContinue -ScriptBlock { Get-ChildItem -Recurse HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -match 'Veeam Backup & Replication Server' } | Select-Object -Property DisplayVersion }
Expand Down Expand Up @@ -61,7 +67,7 @@ function Get-VbrBackupServerInfo {

$Rows = @{
Role = $Roles
IP = Get-NodeIP -HostName $VBRServer.Name
IP = Get-NodeIP -Hostname $VBRServer.Name
}

if ($VeeamVersion) {
Expand Down Expand Up @@ -89,7 +95,7 @@ function Get-VbrBackupServerInfo {
}

if ($DatabaseServer) {
$DatabaseServerIP = Get-NodeIP -HostName $DatabaseServer
$DatabaseServerIP = Get-NodeIP -Hostname $DatabaseServer

$Rows = @{
Role = 'Database Server'
Expand Down Expand Up @@ -122,7 +128,7 @@ function Get-VbrBackupServerInfo {
try {
$EMServer = [Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo()
if ($EMServer.ServerName) {
$EMServerIP = Get-NodeIP -HostName $EMServer.ServerName
$EMServerIP = Get-NodeIP -Hostname $EMServer.ServerName

$Rows = @{
Role = 'Enterprise Manager Server'
Expand Down
Loading

0 comments on commit 2728559

Please sign in to comment.