What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Monitoring Veeam Backup & Replication Without Veeam Enterprise Manager

Votes:

0

Markus Kraus of My Cloud-(R)evolution has written an excellent article on monitoring Veeam Backup and Replication using PRTG without needing to use the Veeam Enterprise Manager.

His article is available here: http://mycloudrevolution.com/2016/03/21/veeam-prtg-sensor-reloaded/

Since the original article is in German, Markus has kindly agreed to let us offer an English version of the article in the Knowledge Base.

If you’re already using the Veeam Enterprise Backup Manager, you may also be interested in this article, which explains how to monitor Veeam using Enterprise Manager.

custom-sensor powershell veeam

Created on Nov 9, 2016 12:57:01 PM by  Kimberley Trommler [Paessler Support] (7) 3

Last change on Nov 9, 2016 1:05:09 PM by  Kimberley Trommler [Paessler Support] (7) 3



35 Replies

Votes:

0

DISCLAIMER: This CUSTOM SENSOR and its underlying script was made by http://mycloudrevolution.com/. We ONLY translated the how-to into English. For any question to this approach, please get in contact with https://github.com/mycloudrevolution/Advanced-PRTG-Sensors/


Note: There is a known issue when upgrading to Veeam v10. For more information or updates, see the GitHub page.

Veeam PRTG Sensor Reloaded

Thanks for all the feedback on my PRTG – Veeam B & R Monitoring article. It’s become clear to me that Veeam Enterprise Server and its RESTful API isn’t as widespread as I thought. So, I’ve created a new version of my PRTG Veeam Advanced Sensor – the Veeam PRTG Sensor Reloaded.

http://mycloudrevolution.com/wp-content/uploads/2016/03/Veeam-Session_V3.png

Requirements for the new sensor:

  • Use the Veeam Powershell Snapin
  • Take the target server (Veeam B&R server) as a parameter
  • Report on repository usage
  • Simple to extend

I quickly ran into a fundamental problem when using the Veeam Powershell Snapin in conjunction with PRTG:

The Veeam PowerShell Plugin is 64-bit only, but PRTG runs all scripts on the probe in 32-bit only.

After some research and testing, I found the PSx64 tool from PRTG Tools Family (@prtgtoolsfamily), which has proven to be a good and robust solution.

Veeam PRTG Sensor Reloaded – Configuration

The PSx64 tool is added to PRTG as an EXE/Script Advanced sensor:

http://mycloudrevolution.com/wp-content/uploads/2016/03/prtg-sensor-neu-v2.png

You can also include parameters, for example, the FQDN of the Veeam B&R server:

http://mycloudrevolution.com/wp-content/uploads/2016/03/prtg-sensor-mit-parameter-neu.png

Parameters for the PSx64.exe:

-f= PowerShell Script -p= Parameter für das Script – z.B. „-BRHost veeam01.lan.local“

Since the script requires powershell session credentials to set up the connection to the Veeam Backup & Recovery Server, these credentials need to be entered into PRTG, and then you need to use the option “use Windows credentials of parent device”.

THE SCRIPT

Note: The script below is cut-and-paste from GitHub. To get a copy of the most recent version, use this GitHub Gist

<#
        .SYNOPSIS
        PRTG Veeam Advanced Sensor
  
        .DESCRIPTION
        Advanced Sensor will Report Statistics about Backups during last 24 Hours and Actual Repository usage.
        
        .EXAMPLE
        PRTG-VeeamBRStats.ps1 -BRHost veeam01.lan.local
        .EXAMPLE
        PRTG-VeeamBRStats.ps1 -BRHost veeam01.lan.local -reportmode "Monthly" -repoCritical 80 -repoWarn 70 -Debug
 
        .Notes
        NAME:  PRTG-VeeamBRStats.ps1
        LASTEDIT: 08/09/2016
        VERSION: 1.3
        KEYWORDS: Veeam, PRTG
   
        .Link
        http://mycloudrevolution.com/
 
 #Requires PS -Version 3.0
 #Requires -Modules VeeamPSSnapIn    
 #>
[cmdletbinding()]
param(
    [Parameter(Position=0, Mandatory=$false)]
        [string] $BRHost = "veeam01.lan.local",
    [Parameter(Position=1, Mandatory=$false)]
        $reportMode = "24", # Weekly, Monthly as String or Hour as Integer
    [Parameter(Position=2, Mandatory=$false)]
        $repoCritical = 10,
    [Parameter(Position=3, Mandatory=$false)]
        $repoWarn = 20
  
)

# Big thanks to Shawn, creating a awsome Reporting Script:
# http://blog.smasterson.com/2016/02/16/veeam-v9-my-veeam-report-v9-0-1/

