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

HTTP request action: some verbs 2xx, others 401

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



Joined: 31 Mar 2020
Posts: 3

PostPosted: Tue Mar 31, 2020 10:18 am    Post subject: HTTP request action: some verbs 2xx, others 401 Reply with quote

I am trying to use an HTTP request in an action profile to update components on our Statuspage. The request Statuspage asks for looks like this:

PUT /v1/pages/{pageId}/components/{componentId} HTTP/1.1
Host: api.statuspage.io
Authorization: {apiKey}
Content-Type: application/json

{
"component": {
"status": "operational"
}
}

This request has only returned 401. However, it should not, because the same request with the same authorization returns 2xx when ran outside the network HostMonitor is running in (when ran by Postman, PowerShell script). In addition, HostMonitor can request GET and POST (again, same authorization) and receive a 2xx. I have found that it is PUT and DELETE requests that return 401. Both of these facts tell me it is not an authorization problem, but rather, some verbs are being filtered/blocked and some are not.

Any help with this issue would be appreciated.
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12792
Location: USA

PostPosted: Tue Mar 31, 2020 11:23 am    Post subject: Reply with quote

HostMonitor version?

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



Joined: 31 Mar 2020
Posts: 3

PostPosted: Tue Mar 31, 2020 11:45 am    Post subject: Reply with quote

[quote="KS-Soft"]HostMonitor version?

Regards
Alex[/quote]

11.32.
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12792
Location: USA

PostPosted: Tue Mar 31, 2020 11:48 am    Post subject: Reply with quote

Too old.
You need 11.96 or newer

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



Joined: 31 Mar 2020
Posts: 3

PostPosted: Tue Mar 31, 2020 11:57 am    Post subject: Reply with quote

[quote="KS-Soft"]Too old.
You need 11.96 or newer

Regards
Alex[/quote]

Would using a script that calls the Invoke-RestMethod cmdlet be a viable workaround?

Thank you.
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12792
Location: USA

PostPosted: Tue Mar 31, 2020 1:11 pm    Post subject: Reply with quote

Yes, you may start external scripts using "Execute external program" action.
(external tests/actions uses more system resources but if you don't need to start this action 10 times/sec then its Ok)

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