0
0
Fork 0
mirror of https://github.com/alerta/alerta-contrib.git synced 2025-03-16 21:43:30 +00:00
alerta_alerta-contrib/plugins/amqp
Yann Cézard edf6326f60
Fix boolean env variable (#290)
* Correct handling of boolean env var.

* Use PluginBase get_config to do thye job.
2020-02-25 23:04:15 +01:00
..
alerta_amqp.py Fix boolean env variable (#290) 2020-02-25 23:04:15 +01:00
listener.py Add test amqp listener 2017-11-15 23:12:06 +00:00
README.md Fix RabbitMQ default port 2019-01-08 21:46:02 +01:00
setup.py Publish utc-aware datetimes in AMQP plugin 2017-10-27 03:57:11 +03:00

AMQP Publisher Plugin

Publish alerts to an AMQP topic.

For help, join Gitter chat

Installation

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=plugins/amqp

Note: If Alerta is installed in a python virtual environment then plugins need to be installed into the same environment for Alerta to dynamically discover them.

Configuration

Add amqp 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 = ['amqp']
AMQP_URL = 'mongodb://localhost:27017/kombu'
AMQP_TOPIC = 'notify'

Note: By default the AMQP plugin is configured to use MongoDB as the AMQP transport so it is not necessary to install RabbitMQ or some other messaging backbone to make use of this plugin.

RabbitMQ Example

PLUGINS = ['reject','amqp']
AMQP_URL = 'amqp://login:password@server:port//'  # => default RabbitMQ port=5672
AMQP_TOPIC = 'alerta.notify'

Troubleshooting

Restart Alerta API and confirm that the plugin has been loaded and enabled.

Set DEBUG=True in the alertad.conf configuration file and look for log entries similar to below:

--------------------------------------------------------------------------------
INFO in alerta_amqp [/opt/alerta/venv/lib/python2.7/site-packages/alerta_amqp-0.2.0-py2.7.egg/alerta_amqp.py:47]:
Sending message 07a5c93d-c5a5-4758-916c-ecec2c42181b to AMQP topic "alerta.notify"
--------------------------------------------------------------------------------
Sending message 07a5c93d-c5a5-4758-916c-ecec2c42181b to AMQP topic "alerta.notify"

References

License

Copyright (c) 2016 Nick Satterly. Available under the MIT License.