Skip to main content

Convert arbitrary json alerts to Alert Manager alerts

Project description

PyConvertAlert

PyConvertAlert makes it easy to take an arbitrary alert from some kind of alerting system (Uptime Robot, Rackspace Intelligence) and convert it into an Alert Manager (Prometheus) alert.

Getting Started

The latest stable release is available from PyPi:

pip install pyconvertalert

Otherwise you can install from git:

pip install git+https://github.com/jpavlav/PyConvertAlert

Usage

>>> from pyconvertalert import Converter
>>>
>>> test_lookup_dict_1 = {
...     "values": [
...         {
...             "people": [
...                 {
...                     "email": "jim@jim.com",
...                     "phone": "111-111-1111"
...                 }
...             ]
...         }
...     ]
... }
>>>
>>>
>>> test_mapper_dict_1 = {
...     "labels": {
...         "email_address": "email",
...         "phone_number": "phone"
...     }
... }
>>> convert = Converter(mapper=test_mapper_dict_1)
>>> convert.convert_it(test_lookup_dict_1)
>>> {'labels': {'email_address': 'jim@jim.com', 'phone_number': '111-111-1111'}}

Running the tests

Should be as simple as:

python -m unittest test_py_convert_alert.py

Built With

Authors

  • Justin Palmer - Urrverything - Me

Acknowledgments

  • Kenneth Reitz -> setup - Thanks!
  • Kamori -> Cool Guy - Thanks to you as well!

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

pyconvertalert-0.1.0.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

pyconvertalert-0.1.0-py2.py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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