Skip to content

xmatters/xm-labs-consul

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consul

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



Files

How it works

The step is triggered by a watch in Consul. This watch finds if certain checks are critical in Consul.

Installation

Consul Setup

  1. 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.

  1. 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.

xMatters Setup

  1. Download the Consul.zip file onto your local computer
  2. Navigate to the Workflows tab of your xMatters instance
  3. Click Import, and select the zip file you just downloaded
  4. Fill in the recipients in the xMatters Create Event step
  5. Get the HTTP Trigger URL and put it in the script that the watch in Consul runs.

Usage

The Inbound from Consul HTTP trigger will output the message sent from the script in Consul. This is sent into an xMatters Event.

Troubleshooting

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published