Web Service Monitoring
Using the Web Request action we can request a response from a web server, evaluate the response, and the take action.
In this example we will check the A-Ops service, its HTTP response code along with the provided JSON status data that the API returns. In the event of failure we will trigger an email action.
Requirements
- System integration
Steps
- Add Trigger trigger object to the flow
- Edit the trigger, name it and define its schedule i.e. 60s
- Add Web Request action object
- Edit the action, name it, set the HTTP Method to
GET
, the URL tohttps://prod-eu-west-1.a-ops.cloud/api/1.0/status
, and a variable that will convert the response body to json for us to check later - Add Action object, name it, and define the logic to determine the service is up based on its json response
- Add Email object, name it, set SMTP server details, from, to, subject, and a message in the body
- Lastly, join the actions together taking note that we can use link logic ( pink line ) to define an expected status code. In this case when it is not 200 then we will instantly send the email and not check the json response