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 using 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 and the Veeam Enterprise Manager.

His article is available here: http://mycloudrevolution.com/2016/02/29/prtg-veeam-br-monitoring/

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 need to monitor Veeam, but you don't have Veeam Enterprise Manager, please see this article instead, which covers how to monitor Veeam without using Enterprise Manager.

custom-script-exe custom-sensor exexml powershell prtg veeam

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

Last change on Jan 10, 2017 10:21:34 AM by  Martina Wittmann [Paessler Support]



33 Replies

Votes:

0


Note: As of PRTG 20.4.64, PRTG comes with a native Veeam Backup Job Status Sensor out of the box.


PRTG – Veeam B & R Monitoring

Although Veeam Backup & Replication includes extensive email reporting, I’d like to take it a step further, to include:

  • Multiple Veeam Backup & Replication servers
  • Detailed statistics
  • Detailed alerting

And that’s where the Veeam Backup Enterprise Manager comes into play. With this additional component you can get central reporting on multiple Veeam Backup & Replication servers.

http://mycloudrevolution.com/wp-content/uploads/2016/02/veeam-bem.png

And if you add the Veeam Enterprise Plus Edition, you get a powerful RESTful API for the Backup Enterprise Manager.

Using Powershell scripts and the Veeam API you can build comprehensive PRTG sensors, including real-time alerting and reporting on historical data (e.g. for license reports).

http://mycloudrevolution.com/wp-content/uploads/2016/02/veeam-prtgv2.png

http://mycloudrevolution.com/wp-content/uploads/2016/02/veeam-prtg_livedata.png

Veeam B & R Monitoring with PRTG – How it Works

To create a custom script sensor in PRTG you need to save a script (preferably Powershell) in the following directory on the machine where the script will run (on the core server or on the remote probe):

%programfiles(x86)%\PRTG Network Monitor\Custom Sensors\EXEXML or %programfiles%\PRTG Network Monitor\Custom Sensors\EXEXML

Preparation:

  1. Give the script user rights in Backup Enterprise Manager
  2. Disable IE First-Run (because of “Invoke-WebReques” and “Invoke-RestMethod”)

[HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftInternet ExplorerMain] „DisableFirstRunCustomize“=dword:00000001

The Script:

The latest version of the script can be downloaded from the Github Gist link below:

You can also run the script manually to test it:

http://mycloudrevolution.com/wp-content/uploads/2016/02/veeam-prtg_test.png

Creating the Sensor:

Add an “EXE/Script Advanced” sensor to a device

http://mycloudrevolution.com/wp-content/uploads/2016/02/veeam-prtg_addsensor_1.png

Settings for the EXE/Script Advanced Sensor

http://mycloudrevolution.com/wp-content/uploads/2016/02/veeam-prtg_addsensor_2.png

Note!! Using the option “Write EXE result to disk” can be very helpful for debugging. The logs will be saved here: %programdata%\Paessler\PRTG Network Monitor\\Logs\sensors

Special Thanks:

This article was inspired by Mike Roberts’ (@gngrninja) article Powershell: NetApp LUN monitoring with a PRTG custom sensor. Thanks, Mike!

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

Last change on Jun 2, 2022 12:31:45 PM by  Brandy Greger [Paessler Support]



Votes:

0

Hello,

I am having troubles with this Sensor. The core server is running on Windows 2012 R2, so the steps of the section "Preparation:" differ a bit (there is no Policies path...).

So instead this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main]
"DisableFirstRunCustomize"=dword:00000001

I have done this:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main]
"DisableFirstRunCustomize"=dword:00000001

Since it is not working, I enabled the option "Write EXE result to disk" and I get this:

Invoke-WebRequest : The response content cannot be parsed because the Internet 
Explorer engine is not available, or Internet Explorer's first-launch configura
tion is not complete. Specify the UseBasicParsing parameter and try again. 
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-Veeam
-SessionStats.ps1:11 char:12
+ $AuthXML = Invoke-WebRequest @Auth
+            ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Invoke-WebRequest], NotSupp 
   ortedException
    + FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.Po 
   werShell.Commands.InvokeWebRequestCommand
 
Cannot index into a null array.
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-Veeam
-SessionStats.ps1:14 char:1

Any ideas?

Thank you,

Eneko

Created on Feb 9, 2017 12:55:21 PM