#region: Start Load VEEAM Snapin (if not already loaded)
if (!(Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue)) {
 if (!(Add-PSSnapin -PassThru VeeamPSSnapIn)) {
  # Error out if loading fails
  Write-Error "`nERROR: Cannot load the VEEAM Snapin."
  Exit
 }
}
#endregion

#region: Functions
Function Get-vPCRepoInfo {
[CmdletBinding()]
        param (
                [Parameter(Position=0, ValueFromPipeline=$true)]
                [PSObject[]]$Repository
                )
        Begin {
                $outputAry = @()
                Function Build-Object {param($name, $repohost, $path, $free, $total)
                        $repoObj = New-Object -TypeName PSObject -Property @{
                                        Target = $name
          RepoHost = $repohost
                                        Storepath = $path
                                        StorageFree = [Math]::Round([Decimal]$free/1GB,2)
                                        StorageTotal = [Math]::Round([Decimal]$total/1GB,2)
                                        FreePercentage = [Math]::Round(($free/$total)*100)
                                }
                        Return $repoObj | Select Target, RepoHost, Storepath, StorageFree, StorageTotal, FreePercentage
                }
        }
        Process {
                Foreach ($r in $Repository) {
                 # Refresh Repository Size Info
     [Veeam.Backup.Core.CBackupRepositoryEx]::SyncSpaceInfoToDb($r, $true)
     
     If ($r.HostId -eq "00000000-0000-0000-0000-000000000000") {
      $HostName = ""
     }
     Else {
      $HostName = $($r.GetHost()).Name.ToLower()
     }
     $outputObj = Build-Object $r.Name $Hostname $r.Path $r.info.CachedFreeSpace $r.Info.CachedTotalSpace
     }
                $outputAry += $outputObj
        }
        End {
                $outputAry
        }
}
#endregion

#region: Start BRHost Connection
Write-Output "Starting to Process Connection to $BRHost ..."
$OpenConnection = (Get-VBRServerSession).Server
if($OpenConnection -eq $BRHost) {
 Write-Output "BRHost is Already Connected..."
} elseif ($OpenConnection -eq $null ) {
 Write-Output "Connecting BRHost..."
 Connect-VBRServer -Server $BRHost
} else {
    Write-Output "Disconnection actual BRHost..."
    Disconnect-VBRServer
    Write-Output "Connecting new BRHost..."
    Connect-VBRServer -Server $BRHost
}

$NewConnection = (Get-VBRServerSession).Server
if ($NewConnection -eq $null ) {
 Write-Error "`nError: BRHost Connection Failed"
 Exit
}
#endregion

#region: Convert mode (timeframe) to hours
If ($reportMode -eq "Monthly") {
        $HourstoCheck = 720
} Elseif ($reportMode -eq "Weekly") {
        $HourstoCheck = 168
} Else {
        $HourstoCheck = $reportMode
}
#endregion

#region: Collect and filter Sessions
# $vbrserverobj = Get-VBRLocalhost        # Get VBR Server object
# $viProxyList = Get-VBRViProxy           # Get all Proxies
$repoList = Get-VBRBackupRepository     # Get all Repositories
$allSesh = Get-VBRBackupSession         # Get all Sessions (Backup/BackupCopy/Replica)
# $allResto = Get-VBRRestoreSession       # Get all Restore Sessions
$seshListBk = @($allSesh | ?{($_.CreationTime -ge (Get-Date).AddHours(-$HourstoCheck)) -and $_.JobType -eq "Backup"})           # Gather all Backup sessions within timeframe
$seshListBkc = @($allSesh | ?{($_.CreationTime -ge (Get-Date).AddHours(-$HourstoCheck)) -and $_.JobType -eq "BackupSync"})      # Gather all BackupCopy sessions within timeframe
$seshListRepl = @($allSesh | ?{($_.CreationTime -ge (Get-Date).AddHours(-$HourstoCheck)) -and $_.JobType -eq "Replica"})        # Gather all Replication sessions within timeframe
#endregion

#region: Collect Jobs
# $allJobsBk = @(Get-VBRJob | ? {$_.JobType -eq "Backup"})        # Gather Backup jobs
# $allJobsBkC = @(Get-VBRJob | ? {$_.JobType -eq "BackupSync"})   # Gather BackupCopy jobs
# $repList = @(Get-VBRJob | ?{$_.IsReplica})                      # Get Replica jobs
#endregion

#region: Get Backup session informations
$totalxferBk = 0
$totalReadBk = 0
$seshListBk | %{$totalxferBk += $([Math]::Round([Decimal]$_.Progress.TransferedSize/1GB, 0))}
$seshListBk | %{$totalReadBk += $([Math]::Round([Decimal]$_.Progress.ReadSize/1GB, 0))}
#endregion

