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
- Python3 - Beautiful language.
Authors
- Justin Palmer - Urrverything - Me
Acknowledgments
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
pyconvertalert-0.1.0.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for pyconvertalert-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc7918ec53235d93c4016c7e57e6199cb4a99940548e0b87f98abf43d2684535 |
|
MD5 | 95a655d7799a31edba05cb28bb70716b |
|
BLAKE2b-256 | e98800e2fec2bbddebc9e8ce9342eca9d92ff49206035cb74eaeb1ca04c5fefb |