Skip to content

Commit

Permalink
Merge pull request #170 from rebelinux/dev
Browse files Browse the repository at this point in the history
v0.8.9
  • Loading branch information
rebelinux authored Sep 1, 2024
2 parents b4c5a16 + 95c1f9d commit f2b80fa
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 39 deletions.
4 changes: 2 additions & 2 deletions AsBuiltReport.Veeam.VBR.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
}
@{
ModuleName = 'Diagrammer.Core';
ModuleVersion = '0.2.1'
ModuleVersion = '0.2.3'
}
@{
ModuleName = 'Veeam.Diagrammer';
ModuleVersion = '0.6.0'
ModuleVersion = '0.6.2'
}
)

Expand Down
2 changes: 1 addition & 1 deletion AsBuiltreport.Veeam.VBR.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"EnableDiagramDebug": false,
"DiagramWaterMark": "",
"ExportDiagrams": true,
"ExportDiagramsFormat": "png",
"ExportDiagramsFormat": ["png"],
"EnableDiagramSignature": false,
"SignatureAuthorName": "",
"SignatureCompanyName": "",
Expand Down
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

##### This project is community maintained and has no sponsorship from Veeam, its employees or any of its affiliates.

## [0.8.9] - Unreleased
## [0.8.9] - 2024-08-31

### Added

- Add ExportDiagramsFormat option that allows specifying the format of exported diagrams.
- Add ExportDiagramsFormat option that allows specifying the format of the exported diagrams
- Supported formats are dot, pdf, png, svg
- Compatibility tests with v12.2 were performed

### Changed

- Increase Diagrammer.Core minimum requirement to v0.2.3
- Increase Veeam.Diagrammer minimum requirement to v0.6.2

### Fixed