Last change on Feb 10, 2017 11:33:54 AM by  Stephan Linke [Paessler Support]



Votes:

0

Yep, you need to start IE on the PRTG server at least once in order to make the sensor work :)

Created on Feb 10, 2017 11:37:54 AM by  Stephan Linke [Paessler Support]



Votes:

0

Yes, now it is working. I had to login first with the user that is configured in the Powershell script to access to Veeam Enterprise Manager and start IE once to accept the First run prompt.

So thank you and regards,

Eneko

Created on Feb 10, 2017 12:08:37 PM



Votes:

0

Hi,

after re-enabling the sensor I get a bit weird dashboards, showing messages like:

"38,4487 % (Demo Disk Free) is above the warning limit of 37 % in Demo Disk Free. My custom note for warnings (Demo values. OS: Windows_NT)"

and in the logs I see this:

<?xml version="1.0" encoding="Windows-1252" ?>
<prtg>
   <result>
       <channel>Demo Minimum Example</channel>
       <value>3</value>
   </result>
   <result>
       <channel>Demo Disk Free</channel>
       <unit>Percent</unit>
       <mode>Absolute</mode>
       <showChart>1</showChart>
       <showTable>1</showTable>
       <warning>0</warning>
       <float>1</float>
       <value>38.4487</value>
       <LimitMaxError>80</LimitMaxError>
       <LimitMaxWarning>37</LimitMaxWarning>
       <LimitWarningMsg>My custom note for warnings</LimitWarningMsg>
       <LimitErrorMsg>My custom note for errors</LimitErrorMsg>
       <LimitMode>1</LimitMode>
   </result>
   <result>
       <channel>Demo Network Speed</channel>
       <unit>SpeedNet</unit>
       <volumeSize>MegaBit</volumeSize>
       <mode>Absolute</mode>
       <showChart>1</showChart>
       <showTable>1</showTable>
       <warning>0</warning>
       <float>0</float>
       <value>124487000</value>
   </result>
   <result>
       <channel>Demo Custom</channel>
       <unit>Custom</unit>
       <customUnit>Pieces</customUnit>
       <mode>Absolute</mode>
       <showChart>1</showChart>
       <showTable>1</showTable>
       <warning>0</warning>
       <float>0</float>
       <value>855</value>
   </result>
   <text>Demo values. OS: Windows_NT</text>
</prtg>

Any ideas?

Thank you,

Eneko

Created on Feb 10, 2017 12:26:44 PM

Last change on Feb 10, 2017 12:35:08 PM by  Stephan Linke [Paessler Support]



Votes:

0

What about it, it's the limit on the channel causing the actual error :) Once you remove it (or modify it according to your needs), it will be green again.

Created on Feb 10, 2017 12:37:24 PM by  Stephan Linke [Paessler Support]



Votes:

0

Sorry my bad, when recreating the sensor I choose the wrong "EXE/Script"...

No, it is not working.

I have logged in to the PRTG Core Server as the user which is configured to access to Veeam Enterprise Manager, I have fired up IE and access the website after accepting the First Run prompt.

Then I have recreated the sensor choosing this time the right "EXE/Script": PRTG-Veeam-SessionStats.ps1

But when the logs are written to the system I still get:

Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configura tion is not complete. Specify the UseBasicParsing parameter and try again.

Am I missing something?

Thank you,

Eneko

Created on Feb 10, 2017 12:52:51 PM

Last change on Feb 10, 2017 12:55:37 PM by  Stephan Linke [Paessler Support]



Votes:

0

Are you using a specific user for that? You might want login with that account and start IE again.

Not sure if the following would do the trick as well:

$AuthXML = Invoke-WebRequest @Auth -UseBasicParsing

Worth a shot though :)

Created on Feb 10, 2017 12:58:23 PM by  Stephan Linke [Paessler Support]



Votes:

0

Now yes, adding the UseBasicParsing parameter did the trick!!

Thank you very much.

Best regards,

Eneko

Created on Feb 10, 2017 1:09:28 PM



Votes:

0

My Veeam access uses HTTPS and testing the Veeam monitoring with powershell I get the error below. How can I use HTTPS with it.

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-Veeam-SessionStats.ps1
Invoke-WebRequest : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS
secure channel.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-Veeam-SessionStats.ps1:11 char:12
+ $AuthXML = Invoke-WebRequest @Auth
+            ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Cannot index into a null array.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-Veeam-SessionStats.ps1:14 char:1

