Hello! I've written a batch file which shall read the output from an *.exe file, manipulate this outputstring, and give it to my PRTG Sensor. When I test my batch-file in cmd it works fine, but when i load my PRTG Sensor the Sensor-output is never correct.

My Batch File:

@echo off
C:\"Program Files (x86)"\Cleware4.2.8\Example\USBtemp\Release\USBTemp.exe -b > temp.txt
set /p VAR=<temp.txt
set grm=%VAR%
set x=%grm:~22,5%
echo %x%:ok

My CMD output:
26.00

MY PRTG Output:
Last Message: 	
~22,5% echo %x%:ok 26.06:ok
Last Value:
**empty**

There's my problem. I tried a lot, but i can't figure out how to format the output of my Batch-File right. I'm really sorry for my bad english, it's not my native-language.


Article Comments

Hello,

can you please try it with:

@echo off
C:\"Program Files (x86)"\Cleware4.2.8\Example\USBtemp\Release\USBTemp.exe -b > temp.txt
set /p VAR=<temp.txt
set grm=%VAR%
set x=%grm%:~22,5
echo %x%:ok

My CMD output:
26.00

MY PRTG Output:
Last Message: 	
~22,5% echo %x%:ok 26.06:ok
Last Value:
**empty**

Sep, 2012 - Permalink

Hi, i also have a Cleware USB Temp Sensor. How can i put it in PRTG ? This Code does not realy help. I want to get the temperature in my PRTG map.


Apr, 2016 - Permalink

Hello Max-bfm,

you need to use this code with a Exe-Sensor in PRTG. Then you can put the sensor result on a map.

best regards.


Apr, 2016 - Permalink