0
0
mirror of https://github.com/alerta/alerta-contrib.git synced 2024-12-12 07:27:34 +00:00
alerta_alerta-contrib/integrations/consul
2023-03-21 00:15:34 +01:00
..
consulalerta.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00
consulheartbeat.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00
README.md Update READMEs 2020-11-20 22:39:32 +01:00
setup.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00

Consul Integration

Send alerts based on consul. health checks, triggered by consul-alerts

For help, join Slack chat

Prerequisites

Consul and consul-alerts is installed and running.

Installation

$ pip install python-consul alerta --upgrade
copy script to somewhere accessible by consul-alerts, make sure its executable

Clone the GitHub repo and run:

$ python setup.py install

Or, to install remotely from GitHub run:

$ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=integrations/consul

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 (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)
    alerta/defaultenv:Production // default alert environment (optional - default Production)
    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)

References

License

Copyright (c) 2016 Marco Supino. Available under the MIT License.