HTTP request action: some verbs 2xx, others 401

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
treyrees
Posts: 3
Joined: Tue Mar 31, 2020 7:03 am

HTTP request action: some verbs 2xx, others 401

Post by treyrees »

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.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

HostMonitor version?

Regards
Alex
treyrees
Posts: 3
Joined: Tue Mar 31, 2020 7:03 am

Post by treyrees »

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

Regards
Alex[/quote]

11.32.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Too old.
You need 11.96 or newer

Regards
Alex
treyrees
Posts: 3
Joined: Tue Mar 31, 2020 7:03 am

Post by treyrees »

[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.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
Post Reply