New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Using HTTP notification with Postdata

Votes:

0

Your Vote:

Up

Down

Hi,

I would like to create a HTTP Action notification and send postdata with it. I already know it can be done in Notifications -> Add new notification -> select Execute HTTP Action. In the URL I put my own site that will retrieve the Postdata given. The postdata in this case will be only the placeholder %message.

My question is how can I retrieve the Postdata that I put in before with vb.net.

Thanks in advance!

http postdata problem

Created on Aug 6, 2014 1:47:19 PM by  247Everywhere (0) 1



4 Replies

Accepted Answer

Votes:

1

Your Vote:

Up

Down

Asuming you have put

message=%message

in the sensor's post data field, you can retreive this value in VB (ASP.NET) with the code snippet below. (to be placed in the page load event.)

Dim param() As Byte = Request.BinaryRead(HttpContext.Current.Request.ContentLength)
Dim content As String = Encoding.ASCII.GetString(param)
Dim args As NameValueCollection = HttpUtility.ParseQueryString(content)
Dim myMessage as string = args("message")

Created on Aug 7, 2014 7:12:19 AM by  PRTGToolsFamily [prtgtoolsfamily.com] (12,665) 3 4



Votes:

0

Your Vote:

Up

Down

How could I test this? With dummy data? Like message=test

Thanks

Created on Aug 7, 2014 10:13:00 AM by  247Everywhere (0) 1



Votes:

0

Your Vote:

Up

Down

You can use the notification test button to test the notification. When testing, placeholders are send as plain text, so in the example above you would expect to get '%message' in your myMessage variable.

Created on Aug 7, 2014 12:09:14 PM by  PRTGToolsFamily [prtgtoolsfamily.com] (12,665) 3 4



Votes:

0

Your Vote:

Up

Down

Thanks al ot! It works now. Really helped me!

Created on Aug 7, 2014 12:15:01 PM by  247Everywhere (0) 1



Please log in or register to enter your reply.


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.