vMarkusK / Advanced-PRTG-Sensors

Collection of my Advanced PRTG Sensors
https://mycloudrevolution.com/
Apache License 2.0
69 stars 29 forks source link

Access to the Veeam\backup path denied after v11 Veeam update #80

Closed JasperSnail closed 2 years ago

JasperSnail commented 3 years ago

Hi,

We upgraded to v11 recently and since then we've been getting the following log output for the sensor:

Disconnect-VBRServer : Access to the path 'Veeam\Backup' is denied.

I updated the script to the latest in the repo here but same issue.

vMarkusK commented 3 years ago

Hi, Another user (Till) reported this on my blog: https://mycloudrevolution.com/en/2020/01/27/prtg-veeam-sensor-retrospective/

I was need able to reproduce that and need a few more Details about your environment:

Best wishes Markus

JasperSnail commented 3 years ago

Hi Markus thanks for the reply,

vMarkusK commented 3 years ago

Hello,

I assume the issue #77 has the same root cause.

vMarkusK commented 3 years ago

What are the local permissions of the user the probe uses to call the script?

cipo80 commented 3 years ago

Hi guys, same problem here, I've read all #77 #78 and this. Below my setup:

have you installed the vbr console on the probe or are you using PS remote? | VBR Console is on the probe.
which OS are you using? | 2019 Datacenter
have you upgraded the console after vbr upgrade? | Yes both are on V11.0.0.837
have you tried to execute the script manually in the PowerShell? | Manually running the script shows no error.
vMarkusK commented 3 years ago

Duplicate of #77

vMarkusK commented 3 years ago

This is a really strange issue. I am not able to reproduce that.

@cipo80 which permisses has the user on the local system which the PRTG Probe uses to run the sensor?

carsten0407 commented 3 years ago

Hi All,

in my case the user has local administrative rights, and with the veeam console (installed on the probe server) I can login with my user an see the backups...

seems, that everything is OK. In the past sometimes I have to correct the permission in the regedit (HKLM\SOFTWARE\Veeam\Veeam Backup and Replication) But that is also fine in my environment

cipo80 commented 3 years ago

This is a really strange issue. I am not able to reproduce that.

@cipo80 which permisses has the user on the local system which the PRTG Probe uses to run the sensor?

Hi @vMarkusK , thank you for the reply,

the user has local administrative rights, like @carsten0407 I can correctly login by console installed on the probe server. I'm using the full path of the .dll and I've also try to remove/reinstall the console.

vMarkusK commented 3 years ago

I have already talked to prtgtools (vendor of PSx64) to make sure they do not use any special parameters - they do not.

Have you guys enabled UAC?

carsten0407 commented 3 years ago

Hi @cipo80https://github.com/cipo80

Are you sure?

If I run the scritp without PSx64.exe it seems to work, with PSx64.exe, at the beginning there is an “0” The community is not sure that this is the problem

Mit freundlichen Grüßen / best regards

i. A. Carsten Trautmann

Senior System Engineer IT-Service

cipo80 commented 3 years ago

I have already talked to prtgtools (vendor of PSx64) to make sure they do not use any special parameters - they do not.

Have you guys enabled UAC?

Just check, UAC is off

cipo80 commented 3 years ago

Hi @carsten0407 , in my case both working (psx64 and without it) by PS and both aren't working by PRTG. Without psx64 is it a XML Custom EXE/Script Sensor standard without parameter, right?

carsten0407 commented 3 years ago

Strange, in my case the script is working in my ISE, with PSx64 and CMD, I get the leading =”0” in PRTG also the XML-Error.

My Protocol in PRTG looks like @cipo80 yours?

Disconnect-VBRServer : Access to the path "Veeam\Backup" was denied. In C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStatsLocalBackupV2.0.ps1:66 Zeichen:5

@.***D71F20.9DA43D40]

Mit freundlichen Grüßen / best regards

i. A. Carsten Trautmann

Senior System Engineer IT-Service

carsten0407 commented 3 years ago

..thanx to everybody who works on it….

Mit freundlichen Grüßen / best regards

i. A. Carsten Trautmann

Senior System Engineer IT-Service

cipo80 commented 3 years ago

Carsten Trautmann

Same output by PRTG:

Disconnect-VBRServer : Access to the path 'Veeam\Backup' is denied. At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1:77 char:5

carsten0407 commented 3 years ago

Ups, I installed the sensor at a different customer (the old script with a veeam 9.5) And I see, that the leading “0” is also visible.. I threw that in the case, thought the leading “0” is responsible for the XML error. That doesn't seem to be the case

The script working perfect, also in PRTG

="srv.dom.local" 0: <-Not the Problem

Successful-Backups 1 1 1

Mit freundlichen Grüßen / best regards

i. A. Carsten Trautmann

