Skip to content

Commit

Permalink
Unable to run report #17
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Dec 31, 2023
1 parent 25a114d commit 9d85841
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
54 changes: 42 additions & 12 deletions Src/Private/Get-VbrBackupServerInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,43 @@ function Get-VbrBackupServerInfo {
} catch {$_}

if ($VeeamDBInfo11.SqlServerName) {
$VeeamInfo = $VeeamDBInfo11
$VeeamDBInfo = $VeeamDBInfo11.SqlServerName
}
elseif ($VeeamDBInfo12.SqlServerName) {
$VeeamInfo = $VeeamDBInfo12
$VeeamDBInfo = $VeeamDBInfo12.SqlServerName
}
elseif ($VeeamDBInfo12.SqlHostName) {
$VeeamDBInfo = Switch ($VeeamDBInfo12.SqlHostName) {
'localhost' {$VBRServer.Name}
default {$VeeamDBInfo12.SqlHostName}
}
} else {
$VeeamInfo = $VBRServer.Name
$VeeamDBInfo = $VBRServer.Name
}

try {
if ($VBRServer) {

if ($VeeamDBInfo -eq $VBRServer.Name) {
$Roles = 'Backup and Database'
$DBType = $VeeamDBFlavor.SqlActiveConfiguration
} else {
$Roles = 'Backup Server'
}

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

if ($VeeamVersion) {
$Rows.add('Version', $VeeamVersion.DisplayVersion)
}

if ($VeeamDBInfo -eq $VBRServer.Name) {
$Rows.add('DB Type', $DBType)
}

$script:BackupServerInfo = [PSCustomObject]@{
Name = $VBRServer.Name.split(".")[0]
Label = Get-NodeIcon -Name "$($VBRServer.Name.split(".")[0])" -Type "VBR_Server" -Align "Center" -Rows $Rows
Expand All @@ -66,28 +83,41 @@ function Get-VbrBackupServerInfo {
catch {
$_
}

try {
$DatabaseServer = $VeeamInfo.SqlServerName
$DatabaseServer = $VeeamDBInfo
if ($VeeamDBFlavor.SqlActiveConfiguration -eq "PostgreSql") {
$DBPort = "$($VeeamDBInfo12.SqlHostPort)/TCP"
} else {
$DBPort = "1433/TCP"
}

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

$Rows = @{
Role = 'Database Server'
IP = $DatabaseServerIP
"DB Type" = $VeeamDBFlavor.SqlActiveConfiguration

}

if ($VeeamInfo.SqlInstanceName) {
$Rows.add('Instance', $VeeamInfo.SqlInstanceName)
if ($VeeamDBInfo.SqlInstanceName) {
$Rows.add('Instance', $VeeamDBInfo.SqlInstanceName)
}
if ($VeeamDBInfo.SqlDatabaseName) {
$Rows.add('Database', $VeeamDBInfo.SqlDatabaseName)
}
if ($VeeamInfo.SqlDatabaseName) {
$Rows.add('Database', $VeeamInfo.SqlDatabaseName)

if ($VeeamDBFlavor.SqlActiveConfiguration -eq "PostgreSql") {
$DBIconType = "VBR_Server_DB_PG"
} else {
$DBIconType = "VBR_Server_DB"
}

$script:DatabaseServerInfo = [PSCustomObject]@{
Name = $DatabaseServer.split(".")[0]
Label = Get-NodeIcon -Name "$($DatabaseServer.split(".")[0])" -Type "VBR_Server_DB" -Align "Center" -Rows $Rows
DBPort = "1433/TCP"
Label = Get-NodeIcon -Name "$($DatabaseServer.split(".")[0])" -Type $DBIconType -Align "Center" -Rows $Rows
DBPort = $DBPort
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Src/Private/Images.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ $Images = @{
'VBR_Tape_Server' = 'Tape_Server.png'
'VBR_Tape_Library' = 'Tape_Library.png'
'VBR_Tape_Drive' = 'Tape_Drive.png'
"VBR_Server_DB_PG" = "PostGre_SQL_DB.png"
}
Binary file added icons/PostGre_SQL_DB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d85841

Please sign in to comment.