Hello there,
For some reason i'm not getting this custom exe sensor working. It keeps giving me this error:
Failed to open event query. Access is denied.
If I run the .ps1 there's no problem. I'm sure the credentials are ok because this sensor is a part of a bigger object and credentials are inherited. Also I see the powershell.exe run as the inherited user when checking taskmanager. When I connect from the PRTG server to the evenvwr of the target server with the credentials there's no problem. Anybody any idea's?
Peter
$xml = wevtutil /r:server.domain.local qe Microsoft-Windows-Hyper-V-Integration-Admin /e:root "/q:*[System[(Level=3) and (EventID=4130) and TimeCreated[timediff(@SystemTime) <= 86400000]]]" $xmlData = [xml]$xml $result=[string]$xmldata.root.event.count+":OK" write-host $result
Article Comments
Hello Daniel,
This reply might sound strange but are you sure?!? I run several custom scripts, exe and WMI. They are all not working unless I fill in Windows Credentials. Also I see the process run under this account that I fill in at the Windows credentials and not the local system account. I don't see what the option Windows credentials are used for if this exe is always run under the local system account. This also means that you can never monitor another domain/server with a custom script.....am I missing something?
To be clear, all my custom EXE, WMI, EXE Advanced scripts (and I have a lot, monitoring 5 hyper-v clusters dynamically) are working when I fill in the Windows credentials (for half a year now so this is not the problem). Under this I created a new sensor that is giving me the error above. Credentials are inherited.
Peter
Jun, 2011 - Permalink
Dear Peter,
please just give it a try, to run the Probe Service under an admin user account. We wouldn't recommend this tip, if it hadn't already helped in numerous cases.
best regards.
Jun, 2011 - Permalink
Please note that all executables or script files used with an EXE/Script Sensor are executed under the same Windows user account under which the PRTG Probe service is running. In default configuration, this is the local "System" Windows user account. Please make sure this account has sufficient rights to run the file.
You can also change the user for the PRTG Probe service, so it is executed under the Windows Domain Administrator user account, for example. Your script/executable files will then be executed under this same user account.
Jun, 2011 - Permalink