the sensor was working fine like couple of months before.

then suddenly its giving an error. "xml parser mismatch </531>,got </prtg> -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code:PE231)

could any one please help me with this issue. am new to both prtg and scripting.

The script i am using in for the sensor.

$DEVICE=$args[0]

  1. Set Path $logpath = "
    $($DEVICE)\c$\Program Files\avs\var\clientlogs" cd $logpath
  2. Get Latest Log $logfile = gci *.log | sort LastWriteTime | select -last 1 | Select-object -Property Name
  3. Check Log $status = Select-String -Path $logfile.Name -Pattern "avtar Info <5314>:" | Foreach {$_.Line}
  4. remove unwanted chars $statusclean = $status -replace ‘[<>]’
  5. check status outcome if ($status -match "Command failed") { $result= "1" } else { $result = "0" }
  6. send to PRTG

"<prtg>" "<result>" "<channel>" "BackupStatus" "</channel>" "<value>" echo $result "</value>" "</result>" "<text>" echo "Status: $($statusclean)" "</text>" "</prtg>"


Article Comments

Hello Mr-x,

As a first step, please open the settings page of the sensor in PRTG and enable the option "Write sensor result to disk (Filename: "Result of Sensor [ID].txt")". The results will be written into the log file directory of the probe, where the sensor is configured:

  • C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)

The ID of the sensor is part of the web browser URL and is also displayed on the sensor's overview page.

Best regards, Felix


Apr, 2018 - Permalink