Alerta Blackout enhancement plugin
Project description
Alerta plugin to enhance the blackout management, by matching the alerts against blackouts with PCRE (Perl Compatible Regular Expression) on attributes.
A blackout is considered matched when all its attributes are matched.
Once an alert is identified as matching a blackout, a special label is applied, with the format: regex_blackout=<blackout id>, where blackout id is the ID of the matched blackout, e.g., regex_blackout=d8ba1d3b-dbfd-4677-ab00-e7f8469d7ad3. This way, when the alert is fired again, there’s no need to verify the matching again, but simply verify whether the blackout referenced is still active.
Installation
This plugin is designed to be installed on the Alerta server; the package is available on PyPI so you can install as:
pip install alerta-blackout-regex
Configuration
Add blackout_regex to the list of enabled PLUGINS in alertad.conf server configuration file and set plugin-specific variables either in the server configuration file or as environment variables.
PLUGINS = ['blackout_regex']
To model the caching behaviour, from version 2.0.0 onwards, you can set the following environment variables:
ALERTA_BLACKOUT_CACHE_ENABLED - boolean value, by default True; values that equally provide the True logical value: "True", "true", "1", 1.
ALERTA_BLACKOUT_CACHE_FILE - the location where to cache the blackouts into a file. By default: /var/cache/alerta/blackout_regex. Alerta needs writing access to that directory (or at least rights to be able to create the directory), otherwise it’ll raise an error; the plugin can go ahead with it, but then it won’t be able to cache the Blackouts which may result in an increased workload on your Alerta API.
ALERTA_BLACKOUT_CACHE_TIME - the amount of time to cache the Blackouts for, in seconds. The default value is 60 seconds.
References
License
Copyright (c) 2020-2021 Mircea Ulinic. Available under the Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for alerta-blackout-regex-2.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91dc11cc6e040842622e8aaa39e64d5d976890bc732dc8be2e6ef24e9c1a3925 |
|
MD5 | 69b0e712d9c360afc10a88e6d8be5598 |
|
BLAKE2b-256 | 94ee0ed56cd11e7d34093ddedac11be45de77689f13f2fc10e74f864cca3a961 |
Hashes for alerta_blackout_regex-2.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f41efc19bf89ed06110edac31bdc0321d6d942f882b09456956865d11f4d83d2 |
|
MD5 | 17fed44d22bc775743c67d27be4e9d3d |
|
BLAKE2b-256 | 9f41f10f3c5d8e047571da02e741b10268495f5f878f161e1fd9690fa6a71c4c |