#region: Preparing Backup Session Reports
$successSessionsBk = @($seshListBk | ?{$_.Result -eq "Success"})
$warningSessionsBk = @($seshListBk | ?{$_.Result -eq "Warning"})
$failsSessionsBk = @($seshListBk | ?{$_.Result -eq "Failed"})
$runningSessionsBk = @($allSesh | ?{$_.State -eq "Working" -and $_.JobType -eq "Backup"})
$failedSessionsBk = @($seshListBk | ?{($_.Result -eq "Failed") -and ($_.WillBeRetried -ne "True")})
#endregion

#region:  Preparing Backup Copy Session Reports
$successSessionsBkC = @($seshListBkC | ?{$_.Result -eq "Success"})
$warningSessionsBkC = @($seshListBkC | ?{$_.Result -eq "Warning"})
$failsSessionsBkC = @($seshListBkC | ?{$_.Result -eq "Failed"})
$runningSessionsBkC = @($allSesh | ?{$_.State -eq "Working" -and $_.JobType -eq "BackupSync"})
$IdleSessionsBkC = @($allSesh | ?{$_.State -eq "Idle" -and $_.JobType -eq "BackupSync"})
$failedSessionsBkC = @($seshListBkC | ?{($_.Result -eq "Failed") -and ($_.WillBeRetried -ne "True")})
#endregion

#region: Preparing Replicatiom Session Reports
$successSessionsRepl = @($seshListRepl | ?{$_.Result -eq "Success"})
$warningSessionsRepl = @($seshListRepl | ?{$_.Result -eq "Warning"})
$failsSessionsRepl = @($seshListRepl | ?{$_.Result -eq "Failed"})
$runningSessionsRepl = @($allSesh | ?{$_.State -eq "Working" -and $_.JobType -eq "Replica"})
$failedSessionsRepl = @($seshListRepl | ?{($_.Result -eq "Failed") -and ($_.WillBeRetried -ne "True")})

