2016-06-09 09:55:13 +00:00
|
|
|
Consul
|
|
|
|
==========
|
|
|
|
|
2016-06-09 09:57:07 +00:00
|
|
|
Trigger alerts based on [consul][1]. health checks, triggered by [consul-alerts][2]
|
2016-06-09 09:55:13 +00:00
|
|
|
|
|
|
|
Requirements:
|
2016-06-09 10:02:32 +00:00
|
|
|
==========
|
2016-06-09 09:55:13 +00:00
|
|
|
|
2016-06-09 09:57:07 +00:00
|
|
|
consul
|
|
|
|
consul-alerts
|
2016-06-10 12:27:04 +00:00
|
|
|
python-consul
|
|
|
|
alerta
|
2016-06-09 09:55:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
2016-06-10 12:27:04 +00:00
|
|
|
$ pip install python-consul
|
|
|
|
$ pip install alerta
|
2016-06-09 09:55:13 +00:00
|
|
|
copy script to somewhere accessible by consul-alerts, make sure its executable
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
|
|
|
|
define these keys in consul KV store:
|
|
|
|
|
|
|
|
consul-alerts/config/notifiers/custom/alerta:<path>/consul-alerta.py
|
|
|
|
alerta/apikey:'api-key' // alerta key for api access
|
|
|
|
alerta/apiurl:'api-url' // alerta api url
|
2016-06-10 12:27:04 +00:00
|
|
|
alerta/timeout:900 // alarm timeout in alerta (default 86400)
|
|
|
|
alerta/max_retries:3 // max api call attemps
|
2016-06-09 09:55:13 +00:00
|
|
|
alerta/sleep:2 // sleep between attemps
|
|
|
|
alerta/origin:consul // alert origin
|
2016-08-23 06:19:48 +00:00
|
|
|
alerta/defaultenv:Production // default alert environment
|
|
|
|
alerta/env/{hostname}:Testing // exceptions for env of specific nodes
|
2016-06-09 09:55:13 +00:00
|
|
|
alerta/alerttype:ConsulAlerts // alert type
|
2016-06-10 12:27:04 +00:00
|
|
|
consul-alerts/config/notif-profiles/default: { "Interval": 10 } // will keep active alerts "open" in alerta, before timeout removes them
|
|
|
|
|
2016-06-09 09:55:13 +00:00
|
|
|
|
|
|
|
[1]: <https://github.com/hashicorp/consul> "Consul"
|
|
|
|
[2]: <https://github.com/AcalephStorage/consul-alerts> "Consul-Alerts"
|