What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

HTTP Push Data Advanced sensor - Why does XML/JSON require "content=" string?

Votes:

0

I created HTTP Push Data Advanced sensor with HTTP Request Method = POST I use Postman to test sending the HTTP POST to http://<my_prtg_ip>:5050/<token>


Test 1:

If I use the following POST content, I received error: No response (code: PE002) in PRTG

{
  "prtg": {
    "result": [
      {
        "channel": "MyChannel",
        "value": "12"
      }
    ],
    "text": "Breaking news 2"
  }
}

Test 2:

If I use the following POST content (notice "content=" in 1st line), PRTG can receive successfully

content=
{
  "prtg": {
    "result": [
      {
        "channel": "MyChannel",
        "value": "12"
      }
    ],
    "text": "Breaking news 2"
  }
}

Test 3:

If I use the following POST content, I received error: No response (code: PE002) in PRTG

{<prtg>
	<result>
		<channel>MyChannel</channel>
		<value>10</value>
	</result>
	<text>Mary%20has%20a%20little%20dove</text>
</prtg>

Test 4:

If I use the following POST content(notice "content=" in 1st line), PRTG can receive successfully

content=
<prtg>
	<result>
		<channel>MyChannel</channel>
		<value>10</value>
	</result>
	<text>Mary%20has%20a%20little%20dove</text>
</prtg>

  • Question: Is this a bug?

http-push-data-advanced-sensor json xml

Created on May 7, 2017 6:34:02 AM

Last change on May 8, 2017 6:45:53 AM by  Luciano Lingnau [Paessler]



3 Replies

Votes:

0

Hi there,

It's not a bug. PRTG always checks the content of the content post field, which is empty by default when omitting it. You're just submitting the result without a key for PRTG to associate with the result.


Regards,
Stephan Linke, Paessler Tech Support

Created on May 8, 2017 8:53:05 AM by  Stephan Linke [Paessler Support]



Votes:

0

I finally found the solution (or workaround) so that "content=" is not necessary in the HTTP POST.

Test 1 in my example above works with the HTTP POST body as shown IF I add content type application/json.

Created on May 8, 2017 3:52:58 PM



Votes:

0

Hi there,

Nice, thanks for sharing!


Regards,
Stephan Linke, Paessler Tech Support

Created on May 8, 2017 4:46:50 PM by  Stephan Linke [Paessler Support]




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.