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

Unable to load Veeam PowerShell Modules in PRTG #78

Closed
vMarkusK opened this issue Mar 16, 2021 · 6 comments · Fixed by #79
Closed

Unable to load Veeam PowerShell Modules in PRTG #78

vMarkusK opened this issue Mar 16, 2021 · 6 comments · Fixed by #79

Comments

@vMarkusK
Copy link
Owner

Sorry we receive only the same generic message in PRTG:

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)

The problem seems to be another. Running the latest script from github gives us the the following log message in the directory C:\ProgramData\Paessler\PRTG Network Monitor\Logs\sensors on the PRTG probe server:

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\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\EXEXML\P ...
  •   + CategoryInfo          : ObjectNotFound: (Disconnect-VBRServer:String) [PRTG-VeeamBRStats.ps1], CommandNotFoundEx 
     ception
      + FullyQualifiedErrorId : CommandNotFoundException,PRTG-VeeamBRStats.ps1
    
    

No Veeam Modules found, Fallback to SnapIn.

Running de script directly on the probe server with veem management console installed works fine.
Any ideas?

Originally posted by @stoeffel2002 in #77 (comment)

@vMarkusK vMarkusK self-assigned this Mar 16, 2021
@vMarkusK vMarkusK added this to Possible To Do in PRTG-VeeamBRStats via automation Mar 16, 2021
@vMarkusK
Copy link
Owner Author

Have a look at the comment from Johan:

https://mycloudrevolution.com/en/2020/01/27/prtg-veeam-sensor-retrospective/

It seems I’ve found the cause of the issue. For some reason PRTG won’t find the module when using: Import-module -name Veeam.Backup.Powershell as it claims it can’t find it. However, if I after “-name”, specify the complete path to the Veeam.Backup.Powershell.dll, the script is successfull. So the script is working fine and as intended, and the issue seems to be on our server and it’s ability to load the Module at times.

@stoeffel2002
Copy link

Hi Markus,
Thank you very much for that link.
After using the full path "C:\Program Files\Veeam\Backup and Replication\Console\Veeam.Backup.PowerShell.dll" instead of veeam* on line 101 and line 122 and the full path "C:\Program Files\Veeam\Backup and Replication\Console\Veeam.Backup.PowerShell.dll" instead of Veeam.Backup.PowerShell on line 143, the script is runnig without any problems.

@vMarkusK
Copy link
Owner Author

@stoeffel2002 thanks for the confirmation.

Just to make sure, as an other user the original script works fine?
Any idea what's the difference between the two user?

I have also created a Veeam forum thread regarding this behavior:
https://forums.veeam.com/powershell-f26/failed-to-load-module-veeam-backup-powershell-t72872.html

@vMarkusK
Copy link
Owner Author

@stoeffel2002 might you please test this version:
https://raw.githubusercontent.com/vMarkusK/Advanced-PRTG-Sensors/PSModulePath/Veeam/PRTG-VeeamBRStats.ps1

I have added a small hack to make sure PSModulePath includes Veeam Console.

@vMarkusK vMarkusK linked a pull request Mar 16, 2021 that will close this issue
@stoeffel2002
Copy link

Hi Markus,
Thank you for this new version. I've implemented it and it's running without any problem now.
Before, I have tested the old script (without the full path) again and interestingly it worked also.
Also after restarting the server with PRTG Probe and Veeam Console.
I think this issue can be closed.

@vMarkusK
Copy link
Owner Author

Awsome. Thanks for your efforts.

I will wait for some additional feedback, just to make sure and the I will merge the PR.

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

Successfully merging a pull request may close this issue.

2 participants