Background: Remote probe on Server X Sensor in question is under Server Y in a group on the remote probe on Server X. Sensor runs a batch file with the following commands:
@ECHO OFF SETLOCAL ENABLEEXTENSIONS SET server=%1 SET port=%2 REM Note that this assumes that the "portconnections.vbs" file exists in the listed path on the REMOTE machine. REM Also, this script only works with host names. WinRM will not work with an IP address here. FQDN is not necessary if in the same domain. winrs -r:%server% cscript "D:\scripts\portconnections.vbs" %port%
The batch file runs fine when I remotely login to the remote probe server X and use the same parameters I have in the sensor. I RDP into server X using the same credentials used in PRTG "Credentials for Windows Systems".
I've spent hours digging around the internet for what this error means and all I find is very specific suggestions for specific applications that don't apply here.
Article Comments
The Batch file works fine when I run it while logged in using the same domain account that the Remote Probe service runs under. It outputs value:OK, such as 8:OK
Jun, 2015 - Permalink
Sorry, let me clarify... The probe service runs as "local system", but the we run this sensor (and others) using Security Context > Use Windows credentials of parent device and the Windows Credentials are inherited all the way from the Root settings.
Jun, 2015 - Permalink
Hi, For some customer it helped to additionally change the log on account of the service as well. Please try to change this account and see if the script works.
Additionally, please try if the demo batch files of PRTG are working. This issue could also be related to the Remote-Commandline. At the moment you do not pass the username / password, do you need to enter credentials if you execute the script manually?
You could also ease this process by installing a Remote Probe on the target device and executing the VBS directly.
Jun, 2015 - Permalink
I tried setting the logon account for the service to the domain service account, but it cause most of the existing sensors to error out, so that's not an option at the moment. Besides, what's the point of using the inherited credentials option then?
The demo batch and VBS files all work fine.
I do not get prompted for credentials when I run my batch file. It works just fine while I'm logged into the probe server with the credentials that PRTG is set to use for Windows machines.
We don't want to get into a situation where we need to have a remote probe on every server we want this data from. That just isn't feasible or scalable for an Enterprise company.
It would be nice if there was some logging output that would explain what the exact problem is. But without knowing exactly how PRTG executes a batch file from a sensor, I don't have much to go on.
Jun, 2015 - Permalink
Hi,
The Custom EXE Sensor of PRTG require a return value from the Batch file. The syntax is listed in the API documentation Setup > PRTG API > Custom Sensors and should look like value:message.
Furthermore, the PRTG Core Server Service is started with the local system account. Please try to change the log on account for this service to an account with elevated access rights, like an administrative account. The execution of the script might fail if PRTG is not allowed to access the script on your D: drive.
Best regards
Jun, 2015 - Permalink