$RepoReport = $repoList | Get-vPCRepoInfo | Select     @{Name="Repository Name"; Expression = {$_.Target}},
                                                       @{Name="Host"; Expression = {$_.RepoHost}},
                                                       @{Name="Path"; Expression = {$_.Storepath}},
                                                       @{Name="Free (GB)"; Expression = {$_.StorageFree}},
                                                       @{Name="Total (GB)"; Expression = {$_.StorageTotal}},
                                                       @{Name="Free (%)"; Expression = {$_.FreePercentage}},
                                                       @{Name="Status"; Expression = {
                                                       If ($_.FreePercentage -lt $repoCritical) {"Critical"} 
                                                       ElseIf ($_.FreePercentage -lt $repoWarn) {"Warning"}
                                                       ElseIf ($_.FreePercentage -eq "Unknown") {"Unknown"}
                                                       Else {"OK"}}} | `
                                                       Sort "Repository Name" 
#endregion

#region: XML Output for PRTG
Write-Host "<prtg>" 
$Count = $successSessionsBk.Count
Write-Host "<result>"
               "<channel>Successful-Backups</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>"
$Count = $warningSessionsBk.Count
Write-Host "<result>"
               "<channel>Warning-Backups</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxWarning>0</LimitMaxWarning>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $failsSessionsBk.Count
Write-Host "<result>"
               "<channel>Failes-Backups</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>0</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $failedSessionsBk.Count
Write-Host "<result>"
               "<channel>Failed-Backups</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>0</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $runningSessionsBk.Count
Write-Host "<result>"
               "<channel>Running-Backups</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>" 

$Count = $successSessionsBkC.Count
Write-Host "<result>"
               "<channel>Successful-BackupCopys</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>"
$Count = $warningSessionsBkC.Count
Write-Host "<result>"
               "<channel>Warning-BackupCopys</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxWarning>0</LimitMaxWarning>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $failsSessionsBkC.Count
Write-Host "<result>"
               "<channel>Failes-BackupCopys</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>0</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $failedSessionsBkC.Count
Write-Host "<result>"
               "<channel>Failed-BackupCopys</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>0</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $runningSessionsBkC.Count
Write-Host "<result>"
               "<channel>Running-BackupCopys</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>" 
$Count = $IdleSessionsBkC.Count
Write-Host "<result>"
               "<channel>Idle-BackupCopys</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>" 

$Count = $successSessionsRepl.Count
Write-Host "<result>"
               "<channel>Successful-Replications</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>"
$Count = $warningSessionsRepl.Count
Write-Host "<result>"
               "<channel>Warning-Replications</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxWarning>0</LimitMaxWarning>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $failsSessionsRepl.Count
Write-Host "<result>"
               "<channel>Failes-Replications</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>0</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $failedSessionsRepl.Count
Write-Host "<result>"
               "<channel>Failed-Replications</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>0</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
$Count = $runningSessionsRepl.Count
Write-Host "<result>"
               "<channel>Running-Replications</channel>"
               "<value>$Count</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>" 

Write-Host "<result>"
               "<channel>TotalBackupRead</channel>"
               "<value>$totalReadBk</value>"
               "<unit>Custom</unit>"
               "<customUnit>GB</customUnit>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>" 
Write-Host "<result>"
               "<channel>TotalBackupTransfer</channel>"
               "<value>$totalxferBk</value>"
               "<unit>Custom</unit>"
               "<customUnit>GB</customUnit>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "</result>" 

foreach ($Repo in $RepoReport){
$Name = "REPO - " + $Repo."Repository Name"
$Free = $Repo."Free (%)"
Write-Host "<result>"
               "<channel>$Name</channel>"
               "<value>$Free</value>"
               "<unit>Percent</unit>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMinWarning>20</LimitMinWarning>"
               "<LimitMinError>10</LimitMinError>"
               "<LimitMode>1</LimitMode>"
               "</result>" 
 }
Write-Host "</prtg>" 
#endregion

#region: Debug
if ($DebugPreference -eq "Inquire") {
 $RepoReport | ft * -Autosize
    
    $SessionObject = [PSCustomObject] @{
     "Successful Backups"  = $successSessionsBk.Count
     "Warning Backups" = $warningSessionsBk.Count
     "Failes Backups" = $failsSessionsBk.Count
     "Failed Backups" = $failedSessionsBk.Count
     "Running Backups" = $runningSessionsBk.Count
     "Warning BackupCopys" = $warningSessionsBkC.Count
     "Failes BackupCopys" = $failsSessionsBkC.Count
     "Failed BackupCopys" = $failedSessionsBkC.Count
     "Running BackupCopys" = $runningSessionsBkC.Count
     "Idle BackupCopys" = $IdleSessionsBkC.Count
     "Successful Replications" = $successSessionsRepl.Count
        "Warning Replications" = $warningSessionsRepl.Count
        "Failes Replications" = $failsSessionsRepl.Count
        "Failed Replications" = $failedSessionsRepl.Count
        "Running Replications" = $RunningSessionsRepl.Count
    }
    $SessionResport += $SessionObject
    $SessionResport
}
#endregion

Special Thanks

Many thanks to Shawn Masterson (@smasterson24) for creating this fantastic Veeam Report, which I used as the basis for this sensor.

New Versions

Version 1.2 – 09.08.2016

  • New: BackupCopy Sessions
  • Improvement: Exclude unused data
  • Improvement: PS Region definitions
  • Improvement: PS Required definitions
  • Tested with Veeam B&R Version 9 Update 1 und Update 2

Version 1.3 – 03.11.2016

  • New: Debug
  • New: additional parameters “-reportmode -repoCritical -repoWarn”
  • Improvement: reorganize the regions

GitHub Repository

I’ve created a GitHub Repository with the most current scripts. I invite you to take part in this project. Whether it’s a pull request, bug report or feature request – all input and participation is welcome.

http://mycloudrevolution.com/wp-content/uploads/2016/03/Advanced-PRTG-Sensors-GitHub.png

DISCLAIMER: This CUSTOM SENSOR and its underlying script was made by http://mycloudrevolution.com/. We ONLY translated the how-to into English. For any question to this approach, please get in contact with https://github.com/mycloudrevolution/Advanced-PRTG-Sensors/

Created on Nov 9, 2016 1:48:01 PM by  Kimberley Trommler [Paessler Support] (7) 3

Last change on Sep 28, 2021 10:40:14 AM by  Florian Lesage [Paessler Support]



Votes:

0

Thank you Markus for the great work! It's a pleasure to monitor our Veeam environment with your powershell sendor.

Is there a minimum version of Veeam Backup & Replication required to run the script?

Created on Jul 13, 2017 1:01:47 PM



Votes:

0

Dear team,

Many thanks for this script, this one fully success when my distant probe is on the same server of veeam server. But when my probe is on one server and Veeam on otherone, I have the terrible message "JSON" shema is not correct.

I use this argument is the success exemple: -f="PRTG-VeeamBRStats.ps1" For the 2 different server (PRTG distant and Veeam), I use this one: -f="PRTG-VeeamBRStats.ps1" -p="-BRHost srv-veeam-1.jans.local"

All the orther options are the same (write on disk, ....)

Any idea ?

First, many thanks again :)

Created on Jan 10, 2018 9:28:04 PM



Votes:

0

Hi there,

Please activate the "Write EXE result to disk" option in the sensor's settings and post the log files (Result of Sensor XXX.Data.txt and Result of Sensor XXX.txt) located on the corresponding probe under "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)".

Best regards.

Created on Jan 11, 2018 8:48:23 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

I am also getting a JSON error on this sensor. The output appears correct when run directly through Powershell, and I get data in my log that is actually my data, but I think there is something wrong with the formatting.

Error in PRTG:

XML: XML Parser mismatch: Wanted , got -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)

From my log:

0:\</channel> <value>28</value> <unit>Percent</unit> <showChart>1</showChart> <showTable>1</showTable> <LimitMinWarning>20</LimitMinWarning> <LimitMinError>10</LimitMinError> <LimitMode>1</LimitMode> </result> <result> <channel>REPO - Backup Repository G

From my data log (i removed identifying information and replaced with <>):

Data['blockedsens'].asString := '';
Data['canlinux'].asString := '0';
Data['channelinfos'].asString := '{}';
Data['channelnames'].asString := '';
Data['environment'].asString := '';
Data['exefile'].asString := 'PSx64.exe';
Data['exeparams'].asString := '-f="PRTG-VeeamBRStats.ps1"';
Data['fastcount'].asString := '0';
Data['host'].asString := '<>';
Data['hostv6'].asString := '';
Data['inerror'].asString := '1';
Data['interfacenumber'].asString := '';
Data['inum'].asString := '';
Data['ipversion'].asString := '0';
Data['isexesensor'].asString := '1';
Data['lastmsg'].asString := '#Y2 XML Parser mismatch: Wanted </>, got </channel> @#O231[Invalid JSON.]';
Data['lastuptime'].asString := '0';
Data['linuxlogindomain'].asString := '';
Data['linuxloginpassword'].asString := '***';
Data['monitorchange'].asString := '';
Data['mutexname'].asString := '';
Data['notonpod'].asString := '0';
Data['reboot'].asString := '43110.6750245718';
Data['reqmsginterval'].asString := '60';
Data['resultfile'].asString := 'Result of Sensor 20408.txt';
Data['sensorid'].asString := '20408';
Data['simulate'].asString := '0';
Data['timeout'].asString := '60';
Data['tlsexplicit_default'].asString := '';
Data['tlsexplicit_ftp'].asString := '';
Data['tlsexplicit_imap'].asString := '';
Data['tlsexplicit_pop3'].asString := '';
Data['tlsexplicit_port'].asString := '';
Data['tlsexplicit_smtp'].asString := '';
Data['uptimecount'].asString := '0';
Data['usednstime'].asString := '0';
Data['usewindowsauthentication'].asString := '1';
Data['windowslogindomain'].asString := '<>';
Data['windowsloginpassword'].asString := '***';
Data['windowsloginusername'].asString := '<>';
Data['writeresult'].asString := '1';

Created on Jan 11, 2018 6:12:07 PM

Last change on Jan 11, 2018 6:46:10 PM by  Luciano Lingnau [Paessler]



Votes:

0

Hi there,

Unfortunately, the output is entirely incorrect. Please note that the output has to begin with "<prtg>" followed by "<result>", like this:

"<prtg>" 
"<result>"
"<channel>Successful-Backups</channel>"
 "<value>$Count</value>"
"<showChart>1</showChart>"
"<showTable>1</showTable>"
"</result>"

Best regards.

Created on Jan 12, 2018 1:39:28 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

That's what I thought, and that is what I get from the script when it is run directly in Powershell. Somewhere along the lines, formatting for PRTG is failing. I guess I need to figure that out. Thanks!

Created on Jan 12, 2018 9:01:34 PM



Votes:

0

I'm receiving an error when i start the sensor: "Connect-VBRServer : Failed to connect to Veeam Backup & Replication server: Access denied. "

The security context is set to "Use Windows Credentials of Parent Device"

Which user account do i need to use in order to get it running?

R,

Created on Jan 30, 2018 12:46:30 PM



Votes:

0

Hi there,

Have you entered the correct user details in the Windows Credentials of Parent Device?

Best regards.

Created on Jan 31, 2018 8:17:52 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Thank for the tip, i overlooked the credentials of the parent device, the script is up and running.

Thank,

Created on Jan 31, 2018 12:43:58 PM



Votes:

0

Thanks Dariusz, it is working.

Does anyone know if its possible to monitor the status of the Backupobject (VM's) rather than the backupjob. We have multiple objects per job and in the currtent situation the status shows failed when one of the backupobjects has failed to create a backup.

R,

Created on Feb 8, 2018 1:05:45 PM



Votes:

0

Hi,

I am using the script but running into an issue. I believe I have everything working correctly.

If I run the script manually from Powershell on the PRTG server, or check the 'result of sensor' log from the PRTG logs folder, I see the expected output

Starting to Process Connection to veeambackupserver.lan.local ...

Connecting BRHost...

<prtg>

<result>

<channel>Successful-Backups</channel>

<value>5</value>

<showChart>1</showChart>

<showTable>1</showTable>

</result>

<result>

<channel>Warning-Backups</channel>

<value>0</value>

<showChart>1</showChart>

<showTable>1</showTable>

<LimitMaxWarning>0</LimitMaxWarning>

<LimitMode>1</LimitMode>

</result>

<result>

...etc, etc.

However, from PRTG console I get error "response not well-formed: "(Starting to process ...etc, etc.

Where am I going wrong? Thanks in advance

Created on Apr 17, 2018 3:16:37 PM

Last change on Apr 17, 2018 5:58:56 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi there,

There must be something in the log that breaks the output. Please activate the "Write EXE result to disk" option in the sensor's settings and post the log files (Result of Sensor XXX.Data.txt and Result of Sensor XXX.txt) located on the corresponding probe under "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)".

Best regards.

Created on Apr 17, 2018 5:59:35 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hello together, I have the problem, that if I want to create the following error:

https://push.schmandre.de/2018-10-09_10:35:18_cfc261be3694455c35c20db4908524ed.png

I have two virtual machines. One with Veeam (X.X.X.105) and one with PRTG (X.X.X.104). (X are just placeholders for IP. In real they are filled with right numbers).

Cause they are not in a domain, I've entered the following parameters at the PRTG Veeam sensors to let PRTG connect to the Veeam machine:

-f="PRTG_VeeamBRStats.ps1" -p="-BRHost X.X.X.105“

and as programm PSx64.exe

I've enabled the powershell by the "Set-ExecutionPolicy RemoteSigned" command.

Now I dont have any ideas to fix the problem )=

Hope anyone has an idea.

Best regards
Schmand_

Created on Oct 9, 2018 8:40:24 AM

Last change on Oct 9, 2018 8:56:48 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi Anré,

The same is valid as for the posters before. :)

Please activate the "Write EXE result to disk" option in the sensor's settings and post the log files (Result of Sensor XXX.Data.txt and Result of Sensor XXX.txt) located on the corresponding probe under "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)".

Best regards.

Created on Oct 9, 2018 8:57:42 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Data['blockedsens'].asString := '';
Data['canlinux'].asString := '0';
Data['channelinfos'].asString := '{}';
Data['channelnames'].asString := '';
Data['environment'].asString := '';
Data['exefile'].asString := 'PSx64.exe';
Data['exeparams'].asString := '-f="PRTG_VeeamBRStats.ps1" -p="-BRHost 192.168.0.105“';
Data['fastcount'].asString := '0';
Data['host'].asString := '*CENSORED*';
Data['hostv6'].asString := '';
Data['inerror'].asString := '1';
Data['interfacenumber'].asString := '';
Data['inum'].asString := '';
Data['ipversion'].asString := '0';
Data['isexesensor'].asString := '1';
Data['lastmsg'].asString := '#Y2 @#O233 @#O231[No mapping for the Unicode character exists in the target multi-byte code page]';
Data['lastuptime'].asString := '0';
Data['linuxlogindomain'].asString := '';
Data['linuxloginpassword'].asString := '***';
Data['monitorchange'].asString := '';
Data['mutexname'].asString := '';
Data['notonpod'].asString := '0';
Data['reboot'].asString := '43381.3839208681';
Data['reqmsginterval'].asString := '60';
Data['resultfile'].asString := 'Result of Sensor 2139.txt';
Data['sensorid'].asString := '2139';
Data['simulate'].asString := '0';
Data['timeout'].asString := '60';
Data['tlsexplicit_default'].asString := '';
Data['tlsexplicit_ftp'].asString := '';
Data['tlsexplicit_imap'].asString := '';
Data['tlsexplicit_pop3'].asString := '';
Data['tlsexplicit_port'].asString := '';
Data['tlsexplicit_smtp'].asString := '';
Data['uptimecount'].asString := '0';
Data['usednstime'].asString := '0';
Data['usewindowsauthentication'].asString := '1';
Data['windowslogindomain'].asString := '';
Data['windowsloginpassword'].asString := '***';
Data['windowsloginusername'].asString := '*CENSORED*';
Data['writeresult'].asString := '1';

So maybe here can be the problem.
I just have added a new sensor to the local probe which is running on my prtg sever.
As I understand I have to create a second local probe on my Veeam Server?

Cause as you can see, the VeeamSnapIn cannot be found, cause on the prtg server, veeam isnt is installed.

Add-PSSnapin : Es wurden keine Snap-Ins fr die Windows PowerShell-Version 5 registriert.
In C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG_VeeamBRStats.ps1:44 Zeichen:8
+     if (!(Add-PSSnapin -PassThru VeeamPSSnapIn)) {
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapIn:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
 
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG_VeeamBRStats.ps1 : 
ERROR: Cannot load the VEEAM Snapin.
In Zeile:1 Zeichen:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG_VeeamBRStats.ps1
 
0:

Created on Oct 9, 2018 9:18:41 AM

Last change on Oct 9, 2018 9:48:43 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi André,

Could you issue the following PowerShell Command on the PRTG Core Server to see what you get back?

Get-PSSnapin -Name VeeamPSSnapIn

Best regards.

Created on Oct 9, 2018 9:49:52 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hello Dariusz,

thanks for the fast reply. On the PRTG Core Server I get the following message:

PS C:\Windows\system32> Get-PSSnapin -Name VeeamPSSnapIn
Get-PSSnapin : No Windows PowerShell snap-ins matching the pattern 'VeeamPSSnapIn' were found. Check the pattern and
then try the command again.
At line:1 char:1
+ Get-PSSnapin -Name VeeamPSSnapIn
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapIn:String) [Get-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.GetPSSnapinCommand

Best regards.

Created on Oct 9, 2018 10:07:34 AM



Votes:

1

Hi André,

The error message indicates that the VMWare Snapin could not be found on the PRTG Server. Unfortunately, I am not sure what to do at this point as this script is not created by us as mentioned in the initial Top Answer:
https://github.com/mycloudrevolution/Advanced-PRTG-Sensors/

Best regards.

Created on Oct 9, 2018 10:13:13 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi Dariusz,

the problem that the Veaam SnapIn cannot be found on prtg core server is correct. But on the server where Veeam is installed I'll get the following reply.

PS C:\Windows\system32> Get-PSSnapin -Name VeeamPSSnapIn


Name        : VeeamPSSnapin
PSVersion   : 5.1
Description : This is a PowerShell snap-in that includes the Veeam's cmdlet.

So correct me if Iam wrong but is there a way to execute the powershell script at the target machine (Veeam) and not on the Core PRTG server?

Created on Oct 9, 2018 10:26:44 AM

Last change on Oct 9, 2018 10:39:00 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi André,

Could you try installing the snapin on the Core Server?
https://www.veeam.com/kb1489

Best regards.

Created on Oct 9, 2018 10:39:22 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Anyone got any suggestions on why I am getting this issue when I manually try running the command?

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PSx64.exe -f="PRTG-VeeamBRStats.ps1" -p="-BRHost xxx.xxx.xxx.xxx" 0: PowerShell environment initialization failed

This is on the PRTG core server and in a 64bit PS window I can access the Veeam snap-in

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Get-PSSnapin -Registered

Name        : VeeamPSSnapIn
PSVersion   : 4.0
Description : This is a PowerShell snap-in that includes the Veeam's cmdlet.

Any suggestions? Am I doing something wrong? When I run the script manually (not using PSx64.exe) it works correctly.

Created on Nov 26, 2019 5:04:34 AM

Last change on Nov 26, 2019 6:06:55 AM by  Stephan Linke [Paessler Support]



Votes:

0

It's more likely that you'll receive a response on their GitHub repository :)

Created on Nov 26, 2019 6:08:58 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi everyone

I installed ps64 and the script on the probe and it doesn<t work

If i go on the probe directly and try to run the .ps1 -p x.x.x.x it says the user doesn't have the right to connect to the BR server

But the same script works on the BR server itself

And yes i installed the Veeam console on the probe

Any help?

Created on Jun 29, 2020 6:55:14 PM



Votes:

0

Please post that as an issue in their Github repository. We can't assist with this, unfortunately :(

Created on Jun 30, 2020 6:35:35 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi quick question, i was able to make the sensor work

Now when a backup fail we go get the error, but if we do another backup and it success the Sensor still has 1 in fail, and give us a down status

How can we fix that?

Thanks

Created on Jun 30, 2020 2:15:40 PM



Votes:

0

See my previous reply :/ Sorry for not being of much help here, but 3rd party scripts are out of scope. When recreating the Sensor, does it show the status correctly? Or when pausing/resuming?

Created on Jul 1, 2020 6:08:29 AM by  Stephan Linke [Paessler Support]



Votes:

1

Can you please update the Script for Veeam V11? Powershell Snapin isn't working anymore. So you have to Import Powershell-Module. Thanks in advance.

Created on Mar 15, 2021 4:26:27 PM



Votes:

0

Does anybody know what to change, to get it working in V11 ?

Created on Mar 16, 2021 5:38:43 PM



Votes:

1

Hi there,

for everyone asking for a fixed version for version 11 of Veeam, please note the Disclaimer above:

DISCLAIMER: This CUSTOM SENSOR and its underlying script was made by http://mycloudrevolution.com/. We ONLY translated the how-to into English. For any question to this approach, please get in contact with https://github.com/mycloudrevolution/Advanced-PRTG-Sensors/

Apparently, there is already an ongoing discussion (German) on the developer's blog:
https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/

This being said, please check back the developers Github space for any updates. Once released, we will update the article here as well.

Thank you very much in advance,
Sebastian

Created on Mar 17, 2021 6:34:34 AM by  Sebastian Kniege [Paessler Support]



Votes:

1

Hi

I downloaded the latest version of ps-script (from github) and psx64.exe (from https://prtgtoolsfamily.com/downloads/sensors). It works fine.

Created on Mar 17, 2021 6:59:59 AM



Votes:

0

I also would try the script, but I can't find the psx64.exe on the prtgtoolsfamily-website.

Created on Mar 23, 2021 10:57:52 AM



Votes:

0

Hello Guenter,

You will find the application PSx64 in the list on the PRTG Tools Family website mentioned above, as illustrated below:

PRTG Tools Family

Regards.

Created on Mar 23, 2021 11:18:16 AM by  Florian Lesage [Paessler Support]



Votes:

0

Hi,

We have this error :

Data['linuxloginpassword'].asString := '';
Data['notonpod'].asString := '0';
Data['fastcount'].asString := '0';
Data['lastmsg'].asString := '#Y2 Structural error in xml file, 3 open items. @#O231[No mapping for the Unicode character exists in the target multi-byte code page]';
Data['resultfile'].asString := 'Result of Sensor 6160.txt';
Data['windowsloginusername'].asString := 'admins';
Data['hostv6'].asString := '';
Data['exefile'].asString := 'PSx64.exe';
Data['lastuptime'].asString := '0';
Data['writeresult'].asString := '1';
Data['blockedsens'].asString := '';
Data['reqmsginterval'].asString := '60';
Data['windowslogindomain'].asString := 'DOMAIN';
Data['tlsexplicit_imap'].asString := '';
Data['channelnames'].asString := '';
Data['tlsexplicit_default'].asString := '';
Data['canlinux'].asString := '0';
Data['isexesensor'].asString := '1';
Data['windowsloginpassword'].asString := '***';
Data['environment'].asString := '';
Data['mutexname'].asString := '';
Data['channelinfos'].asString := '{}';
Data['uptimecount'].asString := '0';
Data['vmwareparams'].asString := '1';
Data['reboot'].asString := '44399.5818566204';
Data['usednstime'].asString := '0';
Data['newpowershell'].asString := '1';
Data['linuxlogindomain'].asString := '';
Data['tlsexplicit_port'].asString := '';
Data['monitorchange'].asString := '';
Data['inerror'].asString := '1';
Data['sensorid'].asString := '6160';
Data['ipversion'].asString := '0';
Data['tlsexplicit_smtp'].asString := '';
Data['host'].asString := '10.88.15.5';
Data['exeparamslist'].asString := '';
Data['usewindowsauthentication'].asString := '1';
Data['simulate'].asString := '0';
Data['tlsexplicit_ftp'].asString := '';
Data['timeout'].asString := '60';
Data['exeparams'].asString := '-f="PRTG-VeeamBRStats.ps1" -p="-BRHost SRVVEEAM"';
Data['momopersistent'].asString := '';
Data['tlsexplicit_pop3'].asString := '';

if i run the script manually, i have this output

<prtg>
<result>
  <channel>Successful-Backups</channel>
  <value>2</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failed-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>TotalBackupRead</channel>
  <value>1042</value>
  <unit>Custom</unit>
  <customUnit>GB</customUnit>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>TotalBackupTransfer</channel>
  <value>446</value>
  <unit>Custom</unit>
  <customUnit>GB</customUnit>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Successful-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failed-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Idle-BackupCopys</channel>
  <value>1</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Successful-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failed-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Successful-Endpoints</channel>
  <value>2</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-Endpoints</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-Endpoints</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-Endpoints</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>REPO - Default Backup Repository</channel>
  <value>13</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>REPO - Backup Repository NAS</channel>
  <value>54</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
</prtg>

where was the problem ?

Created on Jul 23, 2021 2:32:28 PM

Last change on Jul 23, 2021 3:11:55 PM by  Felix Wiesneth [Paessler Support]



Votes:

0

Hello,

Thank you for your message.

Regarding the issue you are facing, I invite you to make sure that the credentials defined in the device settings are correct, as well as check that the probe use them to execute the application PSx64.

I also invite you to check the output provided by the sensor in the file Result of Sensor 6160.txt and make sure that the device is reachable from the probe server on which the sensor is configured.

Regards.

Created on Jul 26, 2021 12:46:50 PM by  Florian Lesage [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.