KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Proper format for HTTP POST body

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
tstarr



Joined: 16 Sep 2019
Posts: 4

PostPosted: Tue Sep 17, 2019 7:25 am    Post subject: Proper format for HTTP POST body Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12793
Location: USA

PostPosted: Tue Sep 17, 2019 9:01 am    Post subject: Reply with quote

Version 9.10 is very old and does not support HTTPS protocol for this action (only HTTP)

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
tstarr



Joined: 16 Sep 2019
Posts: 4

PostPosted: Tue Sep 17, 2019 11:25 am    Post subject: Reply with quote

Ha, there's always something. Thanks for your help, will likely be upgrading.
Back to top
View user's profile Send private message
tstarr



Joined: 16 Sep 2019
Posts: 4

PostPosted: Tue Sep 17, 2019 3:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12793
Location: USA

PostPosted: Wed Sep 18, 2019 10:09 am    Post subject: Reply with quote

What result/error do you see in the log?

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
tstarr



Joined: 16 Sep 2019
Posts: 4

PostPosted: Wed Sep 18, 2019 12:44 pm    Post subject: Reply with quote

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">&nbsp;<!--KSIM--><!--KSFD-18092019004720-->9/18/2019 12:47:20 AM<!--KSIM-->&nbsp;</td>
<td align="left">&nbsp;<!--KSIM-->Test Failure<!--TI3692--><!--KSIM-->&nbsp;</td>
<td align="left">&nbsp;<!--KSIM-->Bad<!--KSIM-->&nbsp;</td>
<td align="center">&nbsp;<!--KSIM-->6.85895538330078<!--KSIM-->&nbsp;</td>
<td align="left">&nbsp;<!--KSIM-->[db name]<!--KSIM-->&nbsp;</td>
</tr>
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12793
Location: USA

PostPosted: Wed Sep 18, 2019 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index