alerta-contrib/integrations/consul/README.md

58 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2016-12-10 14:17:19 +00:00
Consul Integration
2016-12-10 09:04:53 +00:00
==================
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
Send alerts based on [consul](https://www.consul.io/). health checks,
triggered by [consul-alerts](https://github.com/AcalephStorage/consul-alerts)
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
For help, join [![Gitter chat](https://badges.gitter.im/alerta/chat.png)](https://gitter.im/alerta/chat)
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
Prerequisites
-------------
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
Consul and [consul-alerts](https://github.com/AcalephStorage/consul-alerts)
is installed and running.
2016-06-09 09:55:13 +00:00
Installation
------------
2017-02-19 10:33:24 +02:00
$ pip install python-consul alerta --upgrade
2016-06-09 09:55:13 +00:00
copy script to somewhere accessible by consul-alerts, make sure its executable
2016-12-10 09:04:53 +00:00
Clone the GitHub repo and run:
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
$ python setup.py install
Or, to install remotely from GitHub run:
2016-06-09 09:55:13 +00:00
2017-02-19 11:32:51 +02:00
$ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=integrations/consul
Configuration
-------------
Define these keys in consul KV store:
2016-06-09 09:55:13 +00:00
consul-alerts/config/notifiers/custom/alerta:<path>/consul-alerta.py
2017-02-19 10:33:24 +02:00
alerta/apikey:'api-key' // alerta key for api access (MUST)
alerta/apiurl:'api-url' // alerta api url (MUST)
alerta/timeout:900 // alarm timeout in alerta (default 900)
alerta/max_retries:3 // max api call attemps (default 3)
alerta/sleep:2 // sleep between attemps (default 2)
alerta/origin:consul // alert origin (default consul)
2017-02-19 11:27:42 +02:00
alerta/defaultenv:Production // default alert environment (optional - default Production)
2017-02-19 10:33:24 +02:00
alerta/env/{hostname}:Testing // exceptions for env of specific nodes (optional)
alerta/alerttype:ConsulAlerts // alert type (default ConsulAlerts)
consul-alerts/config/notif-profiles/default: { "Interval": 10 } // will keep active alerts "open" in alerta, before timeout removes them (must)
2016-06-10 12:27:04 +00:00
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
References
----------
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
* https://www.consul.io/
* https://github.com/hashicorp/consul
* https://github.com/AcalephStorage/consul-alerts
2016-06-10 12:27:04 +00:00
2016-12-10 09:04:53 +00:00
License
-------
2016-06-09 09:55:13 +00:00
2016-12-10 09:04:53 +00:00
Copyright (c) 2016 Marco Supino. Available under the MIT License.