Skip to content

Commit

Permalink
Add HealthCheck Recommendations AsBuiltReport#100
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Jun 4, 2023
1 parent 63fdf28 commit 43f02e6
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 26 deletions.
17 changes: 12 additions & 5 deletions AsBuiltreport.Veeam.VBR.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,29 @@
"BR": true,
"SOBR": true,
"Server": true,
"Status": true

"Status": true,
"BestPractice": true
},
"Tape": {
"Status": true
"Status": true,
"BestPractice": true
},
"Replication": {
"Status": true,
"BestPractice": true
},
"Security": {
"BestPractice": true
},
"CloudConnect": {
"Tenants": true,
"BackupStorage": true,
"ReplicaResources": true
"ReplicaResources": true,
"BestPractice": true
},
"Jobs": {
"Status": true
"Status": true,
"BestPractice": true
}
}
}
11 changes: 6 additions & 5 deletions Src/Private/Get-AbrVbrBackupjob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ function Get-AbrVbrBackupjob {
'True' {'Enabled'}
}
'Latest Result' = $Bkjob.info.LatestStatus
'Target Repository' = Switch ($Bkjob.info.TargetRepositoryId) {
'00000000-0000-0000-0000-000000000000' {$Bkjob.TargetDir}
{$Null -eq (Get-VBRBackupRepository | Where-Object {$_.Id -eq $Bkjob.info.TargetRepositoryId}).Name} {(Get-VBRBackupRepository -ScaleOut | Where-Object {$_.Id -eq $Bkjob.info.TargetRepositoryId}).Name}
default {(Get-VBRBackupRepository | Where-Object {$_.Id -eq $Bkjob.info.TargetRepositoryId}).Name}
'Scheduled?' = Switch ([string]::IsNullOrEmpty($Bkjob.GetScheduleOptions().NextRun)) {
$true {'No'}
default {'Yes'}
}
}
$OutObj += [pscustomobject]$inobj
Expand All @@ -56,12 +55,14 @@ function Get-AbrVbrBackupjob {
if ($HealthCheck.Jobs.Status) {
$OutObj | Where-Object { $_.'Latest Result' -eq 'Failed' } | Set-Style -Style Critical -Property 'Latest Result'
$OutObj | Where-Object { $_.'Latest Result' -eq 'Warning' } | Set-Style -Style Warning -Property 'Latest Result'
$OutObj | Where-Object { $_.'Status' -eq 'Disabled' } | Set-Style -Style Warning -Property 'Status'
$OutObj | Where-Object { $_.'Scheduled?' -eq 'No' } | Set-Style -Style Warning -Property 'Scheduled?'
}

$TableParams = @{
Name = "Backup Jobs - $VeeamBackupServer"
List = $false
ColumnWidths = 25, 20, 15, 15, 25
ColumnWidths = 41, 20, 13, 13, 13
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
Expand Down
14 changes: 13 additions & 1 deletion Src/Private/Get-AbrVbrBackupjobHyperV.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function Get-AbrVbrBackupjobHyperV {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
if ($InfoLevel.Jobs.Backup -ge 2 -and ($Bkjob.Options.GenerationPolicy.EnableRechek -or $Bkjob.Options.GenerationPolicy.EnableCompactFull)) {
if ($InfoLevel.Jobs.Backup -ge 2) {
Section -Style NOTOCHeading6 -ExcludeFromTOC "Advanced Settings (Maintenance)" {
$OutObj = @()
try {
Expand All @@ -324,6 +324,10 @@ function Get-AbrVbrBackupjobHyperV {
}
$OutObj = [pscustomobject]$inobj

if ($HealthCheck.Jobs.BestPractice) {
$OutObj | Where-Object { $_.'Storage-Level Corruption Guard (SLCG)' -eq "No" } | Set-Style -Style Warning -Property 'Storage-Level Corruption Guard (SLCG)'
}

$TableParams = @{
Name = "Advanced Settings (Maintenance) - $($Bkjob.Name)"
List = $true
Expand All @@ -333,6 +337,12 @@ function Get-AbrVbrBackupjobHyperV {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
if ($HealthCheck.Jobs.BestPractice) {
if ($OutObj | Where-Object { $_.'Storage-Level Corruption Guard (SLCG)' -eq 'No' }) {
Paragraph "Health Check:" -Italic -Bold -Underline
Paragraph "Best Practice: It is recommended to use storage-level corruption guard for any backup job with no active full backups scheduled. Synthetic full backups are still 'incremental forever' and may suffer from corruption over time. Storage-level corruption guard was introduced to provide a greater level of confidence in integrity of the backups." -Italic -Bold
}
}
}
catch {
Write-PscriboMessage -IsWarning "Hyper-V Backup Jobs Storage Options Section: $($_.Exception.Message)"
Expand Down Expand Up @@ -373,6 +383,8 @@ function Get-AbrVbrBackupjobHyperV {

if ($HealthCheck.Jobs.BestPractice) {
$OutObj | Where-Object { $_.'Enabled Backup File Encryption' -eq 'No'} | Set-Style -Style Warning -Property 'Enabled Backup File Encryption'
$OutObj | Where-Object { $_.'Exclude Swap Files Block' -eq 'No'} | Set-Style -Style Warning -Property 'Exclude Swap Files Block'
$OutObj | Where-Object { $_.'Exclude Deleted Files Block' -eq 'No'} | Set-Style -Style Warning -Property 'Exclude Deleted Files Block'
}

$TableParams = @{
Expand Down
2 changes: 2 additions & 0 deletions Src/Private/Get-AbrVbrBackupjobVMware.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ function Get-AbrVbrBackupjobVMware {

if ($HealthCheck.Jobs.BestPractice) {
$OutObj | Where-Object { $_.'Enabled Backup File Encryption' -eq 'No'} | Set-Style -Style Warning -Property 'Enabled Backup File Encryption'
$OutObj | Where-Object { $_.'Exclude Swap Files Block' -eq 'No'} | Set-Style -Style Warning -Property 'Exclude Swap Files Block'
$OutObj | Where-Object { $_.'Exclude Deleted Files Block' -eq 'No'} | Set-Style -Style Warning -Property 'Exclude Deleted Files Block'
}

$TableParams = @{
Expand Down
13 changes: 12 additions & 1 deletion Src/Private/Get-AbrVbrCloudConnectCG.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectCG {
.DESCRIPTION
Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.7.1
Version: 0.7.2
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -66,6 +66,10 @@ function Get-AbrVbrCloudConnectCG {
if ($InfoLevel.CloudConnect.CloudGateway -ge 2) {

$OutObj = [pscustomobject]$inobj
if ($HealthCheck.Jobs.BestPractice) {
$OutObj | Where-Object { $Null -like $_.'Description' } | Set-Style -Style Warning -Property 'Description'
$OutObj | Where-Object { $_.'Description' -match "Created by" } | Set-Style -Style Warning -Property 'Description'
}

$TableParams = @{
Name = "Cloud Gateways - $($CloudObject.Name)"
Expand All @@ -77,6 +81,13 @@ function Get-AbrVbrCloudConnectCG {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Sort-Object -Property 'Name' | Table @TableParams
if ($HealthCheck.Jobs.BestPractice) {
if ($OutObj | Where-Object { $_.'Description' -match 'Created by' -or $Null -like $_.'Description'}) {
Paragraph "Health Check:" -Italic -Bold -Underline
Paragraph "Best Practice: It is a general rule of good practice to establish well-defined descriptions. This helps to speed up the fault identification process, as well as enabling better documentation of the environment." -Italic -Bold
}
}

}
}
catch {
Expand Down
13 changes: 12 additions & 1 deletion Src/Private/Get-AbrVbrCloudConnectGP.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectGP {
.DESCRIPTION
Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.7.1
Version: 0.7.2
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -51,6 +51,11 @@ function Get-AbrVbrCloudConnectGP {
}
}

if ($HealthCheck.Jobs.BestPractice) {
$OutObj | Where-Object { $Null -like $_.'Description' } | Set-Style -Style Warning -Property 'Description'
$OutObj | Where-Object { $_.'Description' -match "Created by" } | Set-Style -Style Warning -Property 'Description'
}

$TableParams = @{
Name = "Gateways Pools - $VeeamBackupServer"
List = $false
Expand All @@ -61,6 +66,12 @@ function Get-AbrVbrCloudConnectGP {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Sort-Object -Property 'Name' | Table @TableParams
if ($HealthCheck.Jobs.BestPractice) {
if ($OutObj | Where-Object { $_.'Description' -match 'Created by' -or $Null -like $_.'Description'}) {
Paragraph "Health Check:" -Italic -Bold -Underline
Paragraph "Best Practice: It is a general rule of good practice to establish well-defined descriptions. This helps to speed up the fault identification process, as well as enabling better documentation of the environment." -Italic -Bold
}
}

}
catch {
Expand Down
24 changes: 21 additions & 3 deletions Src/Private/Get-AbrVbrCloudConnectTenant.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectTenant {
.DESCRIPTION
Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.7.1
Version: 0.7.2
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -27,11 +27,11 @@ function Get-AbrVbrCloudConnectTenant {
process {
try {
if (Get-VBRInstalledLicense | Where-Object {$_.CloudConnect -in @("Enterprise")}) {
if ((Get-VBRCloudTenant).count -gt 0) {
$CloudObjects = Get-VBRCloudTenant | Sort-Object -Property Name
if ($CloudObjects) {
Section -Style Heading3 'Tenants' {
Paragraph "The following table provides status information about Cloud Connect Tenants."
BlankLine
$CloudObjects = Get-VBRCloudTenant | Sort-Object -Property Name
$OutObj = @()
foreach ($CloudObject in $CloudObjects) {
try {
Expand All @@ -57,6 +57,7 @@ function Get-AbrVbrCloudConnectTenant {

if ($HealthCheck.CloudConnect.Tenants) {
$OutObj | Where-Object { $_.'Last Result' -ne 'Success'} | Set-Style -Style Warning -Property 'Last Result'
$OutObj | Where-Object { $Null -like $_.'Last Active' } | Set-Style -Style Warning -Property 'Last Active'
}

$TableParams = @{
Expand All @@ -69,6 +70,12 @@ function Get-AbrVbrCloudConnectTenant {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Sort-Object -Property 'Name' | Table @TableParams
if ($HealthCheck.CloudConnect.BestPractice) {
if ($OutObj | Where-Object { $Null -like $_.'Last Active' }) {
Paragraph "Health Check:" -Italic -Bold -Underline
Paragraph "Best Practice: Validate if the tenant's resources are being utilized" -Italic -Bold
}
}
#---------------------------------------------------------------------------------------------#
# Tenants Configuration Section #
#---------------------------------------------------------------------------------------------#
Expand Down Expand Up @@ -117,6 +124,11 @@ function Get-AbrVbrCloudConnectTenant {

$OutObj = [pscustomobject]$inobj

if ($HealthCheck.Jobs.BestPractice) {
$OutObj | Where-Object { $Null -like $_.'Description' } | Set-Style -Style Warning -Property 'Description'
$OutObj | Where-Object { $_.'Description' -match "Created by" } | Set-Style -Style Warning -Property 'Description'
}

$TableParams = @{
Name = "Tenant - $($CloudObject.Name)"
List = $true
Expand All @@ -127,6 +139,12 @@ function Get-AbrVbrCloudConnectTenant {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Sort-Object -Property 'Name' | Table @TableParams
if ($HealthCheck.Jobs.BestPractice) {
if ($OutObj | Where-Object { $_.'Description' -match 'Created by' -or $Null -like $_.'Description'}) {
Paragraph "Health Check:" -Italic -Bold -Underline
Paragraph "Best Practice: It is a general rule of good practice to establish well-defined descriptions. This helps to speed up the fault identification process, as well as enabling better documentation of the environment." -Italic -Bold
}
}
}
try {
Section -ExcludeFromTOC -Style NOTOCHeading6 'Bandwidth' {
Expand Down
4 changes: 2 additions & 2 deletions Src/Private/Get-AbrVbrFileShareBackupjobConf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function Get-AbrVbrFileShareBackupjobConf {
try {
Write-PscriboMessage "Discovered $($Bkjob.Name) maintenance options."
$inObj = [ordered] @{
'Storage-Level Corruption Guard(SLCG)' = ConvertTo-TextYN $Bkjob.Options.GenerationPolicy.EnableRechek
'Storage-Level Corruption Guard (SLCG)' = ConvertTo-TextYN $Bkjob.Options.GenerationPolicy.EnableRechek
'SLCG Schedule Type' = $Bkjob.Options.GenerationPolicy.RecheckScheduleKind
}

Expand All @@ -256,7 +256,7 @@ function Get-AbrVbrFileShareBackupjobConf {
}
$OutObj | Table @TableParams
if ($HealthCheck.Jobs.BestPractice) {
if ($OutObj | Where-Object { $_.'torage-Level Corruption Guard (SLCG)' -eq 'No' }) {
if ($OutObj | Where-Object { $_.'Storage-Level Corruption Guard (SLCG)' -eq 'No' }) {
Paragraph "Health Check:" -Italic -Bold -Underline
Paragraph "Best Practice: It is recommended to use storage-level corruption guard for any backup job with no active full backups scheduled. Synthetic full backups are still 'incremental forever' and may suffer from corruption over time. Storage-level corruption guard was introduced to provide a greater level of confidence in integrity of the backups." -Italic -Bold
}
Expand Down
Loading

0 comments on commit 43f02e6

Please sign in to comment.