Created on Feb 16, 2017 4:56:27 PM

Last change on Feb 17, 2017 7:44:51 AM by  Luciano Lingnau [Paessler]



Votes:

0

Please check out my post above and try it as well :)

Created on Feb 17, 2017 11:30:34 AM by  Stephan Linke [Paessler Support]

Last change on Feb 17, 2017 11:31:09 AM by  Stephan Linke [Paessler Support]



Votes:

0

Do you you mean adding "-UseBasicParsing" to line 11, if yes I attempted that as well before sending the update and had the same result. I do notice that on my Windows server 2012 R2 I do not see the "DisableFirstRunCustomize" in the specified folder below. Do I need to create it?

[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main]
"DisableFirstRunCustomize"=dword:00000001

Could it have anything to do with the SL/TLS error below ? I see github repo and PRTG script above uses HTTP and not HTTPS

"Invoke-WebRequest : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."

Created on Feb 17, 2017 6:51:10 PM

Last change on Feb 20, 2017 6:12:55 AM by  Stephan Linke [Paessler Support]



Votes:

0

Okay then. Could you add the following above the invoke-webrequest line:

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

This should cause PowerShell to ignore the invalid ssl certificate...

Created on Feb 20, 2017 6:26:37 AM by  Stephan Linke [Paessler Support]



Votes:

0

Here is the new error I saw after placing thee new line above the invoke-webrequest line

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-Veeam-SessionStats.ps1
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-Veeam-SessionStats.ps1:12 char:12
+ $AuthXML = Invoke-WebRequest @Auth -UseBasicParsing
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Cannot index into a null array.

Created on Feb 21, 2017 3:22:15 PM

Last change on Feb 24, 2017 12:59:25 PM by  Luciano Lingnau [Paessler]



Votes:

0

Just out of curiosity, you're using a self signed certificate on your Veeam, correct?
Would it be possible to get a signed one onto it?

Created on Feb 22, 2017 7:41:25 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi,

I had the same problem. The invoke-webrequest - command is part of PowerShell 3. You hav to install Management Framework 3 then the script runs quite well.

KR

Created on Feb 24, 2017 7:43:42 AM



Votes:

0

Hi,

Your script doesn't work on my PRTG (Windows Server 2016 R2) 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 gett some error.

Any idea ?

Best regards,

Created on Jul 28, 2017 7:59:19 AM

Last change on Jul 28, 2017 7:59:19 AM



Votes:

0

Hi there,

There is no 2016 R2 (yet) - do you mean 2016? You might want to open up an Issue on the github repository for this :)


Kind regards,
Stephan Linke, Tech Support Team

Created on Jul 28, 2017 8:23:42 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi

I am getting this error:

Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\veeam.ps1:14 char:12
+ $AuthXML = Invoke-WebRequest @Auth  -UseBasicParsing
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
 
invoke-restmethod : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\veeam.ps1:23 char:21
+ [xml]$SessionsXML = invoke-restmethod @Sessions
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
 
invoke-restmethod : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\veeam.ps1:36 char:16
+ [xml]$VMsXML = invoke-restmethod @VMs
+                ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Any ideas?

Created on Sep 27, 2017 3:43:35 PM

Last change on Sep 27, 2017 6:25:44 PM by  Stephan Linke [Paessler Support]



Votes:

0

Hi,

Are you using an unsigned HTTPS certificate in your PRTG installation by any chance?


Kind regards,
Stephan Linke, Tech Support Team

Created on Sep 27, 2017 6:26:40 PM by  Stephan Linke [Paessler Support]



Votes:

0

For Veeam Enterprise Manager it was changed to a signed one in IIS. This was fine. I have noticed this isn't changed for the API but can't see where to change this. I have also added the unsigned certificate on the PRTG server and it can get to the api site without certificate errors.

Created on Sep 29, 2017 10:14:32 AM

Last change on Sep 29, 2017 10:14:32 AM



Votes:

0

Okay, please check if this makes a difference.


Kind regards,
Stephan Linke, Tech Support Team

Created on Sep 29, 2017 10:47:40 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi

This works very nicely, finally making it easy to monitor veeam backups.

A quick tip:

