Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alerta-blackout-regex-2.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alerta_blackout_regex-2.0.0-py2.py3-none-any.whl (10.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file alerta-blackout-regex-2.0.0.tar.gz.

File metadata

  • Download URL: alerta-blackout-regex-2.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for alerta-blackout-regex-2.0.0.tar.gz
Algorithm Hash digest
SHA256 31e94ff018ad39d125d44a2f77d0bf19eded8f3e560fcebc24158c870676a763
MD5 0e5a186cc3be668a6b34a15ae0289f68
BLAKE2b-256 142e887a4eb21b2ad80a0e958f13424991cc46fc997e344588cac6c9fb1ec022

See more details on using hashes here.

File details

Details for the file alerta_blackout_regex-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: alerta_blackout_regex-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for alerta_blackout_regex-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 77c91b7d4cc912000a41b9d9affe5c8545931999be62c99972ef0b6c2f715b7b
MD5 979d9201496bf2b9c78061ae09d32475
BLAKE2b-256 723f0d3fe40fccc84599857a77b9eecccc08c130c9394054630d91d3e68a269a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page