vmarkusk / advanced-prtg-sensors Goto Github PK
View Code? Open in Web Editor NEWCollection of my Advanced PRTG Sensors
Home Page: https://mycloudrevolution.com/
License: Apache License 2.0
Collection of my Advanced PRTG Sensors
Home Page: https://mycloudrevolution.com/
License: Apache License 2.0
Sensor failing. Issue is that the sensor output is incomplete when run with PSx64.exe.
Running Psx64 with the powershell script returns only almost the end of the output:
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f="
PRTG-VeeamBRStats.ps1"
0:\VeeamBackup</channel>
<value>86</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - VMware VM Backup Repository</channel>
<value>64</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
</prtg>
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>
whereas running the script without PSx64.exe, the script returns everything in the output.
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-Vee
amBRStats.ps1
<prtg>
<result>
<channel>Successful-Backups</channel>
<value>1</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>47</value>
<unit>Custom</unit>
<customUnit>GB</customUnit>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>TotalBackupTransfer</channel>
<value>17</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>0</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 - Endpoint Backup Repository</channel>
<value>64</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - Laufwerk D:\VeeamBackup</channel>
<value>86</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - VMware VM Backup Repository</channel>
<value>64</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
</prtg>
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>
I believe the issue might be because of "Laufwerk D:" in the channel name.
The Connection works and the PowerShell get an XML answer, but prtg says it's not in the right form. Do you need an output with the -debug Parameter?
PRTG Network Monitor: 19.4.53.1912 x64
Sensor-Konfig:
Programm/Skript: PSx64.exe
Programm/Skript: -f="PRTG-VeeamBRStats.ps1"
Detailed Error:
answer not well-formed: "( Successful-Backups 15 1 1 Warning-Backups 0 1 1 0 1 Failes-Backups 0 1 1 0 1 Failed-Backups 0 1 1 0 1 Running-Backups 0 1 1 TotalBackupRead 1138 Custom GB 1 1 TotalBackupTransfer 416 Custom GB 1 1 Successful-BackupCopys 0 1 1 Warning-BackupCopys 0 1 1 0 1 Failes-BackupCopys 0 1 1 0 1 Failed-BackupCopys 0 1 1 0 1 Running-BackupCopys 1 1 1 Idle-BackupCopys 0 1 1 Successful-Replications 0 1 1 Warning-Replications 0 1 1 0 1 Failes-Replications 0 1 1 0 1 Failed-Replications 0 1 1 0 1 Running-Replications 0 1 1 Successful-Endpoints 0 1 1 Warning-Endpoints 0 1 1 0 1 Failes-Endpoints 0 1 1 0 1 Running-Endpoints 0 1 1 REPO - Default Backup Repository 33 Percent 1 1 20 10 1 REPO - StoreOnce_SG_CIFS 33 Percent 1 1 20 10 1 REPO - VeeamConfigBackup 22 Percent 1 1 20 10 1 )" (Code: PE132)
When cloud repository is added to VBR Console but not connected(see image), the powershell script shows an exception, just before PRTG output.
Doesn't affect prtg output directly, but i assume this should be an error in PRTG.
Ausnahme beim Aufrufen von "SyncSpaceInfoToDb" mit 2 Argument(en): "Failed to establish connect to the service provider"
In C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats2.ps1:78 Zeichen:6
+ [Veeam.Backup.Core.CBackupRepositoryEx]::SyncSpaceInfoToDb($r, $true)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : Exception
Hello, iam stuck in the connection. Changed localhost to our server:
param( [Parameter(Position=0, Mandatory=$false)] [string] $BRHost = "BKUP01",
With PSx64.exe i get the wanted XML output. But the Sensor Logs comes up with:
Failed to connect to Veeam BR Host
even when it is hardcoded in the powershell script. So i checked the user, its running with a credential which is approved to connect. Means i logged in on the same remote host the PRTG probe is installed and run the script with PSx64 which gives me the XML output.
Error Output:
`C:\Program Files (x86)\PRTG Network Monitor\custom
sensors\EXEXML\VeeamBRStats.ps1 : Failed to connect to Veeam BR Host
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorExcep
tion
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
n,VeeamBRStats.ps1
`
OS: WS 2016
PSx64: 18.1.1.6
0:
Name Value
PSVersion 5.1.14393.3053
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.3053
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1`
Also i tried with Parameters in PRTG as:
-f="FileName.ps1 -p="BKUP01"
and -f="FileName.ps1" -p="-BRHost BKUP01"
Any ideas here?
Originally posted by @eulisan in #42 (comment)
Test and add Tape Jobs to Report / Sensor.
Get-vPCRepoInfo : Exception calling "SyncSpaceInfoToDb" with "2" argument(s): "Object reference not set to an instance
of an object."
At C:\Users\Administrator\Desktop\PRTG-VeeamBRStats.ps1:508 char:27
+ $RepoReport = $repoList | Get-vPCRepoInfo | Select-Object @{Name="R ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-vPCRepoInfo
But XML and DEBUG Output is fine.
Hi. I am having an issue where when I run the script using PSx64.exe I receive the following:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PSx64.exe -f="PRTG-VeeamBRStats.ps1" -p="-BRHost bneveeam01"
0: PowerShell environment initialization failed
Running the script manually in an x64 PowerShell window results in the correct output being displayed.
Can anyone suggest what I am doing wrong?
The xml is malformed when a colon is in the repo name.
with Get-VBRBackupRepository on a Cloud Repository the Sizes return with -1 so it Calculates to 100% Free Space
After Upgrading from Veeam BR 9.3a to 9.4.
The sensor shows the following error:
XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
Since connection problems occur quite often, more debug would be helpful.
Hi,
I used to run the Veeam Server (Server 2012 R2) in same Domain as the PRTG Probe (Server 2019) and in that setup everything was working fine.
For some reasons I switched the Veeam Server out of the Domain into the Workgroup.
Thats where the problems started. Now I always get the error PE095 (Access denied) in PRTG.
When I run the Script in the Powershell of the PRTG server (as the same local user that is provided in PRTG and on the Veeam Server) it is running successfully with the right results.
I'm also able to connect via the Veeam Backup & Replication 10 console to my non domain server (using the same credentials provided in PRTG).
Also other PRTG Sensors on that server are running fine.
I changed the $BRHost Value in the script to the Netbios name of the Veeam Server. But seems like this is making no difference.
Thanks for your support :)
Really hate to seem like I have no clue. But I am new to PRTG and to creating sensors and the such. We use Veeam V10 for our backups and it is pretty critical that we are able to monitor it. I love what this offers, but I cannot find any solid instructions on how to actually set everything up properly. I am on the latest version of PRTG as well.
I have added the PS Script into the EXEXML folder and created the sensor, but then it asks for the parameters and I'm not sure what should be there, I did figure out setting up a Mutex name, but the rest of it has me lost. PSx64 is in the folder as well and if I test the script from my Core server I get an error
The term 'Disconnect-VBRServer' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
+ CategoryInfo : ObjectNotFound: (Disconnect-VBRServer:String) [PRTG-VeeamBRStats.ps1], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,PRTG-VeeamBRStats.ps1
I guess I just have no idea how to set this all up. Is there a step by step out there somewhere? I tried but could not find it.
Thanks!
Hi,
i have a probe end a br vm on 2 differente vms with two different username password and hostname.
May someone help me to get PRTG Sensor working in a configuration like this?
If I run this command on the probe:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-VeeamBRStats.ps1 192.168.1.121
i have this result:
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1 : Failed to connect to Veeam
BR Host '192.168.1.121' with user 'Administrator'
At line:1 char:1
+ .\PRTG-VeeamBRStats.ps1 192.168.1.121
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.ps1
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1 : at <ScriptBlock>, C:\Program
Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1: line 203
at <ScriptBlock>, <No file>: line 1
At line:1 char:1
+ .\PRTG-VeeamBRStats.ps1 192.168.1.121
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.ps1
<prtg>
<error>1</error>
<text>Failed to connect to Veeam BR Host '192.168.1.121' with user 'Administrator'</text>
Thanks
Hey there,
I'd love to see a way to monitor the endpoint backup jobs running over the B&R Server.
I'll be glad to provide testing for functionality as required.
Thanks in Advance!
Hello Markus,
the script working very good until the previously version, after upgrade to the last one build 10.0.1.4854 I get this error:
XML: Structural error in xml file, 3 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
I use the script with PS64, these are the PRTG parameters: .\PSx64.exe -f="PRTG-VeeamBRStats.ps1" -p="veeamhostname"
Thank you for this great script!
Hello,
to me it seems like the powershell script is not picking up my parameters.
This is how i set it up in PRTG. Is it the correct way to give PSx64.exe the parameters?
-f="PRTG-VeeamBRStats.ps1" -p="-repoCritical 80 -repoWarn 70 -reportmode "Weekly"
As soon as i put in the -p= part, i get this error:
XML: Structural error in xml file, 1 open items. -- JSON: Das zurückgelieferte JSON entspricht nicht der erwarteten Struktur (Invalid JSON.). (Code: PE231)
I also ran the script on the probe manually.
This is the output when running the ps1 script in powershell. I have X'ed the private parts.:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML.\PRTG-Vee
amBRStats.ps1
Starting to Process Connection to backup01 ...
Connecting BRHost...
<prtg>
<result>
<channel>Successful-Backups</channel>
<value>0</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>1</value>
<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>0</value>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>Successful-Replications</channel>
<value>7</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>1</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>1</value>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>TotalBackupRead</channel>
<value>109</value>
<unit>Custom</unit>
<customUnit>GB</customUnit>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>TotalBackupTransfer</channel>
<value>34</value>
<unit>Custom</unit>
<customUnit>GB</customUnit>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>REPO - Cloud repository XXX 01</channel>
<value>100</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - Default Backup Repository</channel>
<value>50</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - QNAP Veeam Backup</channel>
<value>11</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
</prtg>
This is what i get when i try to run the script using PSx64.exe:
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f="
PRTG-VeeamBRStats.ps1"
0:Starting to Process Connection to backup01 ...
Connecting BRHost...
<prtg>
<result>
<channel>Successful-Backups</channel>
<value>0</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>1</value>
<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>0</value>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>Successful-Replications</channel>
<value>7</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>1</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>1</value>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>TotalBackupRead</channel>
<value>109</value>
<unit>Custom</unit>
<customUnit>GB</customUnit>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>TotalBackupTransfer</channel>
<value>34</value>
<unit>Custom</unit>
<customUnit>GB</customUnit>
<showChart>1</showChart>
<showTable>1</showTable>
</result>
<result>
<channel>REPO - Cloud repository XXX 01</channel>
<value>100</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - Default Backup Repository</channel>
<value>50</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
<result>
<channel>REPO - QNAP Veeam Backup</channel>
<value>11</value>
<unit>Percent</unit>
<showChart>1</showChart>
<showTable>1</showTable>
<LimitMinWarning>20</LimitMinWarning>
<LimitMinError>10</LimitMinError>
<LimitMode>1</LimitMode>
</result>
</prtg>
I'll be glad to provide further logs as required.
Hello Markus,
this is the first time I tried to implement your script and I spend several hours without success. Maybe you have some suggestions for me?
Probe:
Windows Server 2019 Ver. 1809 - PS Version 5.1 Build 17763 Rev. 1007
Veeam BR Console 10.0.1.4854
Veeam Server:
Windows Server 2016 Ver. 1607 - PS Version 5.1 Build 14393 Rev. 3866
Veeam BR Console 10.0.1.4854
I also tried to start the script with .\PSx64.exe -f="PRTG-VeeamBRStats.ps1" -p="veeamserver" and it is working fine.
But when i try to implement the script in PRTG i receive the error:
XML: Structural error in xml file, 3 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
I saw the other closed issues with the same problem as mine, and I tried the suggestions, but it doesn´t work for me. Now I do not have another idea to solve the issue.
Thanks for your help. Kind regards, Andreas
Agent jobs are not recognized.
As already reported on Markus' homepage.
"Get-VBREPJob" gives no result.
Answer from Markus:
Ich werde mir das mal näher anschauen und bescheid geben.
Hello,
Some jobs are sometimes in status failed, but after a Veeam retry the job is successful. However the script still detects an error and increments the Failes-Backups channel which reports an error on the sensor on PRTG.
How to detect that a job is successful after a retry ?
Thank in advance
Regards,
Hi,
I got a few Veeam sensors working fine with v9.5. After v10 upgrade I received the following error :
When I'm running the Script directly in Powershell, it seems to block on the following elements :
I tried on different clients and always the same issue after v10 upgrade.
I'm using the lastest script available on Github.
Create a function to create XML Output for PRTG.
Hello,
Is there a way to add in your script the names of the jobs as well as the virtual machines which are in the job that one test?
In kb veeam website, I found this :
<MaxDurationBackupJobName>Backup_2014-10-18T044119</MaxDurationBackupJobName>
<MaxDurationReplicaJobName>Fileserver02 Replication</MaxDurationReplicaJobName>
It's a good idea ?
Have a good day
Test and add a modification for Remote execution
Hi,
Your script doesn't work on my PRTG (Windows Server 2016) linked with my Veeam Backup & Replication 9.5.
Veeam port : 9392 (Port used by the Veeam Backup & Replication console to connect to the backup server).
If i put 9392 port, my script given nothing.
But if i put your port i get some error.
Any idea ?
Best regards,
PS : Script name : https://gist.github.com/mycloudrevolution/713b2e4aa767257f84cc#file-prtg-veeam-sessionstats-ps1
catch{
Write-Host "<prtg>"
Write-Host " <error>1</error>"
Write-Host " <text>An Error accured"
Write-Host "</prtg>"
}
Hi,
I'm having an issue with the utilization of the script.
When I run the script on the probe itself, the script return me something like that:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PSx64.exe -f="PRTG-VeeamBRStats.ps1"
0:<prtg> <result> <channel>Successful-Backups</channel> <value>5</value> <showChart>1</showChart> <showTable>1</showTable> </result> .....
I don't pass any parameters because I modified the BRHost variable into my script.
But when I setup PRTG to run the script, this is what it gives me :
This is what is setup into PRTG :
Thanks for your help and Happy new year !
This script is great and has worked for many sites so far. However one site i am having an issue and wonder if anyone can help.
I have to run the script using the PS64.exe app so it can run in 64 bit for PRTG to work but when i do i get a strange output not the normal values.
Running the script locally in power shell works as expected.
Please see the cmdlet below , please can someone give me some advice.
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f=P RTG-VeeamBRStats.ps1 0:)</channel> <value>71</value> <unit>Percent</unit> <showChart>1</showChart> <showTable>1</showTable> <LimitMinWarning>20</LimitMinWarning> <LimitMinError>10</LimitMinError> <LimitMode>1</LimitMode> </result> </prtg>
When trying to use this for PRTG reporting i get the following issue? could you help me please:
XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
We have 4 Backup spaces in the cloud within two seperate cloud vendors.
The PRTG-VeeamBRStats sensor is calculating 100% free space.
That is not correct.
If you do a development from the sensor, we can test for you.
Thanks
Wir haben 4 Cloud Backups von unterschiedlichen Kunden mit 2 Unterschiedlichen Cloudprovidern.
Jedes Mal ist der Veeam-Sensor im Einsatz und er zeigt immer 100% freier Platz an
Add-Member : Es kann kein Element mit dem Namen "Successful Backups"
hinzugefügt werden, da bereits ein Element mit diesem Namen vorhanden ist.
Wenn Sie das Element trotzdem überschreiben möchten, verwenden Sie dafür den
Force-Parameter.
In C:\Program Files (x86)\PRTG Network Monitor\Custom
Sensors\EXEXML\PRTG-VeeamBRStats.ps1:248 Zeichen:22
+ $SessionObject | Add-Member -MemberType NoteProperty -Name "Successful
Backu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidOperation: (@{Successful Backups=1}:PSObj
ect) [Add-Member], InvalidOperationException
+ FullyQualifiedErrorId : MemberAlreadyExists,Microsoft.PowerShell.Command
s.AddMemberCommand
[Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepos.Id.Guid)
--> But this will break older versions (version check?)
I want to run the script from the PRTG Probe with -psremote so that I no longer have to install / update the Veeam console on the PRTG Probe.
This error occurs on the PRTG Probe (, of course, without the Veeam console installed):
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ._PRTG-VeeamBRStats_2020_04.ps1 -brhost veeam.xyz.de -psremote
Successful-Backups
1
1
1
Warning-Backups
0
.
.
.
1
Running-Endpoints
0
1
1
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML_PRTG-VeeamBRStats_2020_04.ps1 : Die Benennung
"Disconnect-VBRServer" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren
Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und
wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ CategoryInfo : ObjectNotFound: (Disconnect-VBRServer:String) [_PRTG-VeeamBRStats_2020_04.ps1], CommandN
otFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,_PRTG-VeeamBRStats_2020_04.ps1
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>
If the script is executed directly on the Veeam server, it works.
It looks like the script can't handle one or more REPO/s.
.
.
.
1
Running-Endpoints
0
1
1
REPO - xyz-NAS-01
28
Percent
1
1
20
10
1
REPO - cloud1
.
.
.
Here, as requested on Markus' Homepage, with "-debug".
From the Probe (with -psremote):
.
.
.
Running-Endpoints
0
1
1
DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo
Bestätigung
Vorgang fortsetzen?
[J] Ja [A] Ja, alle [B] Befehl anhalten [H] Anhalten [?] Hilfe (Standard ist "J"): j
DEBUG: Cloud Repo Section Entered...
Bestätigung
Vorgang fortsetzen?
[J] Ja [A] Ja, alle [B] Befehl anhalten [H] Anhalten [?] Hilfe (Standard ist "J"): j
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML_PRTG-VeeamBRStats_2020_04.ps1 : Die Benennung
"Disconnect-VBRServer" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren
Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und
wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ CategoryInfo : ObjectNotFound: (Disconnect-VBRServer:String) [_PRTG-VeeamBRStats_2020_04.ps1], CommandN
otFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,_PRTG-VeeamBRStats_2020_04.ps1
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>
And from the Veeam server:
Running-Endpoints 0 1 1 DEBUG: Veeam.Backup.Model.CBackupRepositoryInfoBestätigung
Vorgang fortsetzen?
[J] Ja [A] Ja, alle [B] Befehl anhalten [H] Anhalten [?] Hilfe (Standard ist "J"): j
DEBUG: Cloud Repo Section Entered...
Bestätigung
Vorgang fortsetzen?
[J] Ja [A] Ja, alle [B] Befehl anhalten [H] Anhalten [?] Hilfe (Standard ist "J"): j
REPO - xyz-NAS-01
28
Percent
1
1
20
10
1
REPO - cloud1
52
Percent
1
1
20
10
1
REPO - cloud2
13
Percent
1
1
20
10
1
REPO - cloud3
19
Percent
1
1
20
10
1
REPO - cloud4
48
Percent
1
1
20
10
1
REPO - cloud5
55
Percent
1
1
20
10
1
REPO - cloud6
59
Percent
1
1
20
10
1
REPO - cloud7
39
Percent
1
1
20
10
1
Repository Name Free (GB) Total (GB) Free (%) Status
xyz-NAS-01 3133,70 11076,09 28 OK
cloud1 534,94 1024 52 OK
cloud2 130,09 1024 13 Warning
cloud3 194,25 1024 19 Warning
cloud4 489,31 1024 48 OK
cloud5 568,04 1024 55 OK
cloud6 602,48 1024 59 OK
cloud7 400,12 1024 39 OK
Successful Backups : 1
Warning Backups : 0
Failes Backups : 0
Failed Backups : 0
Running Backups : 0
Total Backup Transfer : 13
Total Backup Read : 26
Warning BackupCopys : 0
Failes BackupCopys : 0
Failed BackupCopys : 0
Running BackupCopys : 0
Idle BackupCopys : 0
Successful Replications : 0
Warning Replications : 0
Failes Replications : 0
Failed Replications : 0
Running Replications : 0
Seccessful Endpoints : 0
Warning Endpoints : 0
Failes Endpoints : 0
Running Endpoints : 0
PS C:_xyz>
It seems like the VeeamPSSnapIn is not loaded and therefore the script doesn't execute.
What is the #Require part exactly for, if the SnapIn gets loaded afterwards anyway?
& : Das Skript "PRTG-VeeamBRStats.ps1" kann nicht ausgef�hrt werden, da die folgenden in den #requires-Anweisungen des
Skripts angegebenen Snap-Ins fehlen: VeeamPSSnapIn.
In Zeile:1 Zeichen:2
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBR ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (PRTG-VeeamBRStats.ps1:String) [], ScriptRequiresException
+ FullyQualifiedErrorId : ScriptRequiresMissingPSSnapIns
Veeam Version 10.0.1.4854
Get-vPCRepoInfo : Exception calling "SyncSpaceInfoToDb" with "2" argument(s): "[IP address] Failed to connect to
Installer service."
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1:516 char:35
~~~~~~~~~~~~~~~
Get-vPCRepoInfo : at Get-vPCRepoInfo, C:\Program Files (x86)\PRTG Network Monitor\Custom
Sensors\EXEXML\PRTG-VeeamBRStats.ps1: line 156
at , C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1: line 516
at , : line 1
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1:516 char:35
~~~~~~~~~~~~~~~
This broke my PRTG Sensor with
XML: Structural error in xml file, 4 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
Hi Markus,
First of all, thank you for making that script :-) I really look forward to be using it for my PRTG Monitor !
I followed all the procedure here : https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/ but I keep having an issue I can't seem to solve :S
On PRTG Program, I keep having that message :
XML: The returned XML does not match the expected schema. (code: PE233) — JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
I made some research and I tested the Power Shell Script (v1.8) directly on my PRTG Server and the PowerShell Script Fail saying :
The term ‘Disconnect-VBRServer’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I am running Veeam Backup & Replication Version 10.0.0.4461 and I am running PowerShell v5.1 both on my Veeam Server and PRTG Server and I am executing it from PSx64 just as said in the documentation you provided
OS Version for PRTG Server is : Windows Server 2019 1809 (Build 17763.379)
OS Version for Veeam Server is : Windows Server 2012 R2 6.3 (Build 9600)
I don’t really know where the problem can come from because it seems I can run Veeam PS Snapin without any problem on my Veeam Server (maybe because of the new snapin of the version 10?)
Thank you for your help !
Hi,
After implementing a powershell script with some parameters we get error:
Accès refusé. Veuillez vérifier vos données d'accès Windows. (code : PE095)
Script: PRTG-ScheduledTask.ps1
Parameters: -ComputerName XX.XX.XX.XX -TaskName Import_AD_test -Debug -Verbose
Running the script manually on server XX.XX.XX.XX we have to run it as administrator.
Should we add a code in the parameter to grant access?
Thx
Seb
Ich habe den Namen eines Repositorys geändert. Danach gibt es 2 Einträge. Das neue Name und der alte mit einem Fehler.
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\Veeam.ps1 :
Cannot convert the "System.Object[]" value of type "System.Object[]" to type
"System.Guid".
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorExcep
tion
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
n,Veeam.ps1
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\Veeam.ps1 :
at <ScriptBlock>, C:\Program Files (x86)\PRTG Network Monitor\custom
sensors\EXEXML\Veeam.ps1: line 532
at <ScriptBlock>, <No file>: line 1
At line:1 char:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom
sensors\EXEXML\Veeam.ps1' ' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorExcep
tion
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
n,Veeam.ps1
That happens in PRTG and if i run the script manually
Hello,
we would like to use PRTG to monitor Veeam B&R Enterprise Version 9.5 Up3 (PRTG is installed on Windows 2012 R2 Server).
We found some Powershell scripts to realize this issue:
Example:
https://kb.paessler.com/en/topic/72030-monitoring-veeam-backup-replication-without-veeam-enterprise-manager
https://mycloudrevolution.com/2016/03/21/veeam-prtg-sensor-reloaded/
We install the Veeam Powershell Extension on PRTG Server. Listing Veeam Command Applets modules in Powershell was successfull. Modules load automatically after example: rebooting the server.
Installation Process:
Set-Alias installutil $env:windir\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
installutil "C:\Program Files\Veeam\Backup and Replication\Backup\Veeam.Backup.PowerShell.dll"
add-pssnapin VeeamPSSnapIn
Get-Command -Module VeeamPSSnapIn
The plugins get automatically reloaded after rebooting the server.
We Download the Tool PSx64.exe http://prtgtoolsfamily.com/downloads/sensors
and copy the file to:
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
We download the PRTG-VeeamBRStats.ps1 and store it on same directory
We create a sensor as described (see documentatation) and get the following error message, located in PRTG Log File
Connect-VBRServer : Veeam PowerShell snap-in was loaded from an incorrect location.
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1:
Connect-VBRServer -Server $BRHost
CategoryInfo : InvalidOperation: (:) [Connect-VBRServer], Exception
FullyQualifiedErrorId : InstallationCheckerErrorId,Veeam.Backup.PowerShell.
Cmdlets.ConnectVBRServer
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1
Error: BRHost Connection Failed At line:1 char:1 &'C:\Program Files (x86)\PRTG Network Monitor\custom
sensors\EXEXML\PRTG-VeeamBR ...
CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,
PRTG-VeeamBRStats.ps1
Starting to Process Connection to -BRHOST vde.dasi03.local.vde.com ... Connecting BRHost...
I am testing the script on a simple command prompt:
PSx64.exe -f="PRTG-VeeamBRStats.ps1" -p="-BRHOST=VDE-DASI03.local.vde.com"
Error still the same:
Veeam PowerShell snap-in was loaded from an incorrect location.
I think there is something wrong with PSx64.exe.
Did someone have a good idea to fix the problem
Thanks and best regards
Jürgen
Hi, PRTG keeps showing down for the sensor because the failed backup is at 1
So Simulation
Backup #1 : OK PRTG will show ok
Backup #2 : Failure PRTG will show down because the failure is at 1
Backup #3 : OK PRTG will show down because the failure is at 0
How can i tell PRTG to update the status based on the last report?
Thanks
Good morning, sir,
I tried to set up your sensor.
However, I end up with a PE132 error telling me that the response format is incorrect.
Do you have a lead?
I'm using PSx64.exe to run the script, I did accept unsigned scripts on PowerShell, and the Veeam console is on the server and working properly.
PRTG is installed on a dedicated virtual machine and the Veeam database is on a server on the local network.
I have the impression that PRTG does not understand the output of the program and cannot create the sensors in competence.
Thank you in advance for your help!
Hi Markus,
i am trying to implement the sensor you describe.
I have a VBR 9.5 and a PRTG 20.3.61.1649, but I get the following error:
XML: Structural error in xml file, 3 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
I installed the VBR console on the probe and placed the script in ps copied from the project.
Can you give me some suggestions?
Thanks.
Best regards.
Daniele.
Have a problem with the script.
Failed to connect to Veeam BR Host 'backup01.lan.local' with user 'Username'
P.S. Username - is a domain user but the script doesn't use domain like Domain_name\Usre_name
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.