Hi,
after I updated our PRTG installation to version 18.2.39.1661 this morning, I got two custom EXE/XML Scripts that gives this error: XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
Has someone any idea how to fix this?
Article Comments
Hi,
thanks for your response. The quotes in the parameters fixed the issue partially. I use a script to check licenses. In the parameters I then give an option -Portserver and after that a -Features option to give the differtent software to check the license for. The line looked like this: -PortServer 27000@Servername –Features A, B, C, D, etc.
I changed the line to -PortServer "27000@servername" -Features "A, B, C, D" but then it gives the whole name A, B, C, and gives the result for Feature A.
After that I changed to -Features "A", "B", "C" but then only Feature A was working. Does this mean that I have to put a sensor for each different Feature?
Kind regards,
Dick Vink
Apr, 2018 - Permalink
Hi Dick,
For security reasons, arrays can no longer be transferred in this way. There are two possibilities:
1. Make a variable for each parameter. Please note, that you have to create those parameters in the powershell, too:
-FeatureA "A" -FeatureB "B" -FeatureC "C" -FeatureD "D"
2. Change the Powershell script to split the incoming string, with the separator ",":
PRTG parameter:
-Features "A,B,C,D"
Powershell changes:
[string]$featureIn
$feature = $featureln.split("{,}")
Please let me know if one if the above fits your requirements.
Kind regards,
Birk Guttmann, Tech Support Team
Apr, 2018 - Permalink
Hello there,
We changed the behavior with command line parameters. Here is the corresponding section from the Release Notes:
We fixed a potential security issue with command line parameters for PowerShell scripts that affected EXE/Script sensors, EXE/Script Advanced sensors, as well as Execute Program notifications (CVE-2018-9276). We also fixed a potential security issue with sample custom notifications (CVE-2018-9278).
Note: The fix required changes to the handling of command line parameters. In certain cases, it will be necessary to adapt quoting with backticks (``) in the parameters field because PRTG will process quotes more accurately. Please use single or double quotes to escape special characters and whitespaces in the parameters fields.
Please let me know if there are more questions about this.
Kind regards,
Birk Guttmann, Tech Support Team
Apr, 2018 - Permalink