Send notifications when predefined conditions are met.
- Ready messages
- Unacknowledged messages
- Total queued messages
- Number of connected consumers
- Number of open connections
- Number of nodes running
- Memory used by each node in MBs
Currently the following are supported:
- E-mails
- Slack messages
- Telegram messages
Use the PIP
command, which should already exist in your Linux installation:
sudo pip install rabbitmq-alert
Copy the example configuration file to the default path of the global configuration file:
sudo cp /etc/rabbitmq-alert/config.ini.example /etc/rabbitmq-alert/config.ini
rabbitmq-alert
sudo rabbitmq-alert
rabbitmq-alert
along using the provided options,
but first take a look at --help
to see whats availableExample:
sudo rabbitmq-alert \ --host=my-server --port=55672 --username=guest --password=guest \ --vhost=%2F --queue=my_queue1,my_queue2 --ready-queue-size=3 --check-rate=300 \ [email protected] [email protected] \ --email-subject="RabbitMQ alert at %s - %s" --email-server=localhost
/etc/rabbitmq-alert/config.ini.example
file.Then execute rabbitmq-alert
with the configuration file option:
sudo rabbitmq-alert -c my_config.ini
systemd
script is created upon installation with PIP
.systemd
configurationrabbitmq-alert
as a daemon.sudo systemctl daemon-reload sudo systemctl start rabbitmq-alert
To have rabbitmq-alert
always started on boot:
sudo systemctl enable rabbitmq-alert
In case your system still uses init.d
, an init.d
script has been created
in /etc/init.d
upon PIP
installation. To start rabbitmq-alert
as a daemon:
sudo /etc/init.d/rabbitmq-alert start
To have rabbitmq-alert
always started on boot:
sudo update-rc.d rabbitmq-alert defaults
[Conditions]
section for each queue. Example:[Conditions:my-queue] ... [Conditions:my-other-queue] ...
Note that queue names also have to be defined in the [Server]
section of the configuration file:
[Server] ... queues=my-queue,my-other-queue ...
rabbitmq-alert
to /var/log/rabbitmq-alert/
.rabbitmq-alert
, which will then be copied into the container. Then you can runrabbitmq-alert
inside a container.docker run -d --name rabbitmq-alert -v config.ini:/etc/rabbitmq-alert/config.ini \ mylkoh/rabbitmq-alert:latest
For the configuration file, advise the config.ini.example
that exists in the project's repository.
rabbitmq-alert
is written in python2
.To start, you have to install the dev dependencies which are some required python packages:
make deps-dev
After writing your awesomeness, run the test suites to ensure that everything is still fine:
make test
Do add tests yourself for the code you contribute to ensure the quality of the project.
Happy coding :-)
To build a new image version of the project:
docker build --no-cache -t mylkoh/rabbitmq-alert:1.2.2 -t mylkoh/rabbitmq-alert:latest .
Publish the image:
docker push mylkoh/rabbitmq-alert
Create a network that all containers will belong to:
docker network create rabbitmq-alert
Run rabbitmq
into a container:
docker run -d --name some-rabbit --net rabbitmq-alert -p 8080:15672 rabbitmq:3-management
The username and password are both guest
. Create a fake SMTP server:
docker run -d --name fake-smtp --net rabbitmq-alert -p 25:25 munkyboy/fakesmtp
Now, run rabbitmq-alert
using the same network:
docker run -d --name rabbitmq-alert --net rabbitmq-alert \ -v config.ini:/etc/rabbitmq-alert/config.ini mylkoh/rabbitmq-alert:latest