Monitoring RabbitMQ Federation links using API
search cancel

Monitoring RabbitMQ Federation links using API

book

Article ID: 293168

calendar_today

Updated On:

Products

VMware RabbitMQ

Issue/Introduction

Are there other ways to monitor RabbitMQ Federation links without using UI?

Resolution

You can monitor a lot of RabbitMQ components using the Management UI including Federation links but what we all know is that it won't be practical to stare at the UI all the time. If you have external monitoring tools then you probably need to use this but if you don't have one this will come in handy. This article assumes default port 15672 is in use.

API calls documentation, this comes with your RabbitMQ installation. You can access this using:
http://<node-ip:15672>/api 
The documentation on the link above does not include full list of plugin's API.

You can monitor Federation links using the following APIs. You can also integrate this to your custom script where you can integrate this with your own notification tool.

List all Federation links on node:
http://<node-ip>:15672/api/federation-links

List all Federation links on a specified vhost on node:
http://<node-ip>:15672/api/federation-links/<vhost>

List for all Federation links that have the current state that is not running:
http://<node-ip>:15672/api/federation-links/state/down

List for all Federation links that have the current state that is not running on a specified vhost:
http://<node-ip>:15672/api/federation-links/<vhost>/state/down

Restart Federation link based on vhost, federation link id, and node name. The node name needs to be url encoded if it contains special characters:
http://<node-ip>:15672/api/federation-links/vhost/<vhost>/<federation-link-id>/<node-name>/restart