Senior System Engineer IT-Service

efflicto commented 3 years ago

Hey,

I've got the same error after the update to v11:

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PSx64.exe -f="veeam_new.ps1" -p="server.local" -raw
0

XML: Das zurückgelieferte XML entspricht nicht dem erwarteten Schema. (Code: PE233) -- JSON: Das zurückgelieferte JSON entspricht nicht der erwarteten Struktur (Invalid JSON.). (Code: PE231)

I also tried the latest version 2.0.1 of the script and updated PRTG to the latest stable build.

vMarkusK commented 3 years ago

Might you please add a new Sensor to PRTG, similar to the Original one (enable log) but use this Diagnostic Script instead: https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/master/Veeam/PRTG-VeeamBRStats-Diag.ps1

Please share the Log (Default Path: C:\ProgramData\Paessler\PRTG Network Monitor\Logs\sensors) returned after the Sensor is executed. Example:

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.-Diag.ps1 : Execution environment 
cannot be initialized to Remote
At line:1 char:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.-Diag.ps1

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.-Diag.ps1 : at <ScriptBlock>, 
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.-Diag.ps1: line 48
at <ScriptBlock>, <No file>: line 1
At line:1 char:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.-Diag.ps1

Failed to Connect
<prtg>
 <error>1</error>
 <text>User 'WIN-RT26QHK0M11$' /  Error::  Execution environment cannot be initialized to Remote</text>
</prtg>
JasperSnail commented 3 years ago

Might you please add a new Sensor to PRTG, similar to the Original one (enable log) but use this Diagnostic Script instead: https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/master/Veeam/PRTG-VeeamBRStats-Diag.ps1

Please share the Log (Default Path: C:\ProgramData\Paessler\PRTG Network Monitor\Logs\sensors) returned after the Sensor is executed. Example:

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.-Diag.ps1 : Execution environment 
cannot be initialized to Remote
At line:1 char:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.-Diag.ps1

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.-Diag.ps1 : at <ScriptBlock>, 
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.-Diag.ps1: line 48
at <ScriptBlock>, <No file>: line 1
At line:1 char:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.-Diag.ps1

Failed to Connect
<prtg>
 <error>1</error>
 <text>User 'WIN-RT26QHK0M11$' /  Error::  Execution environment cannot be initialized to Remote</text>
</prtg>

Here is my log for it

> C:\Program Files (x86)\PRTG Network Monitor\custom 
> sensors\EXEXML\MIFSA-BKP.ps1 : Access to the path 'Veeam\Backup' is denied.
> At line:1 char:1
> + &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\M ...
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
>    tion
>     + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
>    n,MIFSA-BKP.ps1
>  
> C:\Program Files (x86)\PRTG Network Monitor\custom 
> sensors\EXEXML\MIFSA-BKP.ps1 : at <ScriptBlock>, C:\Program Files (x86)\PRTG 
> Network Monitor\custom sensors\EXEXML\MIFSA-BKP.ps1: line 48
> at <ScriptBlock>, <No file>: line 1
> At line:1 char:1
> + &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\M ...
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
>    tion
>     + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
>    n,MIFSA-BKP.ps1
>  
> Failed to Connect
> <prtg>
>  <error>1</error>
>  <text>User 'SKY-PRTG$' /  Error::  Access to the path 'Veeam\Backup' is denied.</text>
> </prtg>
> 
efflicto commented 3 years ago

Hey Markus,

thanks for your fast response. Here is the result:

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\veeam_diag.ps1 : Execution environment cannot be 
initialized to Remote
In Zeile:1 Zeichen:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\v ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,veeam_diag.ps1

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\veeam_diag.ps1 : bei <ScriptBlock>, C:\Program Files 
(x86)\PRTG Network Monitor\custom sensors\EXEXML\veeam_diag.ps1: Zeile 48
bei <ScriptBlock>, <Keine Datei>: Zeile 1
In Zeile:1 Zeichen:1
+ &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\v ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,veeam_diag.ps1

0:

And here the Data:

Data['linuxloginpassword'].asString := '***';
Data['notonpod'].asString := '0';
Data['fastcount'].asString := '0';
Data['lastmsg'].asString := '#Y2 Structural error in xml file, 3 open items. @#O231[Invalid JSON.]';
Data['resultfile'].asString := 'Result of Sensor 6351.txt';
Data['windowsloginusername'].asString := 'username';
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.local';
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 := '44279.3297263079';
Data['usednstime'].asString := '0';
Data['newpowershell'].asString := '0';
Data['linuxlogindomain'].asString := '';
Data['tlsexplicit_port'].asString := '';
Data['monitorchange'].asString := '';
Data['inerror'].asString := '1';
Data['sensorid'].asString := '6351';
Data['ipversion'].asString := '0';
Data['tlsexplicit_smtp'].asString := '';
Data['host'].asString := 'hostname.domain.local';
Data['exeparamslist'].asString := '';
Data['usewindowsauthentication'].asString := '0';
Data['simulate'].asString := '0';
Data['tlsexplicit_ftp'].asString := '';
Data['timeout'].asString := '60';
Data['exeparams'].asString := '-f="veeam_diag.ps1" -p="hostname.domain.local"';
Data['momopersistent'].asString := '';
Data['tlsexplicit_pop3'].asString := '';
vMarkusK commented 3 years ago

