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