Veeam reports a backupjob as failed in FailedJobRuns even if the retry is successful, which can lead to false positives. I've added a sensor for "FailedVmLastestStates" which will report if backup of a single VM failed. You could also edit FailedJobRuns to only give warnings.

Add this to your script to get FailedVmLastestStates

# GET - Overview
$VMsOverview = @{uri = "http://veeam.lindbak.no:9399/api/reports/summary/overview";
                   Method = 'GET';
				   Headers = @{'X-RestSvcSessionId' = $AuthXML.Headers['X-RestSvcSessionId'];
           } #end headers hash table
	}

[xml]$VMsOverviewXML = invoke-restmethod @VMsOverview
$FailedVmLastestStates = $VMsOverviewXML.OverviewReportFrame.FailedVmLastestStates

Write-Host "<result>"
               "<channel>FailedVmLastestStates</channel>"
               "<value>$FailedVmLastestStates</value>"
               "<showChart>1</showChart>"
               "<showTable>1</showTable>"
               "<LimitMaxError>1</LimitMaxError>"
               "<LimitMode>1</LimitMode>"
               "</result>"

Created on Nov 13, 2017 11:16:17 AM

Last change on Nov 14, 2017 7:46:58 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Hi, Script is working fine in powershell but i get in PRTG :

Response not well-formed: "(<prtg> <result> <channel>SuccessfulJobRuns</channel> <value>4</value> <showChart>1</showChart> etc..

Any idea ?

Created on Mar 11, 2019 1:02:11 PM



Votes:

0

Are you using the Advanced variant of the sensor? That'll be required for XML based output.


PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Mar 12, 2019 9:15:56 AM by  Stephan Linke [Paessler Support]



Votes:

1

Thanks. Yes, was that.. New to PRTG , didnt know of the 2 separated EXE sensors XML or not..

Created on Mar 18, 2019 9:25:27 AM



Votes:

0

The GitHub Link

https://gist.github.com/mycloudrevolution/713b2e4aa767257f84cc#file-prtg-veeam-sessionstats-ps1

Is not working any longer , that can happen any time as the Content is probably frequently downloaded when linked by a major Company like PRTG ?

If you refer to "none" officiell PRTG GitHub Content please make it a little bit more clear , as it is a potential Thread !

  • gist.github.com* is probably not related to Paessler in any content ?

the Link is now broken , and current VEEAM Version is v11

If the Support validated the Script from gist, maybe they could fork it an Link it to there GitHub Profile ?

At Least on GitHub I couldnt find it :

https://github.com/PRTG

I would recommend a review of the Articel .

Created on Mar 28, 2022 12:12:30 PM



Votes:

0

Hi and thank you for the hint.
I reported this to the corresponding team and we will take a look at the link & article.

Created on Apr 1, 2022 5:57:07 AM by  Moritz Heller [Paessler Support]



Votes:

0

Hi since our Veeam Backup was removed from the AD domain for security reasons I cannot use the sensor anymore. I saved the local admin credentials in the device setting and credentials in the veeam section. The error is:

Failed to connect to Veeam BR Host '%veeam-server%' with user '%prtg-probe-hostname%$'

Can I save the veeam credentials with a Veeam read-only user directly in the PowerShell script?

Thanks

Created on May 9, 2022 2:15:47 PM



Votes:

0

Hi there,

Did you already tried to add the user credentials directly in the script?

Thank you!

Created on May 16, 2022 8:32:16 AM by  Moritz Heller [Paessler Support]



Votes:

0

Hi this was my question, where can I save it in the script? And is this only in clear-text possible? Thank you

Created on May 30, 2022 9:01:13 AM



Votes:

0

Did you already checked the article on which this post is based on: https://www.gngrninja.com/script-ninja/2016/2/24/powershell-netapp-lun-monitoring-into-prtg
In the script there, you can see how to import the password username without PRTG.

Created on Jun 1, 2022 7:42:30 AM by  Moritz Heller [Paessler Support]



Votes:

0

Hi Moritz,
I tried to store the credentials but since the Veeam Server is not the domain the authentication still fails. I've installed a remote probe on the veeam server where the sensor can now run with local system rights. This workaround solved the issue for me. Thanks

Created on Jun 3, 2022 7:54:13 AM

Last change on Jun 7, 2022 9:59:01 AM by  Moritz Heller [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.