This integration lets you alert users in xMatters when there is a critical check in Consul.

- Consul.zip - Workflow zip file with the step and example flow
- consul.png - Consul logo
The step is triggered by a watch in Consul. This watch finds if certain checks are critical in Consul.
- Create a Watch in Consul. This is an example.
{
"watches": [{
"type": "checks",
"state": "critical",
"args": ["/bin/bash", "/home/user/watch.sh"]
}]
}
Updating the state
changes at which level it searches for checks.
In the args, point it to a script that will call xMatters with a payload.
- Create a script for the watch Here is an example for a script
OUTPUT=$(curl -G localhost:8500/v1/agent/checks --data-urlencode 'filter=Status != passing')
curl -X POST -H "Content-Type: application/json" -d "$OUTPUT" "https://instance.xmatters.com/api/integration/1/functions/UUID/triggers?apiKey=KEY"
The filter on the OUTPUT
variable can be adjusted to change the sensitivity.
Make sure to change the URL on the curl request to point at your http trigger in xMatters.
- Download the Consul.zip file onto your local computer
- Navigate to the Workflows tab of your xMatters instance
- Click Import, and select the zip file you just downloaded
- Fill in the recipients in the
xMatters Create Event
step - Get the HTTP Trigger URL and put it in the script that the watch in Consul runs.
The Inbound from Consul HTTP trigger will output the message sent from the script in Consul. This is sent into an xMatters Event.
See if inside the Consul log it is sending requests to xMatters. These should look like: {"requestId":"ID HERE"}
Look in the Activity Log in xMatters to see if the steps are being run and succeeding.