This article applies as of PRTG 22
Setting up an HTTP XML/REST Value sensor to monitor a REST/JSON value, but it returns the error: "Protocol Error: The remote server returned an error. (404) Not Found. Error code: PE023."
Fixing 404 errors of the HTTP XML/REST Value sensor
The HTTP XML/REST Value sensor returns an error when the URL contains specific URL encoded characters. In the case of the question above, the character sequence %2F is the reason for this issue. Sometimes, the HTTP XML/REST Value sensor (based on .NET) encodes such a sequence again, which results in a broken URL.
Solution
The solution for this issue is to create a new configuration file. This file will force the PRTG .NET XMLValue.exe file to interpret special characters correctly. As a result, the URL is kept encoded.
PRTG runs the XMLValue.exe file with every scan. If a corresponding configuration file is available, the instructions in this file will be considered while running XMLValue.exe. Therefore, we can use a configuration file to fix this problem.
Steps to go
- Open a new text editor.
- Copy the following text into the editor:
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<uri>
<schemeSettings>
<clear/>
<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/> </schemeSettings>
</uri>
</configuration>
- Save the text file under the name XMLValue.exe.config.
- Save this file to the Sensor System subfolder of the PRTG program directory. PRTG is now able to grab the correct value.
Disclaimer:
The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.