Advanced-PRTG-Sensors icon indicating copy to clipboard operation
Advanced-PRTG-Sensors copied to clipboard

Proposal: Allow remote execution on non-domain VBR servers

Open broth-itk opened this issue 3 years ago • 2 comments

"Remote VBR server" requires it to be joined to the local domain.

In my case I want to monitor various customer backup servers which have a local administrator-user only (standalone installation)

There should be an option to specify username + password of the server via the command line. PRTG could supply those to the script using

%windowsdomain | The domain for Windows access (may be inherited from parent).
%windowsuser | The username for Windows access (may be inherited from parent).
%windowspassword | The password for Windows access (may be inherited from parent).

Instead of

$RemoteSession = New-PSSession -Authentication Kerberos -ComputerName $BRHost

I think about using

$pw = ConvertTo-SecureString -AsPlainText -Force -String "<remote password>"
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist "$($BRHost)\Administrator",$pw
$RemoteSession = New-PSSession -ComputerName $BRHost -Credential $cred

On the servers the TrustedHosts property must be set. For testing I allowed all hosts:

cd wsman:\localhost\client
set-item trustedhosts -value * -force

I tested above modifications on my PRTG server (Windows Server 2019) to VBR Server (Veeam v10, Windows Server 2016). Connection is successful but script execution is very long (looks like it hangs).

The VBR server has running processes indicating that something is running:

image

Feedback very welcome, thanks!

broth-itk avatar Feb 25 '21 06:02 broth-itk

Any progress on getting it to work on workgroup or remote domain joined VBR? Our VBR is in another data center and completely separated from our primary domain. I've been having some success running the script using powershell script with invoke-command using local admin credentials for the VBR server and it works if I run it through powershell on the probe. I've stored the credentials and it works if I run the RunVeeamScript.ps1 script through powershell on the probe, but if I invoke the same script in PRTG it just times out no matter which security context I'm running it in.

Here's my RunVeeamScript.ps1 file

$username="workgroup-server\adm.local" $encrypted = Get-Content C:\Scripts\workgroup-server_credentials.txt | ConvertTo-SecureString $credential = New-Object System.Management.Automation.PsCredential($username, $encrypted) Invoke-Command -ComputerName workgroup-server-fqdn -FilePath "C:\Scripts\PRTG-VeeamBRStats.ps1" -Credential $credential

pitah81 avatar Feb 09 '22 00:02 pitah81

Does the new capability to push the monitoring data (http/https) from the VBR server to the PRTG probe help in your case?

https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/master/Veeam/PRTG-VeeamBRStats-v3.ps1

vMarkusK avatar Mar 02 '22 21:03 vMarkusK