- Fix bug while exporting diagram in svg format
- Improve error handling when infrastructure components are missing
- Fix [#169](https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/issues/169)

## [0.8.8] - 2024-07-26

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<a href='https://ko-fi.com/F1F8DEV80' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
</p>

#### This project is community maintained and has no sponsorship from Veeam, its employees or any of its affiliates.

# Veeam VBR As Built Report

Veeam VBR As Built Report is a PowerShell module which works in conjunction with [AsBuiltReport.Core](https://github.com/AsBuiltReport/AsBuiltReport.Core).
Expand Down Expand Up @@ -157,7 +159,7 @@ The **Options** schema allows certain options within the report to be toggled on
| EnableDiagramsDebug | true/false | false | Toggle to enable/disable diagram debug option. |
| DiagramWaterMark | string | empty | Used to set the diagram waterMark. |
| ExportDiagrams | true/false | true | Toggle to enable/disable diagram export option. |
| ExportDiagramsFormat | string | png | Set the format used to export the infrastructure diagram. (dot, png, pdf, svg) |
| ExportDiagramsFormat | string array | png | Set the format used to export the infrastructure diagram. (dot, png, pdf, svg) |
| EnableDiagramSignature | true/false | false | Toggle to enable/disable diagram signature (button right corner) |
| SignatureAuthorName | string | empty | Toggle to set signature author name. |
| SignatureCompanyName | string | empty | Toggle to set signature company name. |
Expand All @@ -171,7 +173,7 @@ There are 4 levels (0-3) of detail granularity for each section as follows;
| Setting | InfoLevel | Description |
| :-----: | ----------- | -------------------------------------------------------------------- |
| 0 | Disabled | Does not collect or display any information |
| 1 | Enabled | Provides summarised information for a collection of objects |
| 1 | Enabled | Provides summarized information for a collection of objects |
| 2 | Adv Summary | Provides condensed, detailed information for a collection of objects |
| 3 | Detailed | Provides detailed information for individual objects |

Expand Down
4 changes: 1 addition & 3 deletions Src/Private/Get-AbrVbrBackupServerInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-AbrVbrBackupServerInfo {
.DESCRIPTION
Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.8.8
Version: 0.8.9
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -31,8 +31,6 @@ function Get-AbrVbrBackupServerInfo {
$OutObj = @()
try {
foreach ($BackupServer in $BackupServers) {
# $CimSession = New-CimSession $BackupServer.Name -Credential $Credential -Authentication $Options.PSDefaultAuthentication
# $PssSession = New-PSSession $BackupServer.Name -Credential $Credential -Authentication $Options.PSDefaultAuthentication
$CimSession = try { New-CimSession $BackupServer.Name -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'CIMBackupServer' -ErrorAction Stop } catch { Write-PScriboMessage -IsWarning "Backup Server Section: New-CimSession: Unable to connect to $($BackupServer.Name): $($_.Exception.MessageId)" }

$PssSession = try { New-PSSession $BackupServer.Name -Credential $Credential -Authentication $Options.PSDefaultAuthentication -ErrorAction Stop -Name 'PSSBackupServer' } catch {
Expand Down
33 changes: 19 additions & 14 deletions Src/Private/Get-AbrVbrDiagram.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ function Get-AbrVbrDiagram {
HelpMessage = 'Specify the Diagram filename'
)]
[ValidateNotNullOrEmpty()]
[ValidateScript({
if (($Format | Measure-Object).count -lt 2) {
$true
} else {
throw "Format value must be unique if Filename is especified."
}
})]
[String] $Filename,

[Parameter(
Expand Down Expand Up @@ -395,7 +388,7 @@ function Get-AbrVbrDiagram {
# SOBR Graphviz Cluster
$SOBR = Get-VbrSOBRInfo
if ($SOBR) {
SubGraph SOBR -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Scale-Out Backup Repository" -IconType "VBR_SOBR" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = 'dashed,rounded' } {
SubGraph SOBR -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Scale-Out Backup Repositories" -IconType "VBR_SOBR" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 'b'; style = 'dashed,rounded' } {

Node SOBRRepo @{Label = (Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject ($SOBR | ForEach-Object { $_.Name.split('.')[0] }) -Align "Center" -iconType "VBR_SOBR_Repo" -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBR.AditionalInfo); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" }

Expand Down Expand Up @@ -435,6 +428,11 @@ function Get-AbrVbrDiagram {
}
}
}
} else {
SubGraph ObjectRepos -Attributes @{Label = (Get-DiaHTMLLabel -ImagesObj $Images -Label "Object Storage" -IconType "VBR_Object" -SubgraphLabel -IconDebug $IconDebug); fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {

Node -Name ObjectRepo -Attributes @{Label = 'No Object Storage Repositories'; shape = "rectangle"; labelloc = 'c'; fixedsize = $true; width = "4"; height = "3"; fillColor = 'transparent'; penwidth = 0 }
}
}

# WanAccels Graphviz Cluster
Expand Down Expand Up @@ -575,8 +573,11 @@ function Get-AbrVbrDiagram {
# Connect Veeam Proxies Server to the Dummy line
if ($Proxies | Where-Object { $_.AditionalInfo.Type -eq 'vSphere' }) {
Edge -From VBRProxyPoint -To ViProxies @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' }
} else {
} elseif (-Not ($Proxies | Where-Object { $_.AditionalInfo.Type -eq 'vSphere' }) -and ($Proxies.AditionalInfo | Where-Object { $_.Type -eq "Off host" -or $_.Type -eq "On host" })) {
Edge -From VBRProxyPoint -To HvProxies @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' }
} else {
Edge -From VBRProxyPoint -To Proxies @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' }

}
# Connect Veeam Repository to the Dummy line
Edge -From VBRRepoPoint -To Repositories @{minlen = 2; arrowtail = 'none'; arrowhead = 'dot'; style = 'dashed' }
Expand All @@ -587,6 +588,8 @@ function Get-AbrVbrDiagram {

} elseif ($ArchObjRepositoriesInfo) {
Edge -To VBRRepoPoint -From ArchObjectRepositories @{minlen = 2; arrowtail = 'dot'; arrowhead = 'none'; style = 'dashed' }
} else {
Edge -To VBRRepoPoint -From ObjectRepo @{minlen = 2; arrowtail = 'dot'; arrowhead = 'none'; style = 'dashed' }
}

# Connect Veeam Wan Accelerator to the Dummy line
Expand Down Expand Up @@ -624,11 +627,13 @@ function Get-AbrVbrDiagram {
}
}
end {
#Export the Diagram
if ($Graph) {
Export-Diagrammer -GraphObj ($Graph | Select-String -Pattern '"([A-Z])\w+"\s\[label="";style="invis";shape="point";]' -NotMatch) -ErrorDebug $EnableErrorDebug -Format $Format -Filename $Filename -OutputFolderPath $OutputFolderPath -WaterMarkText $Options.DiagramWaterMark -WaterMarkColor "Green" -IconPath $IconPath
} else {
Write-PScriboMessage -IsWarning "No Graph object found. Disabling diagram section"
foreach ($OutputFormat in $Format) {
#Export the Diagram
if ($Graph) {
Export-Diagrammer -GraphObj ($Graph | Select-String -Pattern '"([A-Z])\w+"\s\[label="";style="invis";shape="point";]' -NotMatch) -ErrorDebug $EnableErrorDebug -Format $OutputFormat -Filename "$Filename.$OutputFormat" -OutputFolderPath $OutputFolderPath -WaterMarkText $Options.DiagramWaterMark -WaterMarkColor "Green" -IconPath $IconPath
} else {
Write-PScriboMessage -IsWarning "No Graph object found. Disabling diagram section"
}
}
}
}
28 changes: 16 additions & 12 deletions Src/Private/Get-AbrVbrDiagramObjects.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function Get-IconType {
'AzureArchive' { 'VBR_Cloud_Repository' }
'DDBoost' { 'VBR_Deduplicating_Storage' }
'HPStoreOnceIntegration' { 'VBR_Deduplicating_Storage' }
'ExaGrid' { 'VBR_Deduplicating_Storage' }
'SanSnapshotOnly' { 'VBR_Storage_NetApp' }
'Proxy' { 'VBR_Repository' }
'ESXi' { 'VBR_ESXi_Server' }
Expand All @@ -32,6 +33,8 @@ function Get-IconType {
'IndividualComputers' { 'VBR_AGENT_IC' }
'ActiveDirectory' { 'VBR_AGENT_AD' }
'CSV' { 'VBR_AGENT_CSV' }
'CifsShare' {'VBR_NAS'}
'NfsShare' {'VBR_NAS'}
default { 'VBR_No_Icon' }
}

Expand All @@ -58,13 +61,17 @@ function Get-RoleType {
'WinLocal' { 'Windows Local' }
'DDBoost' { 'Dedup Appliances' }
'HPStoreOnceIntegration' { 'Dedup Appliances' }
'ExaGrid' { 'Dedup Appliances' }
'InfiniGuard' { 'Dedup Appliances' }
'Cloud' { 'Cloud' }
'SanSnapshotOnly' { 'SAN' }
"vmware" { 'VMware Backup Proxy' }
"hyperv" { 'HyperV Backup Proxy' }
"agent" { 'Agent & Files Backup Proxy' }
"nas" { 'NAS Backup Proxy' }
default { 'Backup Repository' }
"CifsShare" { 'SMB Share' }
"NfsShare" { 'NFS Share' }
default { 'Unknown' }
}

return $RoleType
Expand Down Expand Up @@ -416,7 +423,7 @@ function Get-VbrRepositoryInfo {
param (
)

[Array]$Repositories = Get-VBRBackupRepository | Where-Object { $_.Type -notin @("SanSnapshotOnly", "AmazonS3Compatible", "WasabiS3") } | Sort-Object -Property Name
[Array]$Repositories = Get-VBRBackupRepository | Where-Object { $_.Type -notin @("SanSnapshotOnly", "AmazonS3Compatible", "WasabiS3", "SmartObjectS3") } | Sort-Object -Property Name
[Array]$ScaleOuts = Get-VBRBackupRepository -ScaleOut | Sort-Object -Property Name
if ($ScaleOuts) {
$Extents = Get-VBRRepositoryExtent -Repository $ScaleOuts | Sort-Object -Property Name
Expand All @@ -429,19 +436,16 @@ function Get-VbrRepositoryInfo {
$IconType = Get-IconType
$Role = Get-RoleType -String $Repository.Type

$Rows = @{}
$Rows = [ordered]@{}

if ($Role -like '*Local' -or $Role -like 'Cloud') {
if ($Repository.Host.Name) {
$Rows.add('Server', $Repository.Host.Name.Split('.')[0])
$Rows.add('Repo Type', $Role)
# $Rows.add('Path', $Repository.FriendlyPath)
$Rows.add('Total Space', "$(($Repository).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used Space', "$(($Repository).GetContainer().CachedFreeSpace.InGigabytes) GB")
} elseif ($Role -like 'Dedup*') {
$Rows.add('Repo Type', $Role)
$Rows.add('Total Space', "$(($Repository).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used Space', "$(($Repository).GetContainer().CachedFreeSpace.InGigabytes) GB")
} else {
$Rows.add('Server', 'N/A')
}
$Rows.add('Repo Type', $Role)
$Rows.add('Total Space', "$(($Repository).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used Space', "$(($Repository).GetContainer().CachedFreeSpace.InGigabytes) GB")

if (($Role -ne 'Dedup Appliances') -and ($Role -ne 'SAN') -and ($Repository.Host.Name -in $ViBackupProxy.Host.Name -or $Repository.Host.Name -in $HvBackupProxy.Host.Name)) {
$BackupType = 'Proxy'
Expand Down
5 changes: 4 additions & 1 deletion Src/Private/Get-AbrVbrSecurityCompliance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-AbrVbrSecurityCompliance {
.DESCRIPTION
Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.8.6
Version: 0.8.9
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -70,6 +70,9 @@ function Get-AbrVbrSecurityCompliance {
'ConfigurationBackupRepositoryNotLocal' = 'The configuration backup is not stored on the backup server'
'LossProtectionEnabled' = 'Password loss protection is enabled'
'TrafficEncryptionEnabled' = 'Encryption network rules added for LAN traffic'
'NetBiosDisabled' = 'NetBIOS protocol should be disabled on all network interfaces'
'LsassProtectedProcess' = 'Local Security Authority Server Service (LSASS) should be set to run as a protected process'
'HardenedRepositoryNotContainsNBDProxies' = 'Hardened repositories should not be used as backup proxy servers due to expanded attack surface'
}
$StatusObj = @{
'Ok' = "Passed"
Expand Down
6 changes: 4 additions & 2 deletions Src/Public/Invoke-AsBuiltReport.Veeam.VBR.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function Invoke-AsBuiltReport.Veeam.VBR {
}
$DiagramParams = @{
'Format' = $DiagramFormat
'FileName' = "AsBuiltReport.Veeam.VBR.$($DiagramFormat)"
'FileName' = "AsBuiltReport.Veeam.VBR"
'OutputFolderPath' = (Get-Location).Path
}

Expand All @@ -492,7 +492,9 @@ function Invoke-AsBuiltReport.Veeam.VBR {
try {
$Graph = Get-AbrVbrDiagram @DiagramParams
if ($Graph) {
Write-Information "Saved 'AsBuiltReport.Veeam.VBR.$($DiagramFormat)' diagram to '$((Get-Location).Path)\'." -InformationAction Continue
foreach ($OutputFormat in $DiagramFormat) {
Write-Information "Saved 'AsBuiltReport.Veeam.VBR.$($OutputFormat)' diagram to '$((Get-Location).Path)\'." -InformationAction Continue
}
}
} catch {
Write-PScriboMessage -IsWarning "Unable to export the Infrastructure Diagram: $($_.Exception.Message)"
Expand Down

0 comments on commit f2b80fa

Please sign in to comment.