i was testing batch files using below script
@echo off del c:\test\d.txt c:\PsExec.exe \\server -u domain\username -p password netstat -n |find /c "IP/PORT" > c:\test\d.txt for /F %%i in (c:\test\d.txt) do set myRESULT=%%i echo RESULT IS %myRESULT% if %myRESULT%==0 (echo ":Server is Not Connected") REM Set PRTG Sensor to Warning by returning <1> Exit 1 else (echo ":Server is Connected")
if i run script normally i get proper output in txt file.
but if i use this batch scripts using PRTG EXE/Script sensor the output in txt file changed to 0 (output should be 1 or higher if server is connected)
need help...
Add comment