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

EXECUTE HTTP ACTION not take effect in PRGT

Votes:

0

Hi , I have writen a RESTFull web service accept JSON format. This service works on local server in company. Any client in company can post data(HTTP POST) to url. All successful. BUT.I configure a notification for EXECUTE HTTP ACTION. I enter the url and post data. Then test notification , There is no affect.

http json postdata

Created on Jun 13, 2017 9:09:09 AM



Best Answer

Accepted Answer

Votes:

0

Dear nogay_42

If you enter any postdata, HTTP POST will be used. Otherwise, it is HTTP GET.

Created on Jun 21, 2017 11:50:35 AM by  Arne Seifert [Paessler Support]



13 Replies

Votes:

0

Dear nogay_42

The HTTP Action does allow custom HTTP headers, so it canot send the content type "application/json". As a workaround, please perform this HTTP action via a powershell script which you can run as an Exe notification. This small snippet demonstrates how the HTTP action is done:

$postjson="{ "test_id": 1, "name": "A test" }"
Invoke-WebRequest -Uri http:/127.0.0.1:5051/api -Method POST -ContentType application/json -Body $postjson

Created on Jun 13, 2017 6:57:14 PM by  Arne Seifert [Paessler Support]



Votes:

0

Thanks Arne Seifert , I try to post via powershell is working but parameter $postjson="{"details":"testdata"}" give error like "Unexpexted token 'details':"testdata" } in expression or statement"

Created on Jun 14, 2017 5:54:48 AM



Votes:

0

Dear nogay_42

Our support for customization is limited, we are unable to going this through with you to debug this. It could be the case that you need to escape quotation marks, or use different quotation marks.

Created on Jun 14, 2017 11:00:55 AM by  Arne Seifert [Paessler Support]



Votes:

0

Thanks Arne Seifert, Maybe I have asked my question wrong. Ok. What Http methot does PRTG use for HTTP ACTİON. (GET,POST,DELETE). This can solve may problem. How to send parameter to url. I can design my Restful service for this.

Created on Jun 21, 2017 6:25:06 AM



Accepted Answer

Votes:

0

Dear nogay_42

If you enter any postdata, HTTP POST will be used. Otherwise, it is HTTP GET.

Created on Jun 21, 2017 11:50:35 AM by  Arne Seifert [Paessler Support]



Votes:

0

Thanks , I can send any data via PRTG by HTTP GET. But I have an new problem . Placaholders not working like below. %device is transmitted %device. No replace there

http://mydomain/prgt/signal.svc/signal?sender=ABABABA&test=Alert For device %device

Created on Jun 21, 2017 12:35:50 PM

Last change on Jun 22, 2017 11:59:57 AM by  Arne Seifert [Paessler Support]



Votes:

0

In this case, please update PRTG as the placeholders used in the postdata field should be resolved.

Created on Jun 21, 2017 1:06:39 PM by  Arne Seifert [Paessler Support]



Votes:

0

I don't understand . Where can I update placaholders. Is it not nececassry to use in URL query string. like %device,%message etc..

Created on Jun 21, 2017 2:01:50 PM



Votes:

0

Dear nogay_42

I am sorry, I am lost now. Do you use the postdata field at all?

Created on Jun 21, 2017 2:41:26 PM by  Arne Seifert [Paessler Support]



Votes:

0

No. I don't use postdata field. I use only Url field like http://mydomain/prgt/signal.svc/signal?test=%device , But %device not replaced by any device name. This field came to my server like '%device'. There is no replace on placeholder.

Created on Jun 22, 2017 8:10:33 AM



Votes:

0

Dear nogay_42

Please let me know, if /prgt/ is correct (instead of /prtg/). Please also let me know if you test the HTTP action via the "Test" button of the notification, or via an (simulated) error?

Created on Jun 22, 2017 12:12:14 PM by  Arne Seifert [Paessler Support]



Votes:

0

Dear Arne Seifert, /prgt is correct. I have written mistake :) But web service works well. I use Test button of notification.

Created on Jun 22, 2017 2:31:57 PM



Votes:

0

Dear nogay_42

With the test button, there is no triggering device, hence the unresolved placeholder. You can test it with putting the notification on a sensor, and then use the context drop down menu to simulate an error in order to trigger the notification.

Created on Jun 23, 2017 1:58:28 PM by  Arne Seifert [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.