View previous topic :: View next topic |
Author |
Message |
tstarr
Joined: 16 Sep 2019 Posts: 4
|
Posted: Tue Sep 17, 2019 7:25 am Post subject: Proper format for HTTP POST body |
|
|
Hello,
I'm trying to create an http request as an action after a "bad" result for an alarm. Specifically, using the service nexmo (https://developer.nexmo.com/messaging/sms/overview), though I don't think the service is the issue here.
I must be putting something in the wrong format for HostMonitor, as testing is successful doing a POST from outside the application.
HostMonitor version is v9.10
Host is https://rest.nexmo.com/sms/json
Port is 443 (for https)
Request is as follows:
POST https://rest.nexmo.com/sms/json
Host: rest.nexmo.com
Content-Type: application/json
{"from": "1[10 digit from number redacted here]",
"text": "A text Host Monitor message sent using the Nexmo",
"to": "1[10 digit to number redacted here]",
"api_key": "[8 character alphanumeric key redacted here]",
"api_secret": "[16 character alphanumeric secret redacted here]"}
Again, this format is successful in a post request outside the HostMonitor application. Does anyone have any thoughts as to what I'm doing wrong?
Appreciate any insights you can give. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Sep 17, 2019 9:01 am Post subject: |
|
|
Version 9.10 is very old and does not support HTTPS protocol for this action (only HTTP)
Regards
Alex |
|
Back to top |
|
|
tstarr
Joined: 16 Sep 2019 Posts: 4
|
Posted: Tue Sep 17, 2019 11:25 am Post subject: |
|
|
Ha, there's always something. Thanks for your help, will likely be upgrading. |
|
Back to top |
|
|
tstarr
Joined: 16 Sep 2019 Posts: 4
|
Posted: Tue Sep 17, 2019 3:00 pm Post subject: |
|
|
I'm going to be looking at this some more tomorrow, but I just finishing upgrading to v11.98 and it is still failing the POST. An email alert attached to that same test goes off fine, so I know it must be some quirk of the http request that's causing issues. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 18, 2019 10:09 am Post subject: |
|
|
What result/error do you see in the log?
Regards
Alex |
|
Back to top |
|
|
tstarr
Joined: 16 Sep 2019 Posts: 4
|
Posted: Wed Sep 18, 2019 12:44 pm Post subject: |
|
|
There don't appear to be any errors relating to the actions taken on test failure in the log. The failing of the test itself shows up as:
<tr class="bad">
<td align="center"> <!--KSIM--><!--KSFD-18092019004720-->9/18/2019 12:47:20 AM<!--KSIM--> </td>
<td align="left"> <!--KSIM-->Test Failure<!--TI3692--><!--KSIM--> </td>
<td align="left"> <!--KSIM-->Bad<!--KSIM--> </td>
<td align="center"> <!--KSIM-->6.85895538330078<!--KSIM--> </td>
<td align="left"> <!--KSIM-->[db name]<!--KSIM--> </td>
</tr> |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 18, 2019 2:08 pm Post subject: |
|
|
Wrong log file, you should check "system" log file (menu View->System Log)
or check Quick Log related to the test using Quick Log pane (menu View->QuickLog then use "Show action" popup menu item)
or check Quick Log using Test Info dialog (select and press Ctrl+I or use "Test info" popup menu item)
Regards
Alex |
|
Back to top |
|
|
|