Hello

We are trying to get an EXE/Script Advanced Sensor to work.

The script is a Windows Batch Script (cmd) and works if executed on the server itself without any problem.

If setup as sensor on PRTG (3 params as string value) we get the following error in the sensor log file "The system cannot find the path specified".

  • We tried to set a different user account fer the probe service.

It seems, this is not be a problem of missing permissions :/

There aren't any more error messages and we have no idea on how to get this work.

Have you ever had someone having a similar issue?


Article Comments

Hello John,

Does the batch script maybe try to reach certain files/executables on the probe system in different locations? If so, try putting them into the same folder where the batch resides.

Kind regards,

Erhard


Nov, 2018 - Permalink

Hello Erhard

Thank you for your response.

We got the following setup:

## Server-01

  • PRTG probe installed
  • Script "MyScript.cmd" placed in "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\"

## Server-02

  • No PRTG probe installed
  • Console-Application "MyApp.exe" placed in "C:\projects\"

## Usage

Now we want to start "MyApp.exe" on Server-02 and process the returned XML using a EXE/Script Advanced Sensor.

## Configuration

In the sensor settings we selected the "MyScript.cmd" as Program/Script and as parameter we have set our 3 params like this:

"C:\projects\MyApp.exe" "Default" "Test1"

We would expect our probe (Server-01) to copy "MyScript.cmd" to the Server-02 at "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\" and execute "MyScript.cmd" using the 3 parameters.

We do not need to install the PRTG probe on the Server-02 to get this work?


Nov, 2018 - Permalink

Hello John,

It doesn't work that way, the script is run locally on the probe system, it is not copied over to the target machine. In this case you would need a script that establishes a remote connection to Server-02, for example with a powershell script that establishes a remote powershell session to the other host. Another option might be using PsExec to achieve this.

A different approach would be to run the script itself periodically as scheduled task on Server-02 and have the script generate an output that can be caught by an HTTP Push Data Advanced Sensor (or HTTP Push Data Sensor in case only one value is the final result).

Kind regards,

Erhard


Nov, 2018 - Permalink

Hello Erhard

Thank you for pointing us in the right direction.

We got it finally work using PsExec :)

Regards


Dec, 2018 - Permalink