The root cause of this issue (and also #77 ) seems to be a connection issue to the Veeam Server.

My Recommendation:

Other Options;

JasperSnail commented 3 years ago

The root cause of this issue (and also #77 ) seems to be a connection issue to the Veeam Server.

  • PRTG Uses the Security Context of the Probe Device for the Advanced Sensor
  • Security Context is by default "Local System" (In @JasperSnail Case "SKY-PRTG$")
  • This Security Context does not have permissions to the Veeam Server (I am wondering that this was the case in v10)

My Recommendation:

  • Use a Dedicated Probe for this Sensor
  • Start the PRTG Probe Service as an account with access to the Veeam Console

Other Options;

  • Place the Computer Account from the remote probe in the local administrators group of the VBR Server (not recommended / Validated)
  • Use PS Remote for this sensor

Thanks Markus, I will give these a shot

efflicto commented 3 years ago

Hey Markus,

thanks for analyzing this and this makes sense. We're discussing the options and try your recommendations.

Thank you!

vMarkusK commented 3 years ago

@efflicto @JasperSnail great, I am looking forward to your feedback.

And just to complete the analysis. The xml error is based on the strange error message of the Veeam PowerShell Cmdlet, which includes a XML syntax.

efflicto commented 3 years ago

Hey Markus,

so we sided with the PRTG Remote Probe option. I've installed the probe on the Veeam server and added the sensor to it and it worked fine. The other options, except the PS Remote, weren't an option because of security.

Thank you for your time and help!

DerKiLLa commented 3 years ago

My Recommendation:

  • Start the PRTG Probe Service as an account with access to the Veeam Console

Hello, i tried that, but without success.

We've a sysaccount, especially for PRTG (sys022). I changed the Probe-Service to run under this account.

Veeam Backup and Replication:

image

But i get an error:

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1 : Failed to connect to Veeam 
BR Host '-BRHost xxxx.domain.local' with user 'sys022'
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

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1 : bei <ScriptBlock>, 
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1: Zeile 317
bei <ScriptBlock>, <Keine Datei>: Zeile 1
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:<prtg>  <error>1</error>  <text>Failed to connect to Veeam BR Host '-BRHost xxxx.domain.local' with user 'sys022'</text> </prtg> 

When i try to login with the sys022 account from the probe device, it does work.

image

Edit: I also tried to put the credentials in cleartext in the script, but doesn't work either ...

    Write-Debug "Connecting new BRHost '$BRHost' with user 'xxx\sys022'..."
    try {
        Connect-VBRServer -Server $BRHost -User "xxx\sys022" -Password "pass" 
    }
    catch {
        Throw "Failed to connect to Veeam BR Host '$BRHost' with user 'xxx\sys022'"
    }

If i run the script from powershell, it does work. But if i try to run it in PRTG, it does not work ...

carsten0407 commented 3 years ago

Tried the same…..same result

Mit freundlichen Grüßen / best regards

i. A. Carsten Trautmann

Senior System Engineer IT-Service

vMarkusK commented 3 years ago

@DerKiLLa Is your User "sys022" member of the local administrators on the VBR Server?

vMarkusK commented 3 years ago

Hello, I just want to update you about the current state of the analysis.

I have tested a few Concepts to reproduce this issue:

As I was not able to reproduce this issue I need more details details to dig deeper:

JasperSnail commented 3 years ago

@efflicto @JasperSnail great, I am looking forward to your feedback.

And just to complete the analysis. The xml error is based on the strange error message of the Veeam PowerShell Cmdlet, which includes a XML syntax.

Hi Markus,

I have set the PRTG Probe service to run as a domain admin service acc, it has access as a Standard user in Veeam BR - now upon trying to run the script I get the following error: A required privilege is not held by the client. (0x522)

Do you know where I might be missing a permission?

carsten0407 commented 3 years ago

..same testing, same result….

Mit freundlichen Grüßen / best regards

i. A. Carsten Trautmann

Senior System Engineer IT-Service [http://support.it.konicaminolta.de/signatures/KM_LOGO.jpg] Konica Minolta Business Solutions Deutschland GmbH Mittlerer Pfad 1, 70499 Stuttgart, Germany Phone: +49 (711) 1385 - 131<tel:+497111385131> Fax: +49 (711) 1385 - 222 Mail: @.**@.> Web: www.konicaminolta.dehttp://www.konicaminolta.de District Court / Amtsgericht: Hannover, HRB 61209 Management / Geschäftsführer: Joerg Hartmann & Kenichiro Fukasawa Aufsichtsratsvorsitzender: Jens Venrath Informationen über die Verarbeitung Ihrer personenbezogenen Daten durch uns können Sie unter https://www.konicaminolta.de/de/business-solutions/meta/dseg.html einsehen.

[http://support.it.konicaminolta.de/signatures/emailPrinzip.jpg]

Von: JasperSnail @.> Gesendet: Mittwoch, 31. März 2021 03:55 An: vMarkusK/Advanced-PRTG-Sensors @.> Cc: Trautmann, Carsten @.>; Mention @.> Betreff: Re: [vMarkusK/Advanced-PRTG-Sensors] Access to the Veeam\backup path denied after v11 Veeam update (#80)

@efflictohttps://github.com/efflicto @JasperSnailhttps://github.com/JasperSnail great, I am looking forward to your feedback.

And just to complete the analysis. The xml error is based on the strange error message of the Veeam PowerShell Cmdlet, which includes a XML syntax.

Hi Markus,

I have set the PRTG Probe service to run as a domain admin service acc, it has access as a Standard user in Veeam BR - now upon trying to run the script I get the following error: A required privilege is not held by the client. (0x522)

Do you know where I might be missing a permission?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/80#issuecomment-810697151, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APIS7JHOZHKWLWLTAE7NCLTTGJ6I5ANCNFSM4ZJ4CGDA.

DerKiLLa commented 3 years ago

@DerKiLLa Is your User "sys022" member of the local administrators on the VBR Server?

Yes. But this shouldn't make a difference.

OS of VBR Server Windows Server 2012 Datacenter OS of PRTG Probe Windows Server 2019 Domain Members? Yes, Windows Domain Is the Probe installed on VBR or dedicated Server? Dedicated Server Is probe Server Started as Named user? Yes, sys022 Local permission of the Probe Service user on the Probe? Yes, local admin Local permission of the Probe Service user on the VBR Server? Yes, local admin VBR Permissions of the Probe Service User? Veeam Backup Administrator

JasperSnail commented 3 years ago

So an update from me. When testing on the probe with powershell and running the script directly, all results were fine from any way we tested. But as soon as the Probe sensor was trying to run it, we'd get the above failures.

To workaround this that we found worked was having the Sensor configured to run a separate PS1 file that invokes the PRTG sensor script.

Sensor settings: Psx64.exe Params: -f="C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\RunVeeamScript.ps1"

Create .PS1 file called RunVeeamScript.ps1 with the following code:

Invoke-Command -ComputerName <VeeamServer> -FilePath "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\VeeamAdvancedPRTG.ps1"

DerKiLLa commented 3 years ago

So an update from me. When testing on the probe with powershell and running the script directly, all results were fine from any way we tested. But as soon as the Probe sensor was trying to run it, we'd get the above failures.

To workaround this that we found worked was having the Sensor configured to run a separate PS1 file that invokes the PRTG sensor script.

Sensor settings: Psx64.exe Params: -f="C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\RunVeeamScript.ps1"

Create .PS1 file called RunVeeamScript.ps1 with the following code:

Invoke-Command -ComputerName <VeeamServer> -FilePath "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\VeeamAdvancedPRTG.ps1"

Thanks for this workaround! Works like a charm! 👍

cipo80 commented 3 years ago

So an update from me. When testing on the probe with powershell and running the script directly, all results were fine from any way we tested. But as soon as the Probe sensor was trying to run it, we'd get the above failures.

To workaround this that we found worked was having the Sensor configured to run a separate PS1 file that invokes the PRTG sensor script.

Sensor settings: Psx64.exe Params: -f="C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\RunVeeamScript.ps1"

Create .PS1 file called RunVeeamScript.ps1 with the following code:

Invoke-Command -ComputerName <VeeamServer> -FilePath "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\VeeamAdvancedPRTG.ps1"

This work around working also in my enviroment.

Thank you 1k Jasper!!

xIceknightx commented 3 years ago

So an update from me. When testing on the probe with powershell and running the script directly, all results were fine from any way we tested. But as soon as the Probe sensor was trying to run it, we'd get the above failures.

To workaround this that we found worked was having the Sensor configured to run a separate PS1 file that invokes the PRTG sensor script.

Sensor settings: Psx64.exe Params: -f="C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\RunVeeamScript.ps1"

Create .PS1 file called RunVeeamScript.ps1 with the following code:

Invoke-Command -ComputerName <VeeamServer> -FilePath "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\VeeamAdvancedPRTG.ps1"

Works well here too! Thanks Jasper!!