Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using remote probe #106

Open
enea1111 opened this issue Nov 29, 2023 · 15 comments
Open

Problem using remote probe #106

enea1111 opened this issue Nov 29, 2023 · 15 comments

Comments

@enea1111
Copy link

enea1111 commented Nov 29, 2023

Hallo!
I am using a Remote Probe from Prtg to access Veeam installed on the remote network. Veeam is not installed on the same server where the Remote Probe is installed.
Prtg's sensor is set up like this:
EXE/Script: PSx64.exe
Parameters -f="PRTG-VeeamBRStats.ps1" -p="192.168.1.21"

Prtg returns the following error:
\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\PRTG-VeeamBRStats.ps1 : 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. At line:1 char:1 + &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\PRTG ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Disconnect-VBRServer:String) [PRTG-VeeamBRStats.ps1], CommandNotFoundEx ception + FullyQualifiedErrorId : CommandNotFoundException,PRTG-VeeamBRStats.ps1 No Veeam Modules found, Fallback to SnapIn.

I have found a similar issue, but I can't solve.
I do not understand what I am doing wrong...

@enea1111
Copy link
Author

enea1111 commented Nov 29, 2023

Others info, may be it can help:

PS C:\Users\Administrator> Get-PSSnapin -Registered | fl *
PS C:\Users\Administrator> Add-PSSnapin VeeamPSSnapin
Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
At line:1 char:1
+ Add-PSSnapin VeeamPSSnapin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapin:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

@enea1111
Copy link
Author

Last test, if can help more:

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE> .\PRTG-VeeamBRStats-v3.ps1 -BRHost 192.168.1.21 -debug

No Veeam Modules found, Fallback to SnapIn.
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\PRTG-VeeamBRStats-v3.ps1 : 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.
At line:1 char:1
+ .\PRTG-VeeamBRStats-v3.ps1 -BRHost 1192.168.1.21 -debug
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Disconnect-VBRServer:String) [PRTG-VeeamBRStats-v3.ps1], CommandNotFoun
   dException
    + FullyQualifiedErrorId : CommandNotFoundException,PRTG-VeeamBRStats-v3.ps1

@vMarkusK
Copy link
Owner

You need at least install the Veeam Console on the probe device that executes the script.

Otherwise use the httppush feature from the VBR server to the probe.

@enea1111
Copy link
Author

Thanks for you reply!
On the probe is already installed another Veeam Console (Community Edition).

@vMarkusK
Copy link
Owner

Does the console connection to 192.168.1.21 work?

@enea1111
Copy link
Author

enea1111 commented Nov 29, 2023 via email

@enea1111
Copy link
Author

The console of the probe can also connect to the target Veeam Backup Server.

Really I don't understand what I'm doing wrong...

@enea1111
Copy link
Author

enea1111 commented Nov 30, 2023

I have different result if I use Powershell launched from Veeam Console:

immagine

This:

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE> .\PRTG-VeeamBRStats-v3.ps1 -BRHost 192.168.1.21 -debug

DEBUG: Starting to Process Connection to '192.168.1.21' with user 'prtg' ...

DEBUG: Connecting BRHost '192.168.1.21' with user 'prtg'...

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\PRTG-VeeamBRStats-v3.ps1 : Failed to connect to Veeam
BR Host '192.168.1.21' with user 'prtg'
At line:1 char:1
+ .\PRTG-VeeamBRStats-v3.ps1 -BRHost 192.168.1.21 -debug
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats-v3.ps1

[really confused]
It's possible tu use different user to connect?

@enea1111
Copy link
Author

enea1111 commented Nov 30, 2023

UPDATE.
I added user "prtg" to remote Veeam server: now debug run!!!!!!!!

RESULT!!

.\PRTG-VeeamBRStats-v3.ps1 -BRHost 192.168.1.21
<prtg><result>
                <channel>Successful-Backups</channel>
                <value>0</value>
                <showChart>1</showChart>
                <showTable>1</showTable>
                </result><result>
                <channel>Warning-Backups</channel>
                <value>2</value>
                <showChart>1</showChart>
               etc....

Now Prtg has an different error:

\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\PRTG-VeeamBRStats-v3.ps1 : Failed to connect to Veeam BR Host '192.168.1.21' with user 'DESKTOP-LUS909N$' At line:1 char:1 + &'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\PRTG ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats-v3.ps1

"DESKTOP-LUS909N$" is NOT the user, but the computer name of the probe.
May be can I use a specific user from PRTG Probe to connect to Veeam server?

@enea1111
Copy link
Author

enea1111 commented Nov 30, 2023

If it can help... I tested following configurazion on a new sensor without PSx64.exe:

immagine

and with this return this error:

immagine

@enea1111
Copy link
Author

Last test with XML Custom EXE/Script Sensor Advanced:

immagine

retun a format error:

immagine

BUT return of script (attached) is like suggest on:
https://www.paessler.com/manuals/prtg/custom_sensors#exe_script

OK, no more ideas... I feel frustrated

ATTACH:
script-out.zip

@vMarkusK
Copy link
Owner

Just reconfigure the PRTG PROBE service to run as a service account with at least read permissions in VBR.

@enea1111
Copy link
Author

enea1111 commented Dec 1, 2023

Thanks @vMarkusK .

Unfortunately, the situation is unchanged.
I have no more error on user, but error on "not well-formed" output or XML output as per previous messages. :(

@enea1111
Copy link
Author

enea1111 commented Dec 7, 2023

When the script is launched locally it produces the correct XML output, no errors.
To work with PRTG, I now save the output to an XML file using a scheduler which is then passed to the Prtg sensor and it works.

Strange... I'll opent a ticket in Paessler.

@vMarkusK
Copy link
Owner

vMarkusK commented Dec 7, 2023

You can do a few more diagnostic steps:

  1. Run Script in Debug mode and Share the Results PRTG-VeeamBRStats-v3.ps1 -Debug
  2. Start a PowerShell Session as the PRTG Probe User (Context of the Probe Service) and run the Script
  3. Enable logging for the Sensor and share the Output (Result Handling)

Store result: Store the last sensor result in the \Logs\sensors subfolder of the PRTG data directory on the probe system. The file names are Result of Sensor [ID].txt and Result of Sensor [ID].Data.txt. This setting is for debugging purposes. PRTG overwrites these files with each scanning interval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants