Go to All Forums

RabbitMQ plugin for multiple queues

Hello, I'm looking for a plugin that will monitor multiple rabbitmq queues which I can select. I have installed a rabbit plugin that can monitor messages in ALL queues, and this one www.site24x7.com/community/rabbitmq-single-queue-message-totalswhich seems to monitor messages in one specific queue, but is there a plugin that allows me to pick which queues I want to monitor, be it 1 or more? 

Thank you.

Like (2) Reply
Replies (8)

Re: RabbitMQ plugin for multiple queues

Hi John,

We have a plugin to monitor the individual queues of RabbitMQ. Please download this plugin from github.

  • Download and install the latest version of the Site24x7 Linux agent in the server where you plan to run the plugin. If it is installed successfully, you will see a Linux server monitor in the Site24x7 Control Panel. This confirms that the agent is able to communicate with our data center.
  • Download the rabbitmq_per_queue.py file from our GitHub repository
  • By default, the plugin will use the status url http://localhost:15672/ to fetch the performance metrics. To change the existing configuration, edit the '#Config Section' in the 'rabbitmq_per_queue.py' file
    #Config Section:
    RABBITMQ_HOST='localhost'
    RABBITMQ_PORT="15672"
    RABBITMQ_USERNAME='guest'
    RABBITMQ_PASSWORD='guest'
    QUEUE_NAME='Test Queue'
    VHOST_NAME="/"
  • Create a folder with the name "rabbitmq_per_queue", under the Site24x7 Linux agent plugin directory '/opt/site24x7/monagent/plugins/' and place the 'rabbitmq_per_queue.py' under '/opt/site24x7/monagent/plugins/rabbitmq_per_queue/'

The agent will automatically execute the plugin within five minutes and send performance data to the Site24x7 data center.

PS: Let us know more about your IT environment by participating in our survey. 

 

Regards,

Anita

Like (0) Reply

Re: Re: RabbitMQ plugin for multiple queues

Hi John,

We have enabled the support for multiple configuration support for rabbitmq_per_queue plugin.

Download the rabbitmq_per_queue.py and rabbitmq_per_queue.cfg files from our GitHub repository.

 
By default, we have configured localhost configuration for a Test Queue in the cfg file. Add/Edit appropriate configurations in the file. The server agent will execute the plugin with each set of configurations and add the plugin monitors in the web client.
 
Hope this helps
 
Regards,
Anita
Like (0) Reply

Re: Re: Re: RabbitMQ plugin for multiple queues

Hi Anita,

This is great, thank you. I've installed the plugin and configured the config file to be as:

[localhost]
hostname="localhost"
port=15672
username="administrator"
password=<my password>
vhost="MyHost"
queue_name="MyQueue"
realm=None
plugin_version=1
heartbeat=True

but am getting 

{
"heartbeat_required": true,
"msg": "HTTP Error 401: Unauthorized",
"plugin_version": 1,
"status": 0,
"units": {
"disk_free_limit": "MB",
"mem_used": "MB"
}
}

 

when I try to run it via command line. I also don't see the monitor in my site 24x7 dash.

I'm using the username/password I use to login to rabbit mq. Is that correct?  I'm using the same username/password as I use for the original rabbitmq.py plugin which works, but the same doesn't seem to work on this new plugin.

Thanks.

Like (0) Reply

Re: Re: Re: Re: RabbitMQ plugin for multiple queues

Hi John,

HTTP 401 Unauthorized client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. 

Is there any proxy used or any realm configured for this request? Also, please check if the URL is accessible in curl and browser. 

Curl request:

curl --user "username:pwd"http://<hostname>:<port>/api/queues/<vhost_name>/<queue_name> 

Browser request:

http://<hostname>:<port>/api/queues/<vhost_name>/<queue_name> 

Fill the prompt with username and password.

Please let us know the result of this, to help us debug the issue.

 

Regards,

Anita

Like (0) Reply

Re: Re: Re: Re: Re: RabbitMQ plugin for multiple queues

Hi Anita,

The curl command worked fine. No realm is set and no proxy. The result is:

{{ "consumer_details": [], "incoming": [], "deliveries": [], "messages_details": { "rate": 0.0 }, "messages": 0, "messages_unacknowledged_details": { "rate": 0.0 }, "messages_unacknowledged": 0, "messages_ready_details": { "rate": 0.0 }, "messages_ready": 0, "reductions_details": { "rate": 0.0 }, "reductions": 791389, "node": "rabbit@VA-PhxRab1", "arguments": {}, "exclusive": false, "auto_delete": false, "durable": true, "vhost": "Sales-Vouchers", "name": "VoucherDomainEvent", "message_bytes_paged_out": 0, "messages_paged_out": 0, "backing_queue_status": { "mode": "default", "q1": 0, "q2": 0, "delta": ["delta", "undefined", 0, 0, "undefined"], "q3": 0, "q4": 0, "len": 0, "target_ram_count": "infinity", "next_seq_id": 0, "avg_ingress_rate": 0.0, "avg_egress_rate": 0.0, "avg_ack_ingress_rate": 0.0, "avg_ack_egress_rate": 0.0 }, "head_message_timestamp": null, "message_bytes_persistent": 0, "message_bytes_ram": 0, "message_bytes_unacknowledged": 0, "message_bytes_ready": 0, "message_bytes": 0, "messages_persistent": 0, "messages_unacknowledged_ram": 0, "messages_ready_ram": 0, "messages_ram": 0, "garbage_collection": { "minor_gcs": 2934, "fullsweep_after": 65535, "min_heap_size": 233, "min_bin_vheap_size": 46422 }, "state": "running", "recoverable_slaves": null, "memory": 68096, "consumer_utilisation": null, "consumers": 0, "exclusive_consumer_tag": null, "policy": null}

Like (0) Reply

Re: Re: Re: Re: Re: Re: RabbitMQ plugin for multiple queues

Also, just to add, we have the original rabbit mq plugin installed and each is installed in their own directory:

 

ls -l /opt/site24x7/monagent/plugins/

drwxr-xr-x 2 root root 4096 Nov 2 16:02 rabbitmq
drwxr-xr-x 2 root root 4096 Feb 19 13:13 rabbitmq_per_queue
Like (0) Reply

Re: Re: Re: Re: Re: Re: Re: RabbitMQ plugin for multiple queues

Hi John

Can you please execute the below python commands and let us know the output in both the cases.

python rabbitmq_per_queue.py --hostname="localhost" --port=15672 --username="administrator" --password="<mypassword>" --vhost="MyHost" --queue_name="MyQueue"

python rabbitmq_per_queue.py --hostname="localhost" --port=15672 --username="administrator" --password="<mypassword>" --vhost="MyHost" --queue_name="MyQueue" --realm=None

If none of the commands works, please drop a mail to support@site24x7.com to let us help you better.

 

Regards,

Anita

Like (0) Reply

Re: Re: Re: Re: Re: Re: Re: Re: RabbitMQ plugin for multiple queues

Hi Anita,

The first command seemed to work. The output is 

{
"ack.rate": 0.0,
"consumers": 0,
"deliver.rate": 0.0,
"heartbeat_required": true,
"messages": 126,
"messages.persistent": 126,
"messages.rate": 0.0,
"messages.ready": 126,
"messages.ready.rate": 0.0,
"messages.unack": 0,
"messages.unack.rate": 0.0,
"plugin_version": 1,
"publish.rate": 0.0,
"units": {
"disk_free_limit": "MB",
"mem_used": "MB"
}
}

 

the second command resulted in

 

{
"heartbeat_required": true,
"msg": "HTTP Error 401: Unauthorized",
"plugin_version": 1,
"status": 0,
"units": {
"disk_free_limit": "MB",
"mem_used": "MB"
}
}

Like (0) Reply

Was this post helpful?