Closed FynnKotlorz closed 11 months ago
Duplicate of #77
Duplicate of #80
As you can see in the linked issues this seems to be caused by an changed security behavior of Veeam v11.
Have you configured the PRTG sensor to use the Security context of the Probe service? If so, is the Security context of the Probe service "Local System" or a named user?
Some additional details about your environment:
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:
Hey,
thanks for your reply and great help.
Some informations i should gave you earlier, my bad im sorry!
The PRTG Probe is not installed on the same server as Veeam.
Because the Veeam Server is not a Domain Member (and we can not change it in the future because of some safety rules we have to follow), i created a service account user localy on both servers with the same name and password (in the past it worked like that and we‘re still using it on another older version).
username is constructed like this:
sa-
for example:
sa-abc-srv-01
This is a normal Windows User. (Tested it with Admin rights already) On the VBR Server this user has viewer rights in Veeam.
Both logins worked in the past.
OS on both systems is Windows Server (i dont know the specific version, i can tell you tomorrow! :>)
i hope these informations will help you :o
regards,
Fynn
Markus Kraus @.***> schrieb am Di. 30. März 2021 um 23:35:
Hello, I just want to update you about the current state of the analysis.
I have tested a few Concepts to reproduce this issue:
- Probe on VBR Server (Service as "local System" and "Named User")
- Probe on dedicated Server (Service as "Named User")
As I was not able to reproduce this issue I need more details details to dig deeper:
- OS of VBR Server
- OS of PRTG Probe
- Domain Members?
- Is the Probe installed on VBR or dedicated Server?
- Is probe Server Started as Named user?
- Local permission of the Probe Service user on the Probe?
- Local permission of the Probe Service user on the VBR Server?
- VBR Permissions of the Probe Service User?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/81#issuecomment-810593129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATO2ASYLODDGYBVKJ4TOHMLTGI7ZZANCNFSM42CFBM7Q .
Spent a lot of time trying to get this to work. Running the ps1 script from the probe server works. Capturing that output and turning it into a ps1 script using a lot of "Write-Output" statements works. Calling it with or without the PSx64.exe fails.
I get the feeling that it works when it is hard-coded XML but the sensor is interpreting the output as JSON only when it takes it from the script directly even though the output is in XML.
This is a fantastic script and I hope this issue get's worked out. The only work around I am considering is to have your script write to a file then have another script read and put that result out. I tried somethign similar but might just have to schedule your script then have another act as a filter for the output. Pretty ugly and really don't want to go down that path.
Hi @RonSharcott ,
let's get things sorted:
Manually running Script on Probe Works fine, right?
Calling it with or without the PSx64.exe fails.
Have you enabled the Logs for the Custom Sensor (please with PSx64.exe)?
Might you please run the script run with -Debug
switch and share the output?
I don't think that your Workaround is required. In the case the script execution works manually fine, we will figure out what's going wrong.
Manually running Script on Probe Works fine, right? Correct. Load the script into the ISE then execute. I get an XML output which I have taken an edited into a series of Write-Output statements then called that script instead. That works fine so the output looks correct.
Do you use any parameters to execute the script (-BRHost etc.)? Calling it with or without the PSx64.exe fails. I have used the -f (script path - both relational and full path) and -p="BRHost - (Veeam host - both by hostname and FQDN)
Calling from PRTG as Custom Sensor, right? Have you enabled the Logs for the Custom Sensor (please with PSx64.exe)? I have turned on the logs but all I get is the data file and a blank txt file. (blank actually just has spaces on one line)
https://www.paessler.com/manuals/prtg/exe_script_sensor - Result Handling Please share the output in the Log-File. Pasted after all questions
Might you please run the script run with -Debug switch and share the output? I assume -Debug is a switch on the file? maybe in the -p string? Trying to find where it writes to.
Result of Sensor 22499.Data.txt Edited for security
Data['linuxloginpassword'].asString := '';
Data['notonpod'].asString := '0';
Data['fastcount'].asString := '0';
Data['lastmsg'].asString := '#Y2 @#O233 @#O231[Invalid JSON.]';
Data['resultfile'].asString := 'Result of Sensor 22491.txt';
Data['windowsloginusername'].asString := 'PRTGAdmin';
Data['hostv6'].asString := '';
Data['exefile'].asString := 'PSx64.exe';
Data['lastuptime'].asString := '0';
Data['writeresult'].asString := '2';
Data['blockedsens'].asString := '';
Data['reqmsginterval'].asString := '300';
Data['windowslogindomain'].asString := '
Manual run with -debug parameter Edited for security
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-VeeamBRStats.ps1 -debug
DEBUG: Starting to Process Connection to 'veeamlan1' with user '
Repository Name Free (GB) Total (GB) Free (%) Status
Local Veeam server Backup Repository 4.18 20.00 21 OK
BCNET Data Domain 4911.09 10240 48 OK
veeambackuprespository storageint 10196.62 24576 41 OK
veeambackuprepository1 storageint 9720.32 10240 95 OK
veeambackuprepository1 nas2 1218.22 5120 24 OK
Backup Repository lansdowne EMC 4526.28 16126.12 28 OK
veeambackuprepository nas2 5615.21 12288 46 OK
Successful Backups : 14 Warning Backups : 0 Failes Backups : 0 Failed Backups : 0 Running Backups : 0 Total Backup Transfer : 59 Total Backup Read : 85 Warning BackupCopys : 0 Failes BackupCopys : 0 Failed BackupCopys : 0 Running BackupCopys : 0 Idle BackupCopys : 4 Successful Replications : 2 Warning Replications : 0 Failes Replications : 0 Failed Replications : 0 Running Replications : 0 Seccessful Endpoints : 0 Warning Endpoints : 0 Failes Endpoints : 0 Running Endpoints : 0
Thanks. Please try the following steps:
It is starting to look like a permissions issue. Trying to find the correct account to use. I've tried changing the Windows credentials on the device and setting up the Veeam credentials. Not quite getting the correct balance.
Thanks to that -debug flag for pointing out the credential issue.
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-VeeamBRStats.ps1 -p="veeamlan1" -debug
DEBUG: Starting to Process Connection to '-p=veeamlan1' with user '
+ 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 : at
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.ps1
Please change the default BRHOST in the script and do not use the parameter to pass the name. There seems to be a syntax error in your call.
Done. That failure may have come from repeated failures locking me out.
It's odd. I can run the script, even in -debug mode, and get XML back. But the sensor complains it's not in JSON format. I would say something is tripping the sensor to think the returned data is supposed to be in JSON format.
From what I can tell, from the the original description on setup, there are 2 accounts at play. The Windows Credentials and the Veeam Credentials. I can use my own System Account to remote and to get a debug or XML return. It still won't work with the sensor.
Is the probe service started as a valid windows user which has access to veeam (please verify this via vbr console connection)?
In most cases, the XML error returned by the PRTG Sensor is based on an unknown error during script execution. This seems the case because also the log file is empty in your case.
Although I have tried this before I just now:
Double checked the service and it was running as Local System Changed it to run as the PRTG account and the error on the sensor changed to: A required privilege is not held by the client. (0x522)
Is the PRTG Core server the only Probe in your environment? Service is restarted after the change?
I am not sure what's the reason for this message (maybe the local security policy for this account).
A reboot of the PRTG Core service might also help.
An other workaround is installing a probe service on the veeam Server itself and move the sensor to this probe.
I have a few remote probes. Generally I would expect the same result from all of them. I originally moved this device off a remote probe and onto the core probe to try and get better logging.
For the service, I entered the credentials and restarted the service.
I have a few hoops to jump through before considering turning off UAC on the Veeam server. From other threads here that has been suggested.
Tried setting up the sensor account in Veeam with Administrator rights and that didn't work.
Not sure if anything else can be done.
Sorry, bus this sounds definitely like a permission issue.
An other workaround is installing a probe service on the veeam Server itself and move the sensor to this probe. Have you tried this workaround?
It does look like permissions. I tried a probe on the Veeam server with no success. Not sure how much more time I can throw at this. I did try setting up accounts in Veeam and also using the accounts that were already listed. My guess at this point is that there may be something prohibiting the use of the APIs either in Veeam or on the server.
Please have a look at this new and enhanced Version: https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/master/Veeam/PRTG-VeeamBRStats-v3.ps1
We also did the veeam upgrade from 10 to 11. Since then the script is broken for us as well. Nothing else changed.
@IcyPunch have you upgraded to vbr console on the probe?
Please have a look at the v2 version of the script in the repo. This might solve a lot of issues.
@vMarkusK I have used this one today, is it incorrect?:
@vMarkusK
I have used this one today, is it incorrect?:
That's the right one. With that version you do not need the PSX64.exe anymore.
Please try to connect to the vbr server from the probe device. Missing upgrade of the console is most common issue.
@vMarkusK You were absolutely correct with your hint of not having upgraded the veeam console on the prtg server. I feel stupid saying / admitting this, but I'm very happy to confirm it's working again now after i did exactly that. First time around I remembered it and now I didn't :-P Thank you for your patience and advice!
Good evening,
i just updated my veeam server to version 11. after i updated the console aswell and checked all steps needed and updated the script with your new one i have the following issue:
PRTG shows up this failure:
(sorry that it is in german) 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)
and of course a do not get any data.
i just reviewed the logfiles in which i found the following message:
Disconnect-VBRServer : Der Zugriff auf den Pfad "Veeam\Backup" wurde verweigert. In C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1:66 Zeichen:5
i don't really know how to fix this issue.
Greetings from germany,
Fynn