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 (3) Reply
Replies (14)

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

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

Hi John,

Please remove the option realm=None from the rabbitmq_per_queue.cfg file and see if the plugin works. If the plugin is in ignored state, remove the file ignored_plugins.txt from /opt/site24x7/monagent/temp folder. 

The problem was instead of passing null value to the plugin, the null string is being passed. Will fix the issue and update the plugin in the github.

Thank you

Anita

Like (0) Reply

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

hi Anita,

Unfortunately, still getting:

site24x7/monagent/plugins/rabbitmq_per_queue# ./rabbitmq_per_queue.py
{
"heartbeat_required": true,
"msg": "HTTP Error 401: Unauthorized",
"plugin_version": 1,
"status": 0,
"units": {
"disk_free_limit": "MB",
"mem_used": "MB"
}
}

Like (0) Reply

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

Hi Anita,

I started debugging the script myself and it appears the issue is that it's not getting the values from the config file. For instance, I put a print in this part:

if input_data['username'] and input_data['password']:
print 'this is username ', input_data['username']
password_mgr = connector.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(input_data['realm'], URL, input_data['username'], input_data['password'])
auth_handler = connector.HTTPBasicAuthHandler(password_mgr)
opener = connector.build_opener(auth_handler)
connector.install_opener(opener)

and it is printing "guest" rather than "administrator" which is what is filled out in the config file. Is this something that could be fixed asap? Thank you.

Like (0) Reply

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

Hi John,

The default value is set as guest. Seems like the configuration data is not being passed properly. Can you please raise this as a ticket in support@site24x7.com and from there we can have a screen share session to resolve the issue.

Thanks

Anita

Like (0) Reply

Re:

Hi Anita,

I inform you that I made the settings for the plugins and added a configuration to my queues in the .cfg file.

Successful queues are appearing correctly on the website 24x7.

Now I am having trouble configuring alerts by quantity of messages in the queues when I perform the configuration in an alert these settings go to all configured queues.

I would like to set up alerts by quantity of messages in each queue.
Like (0) Reply

Re: Re:

Hi Marcos,

All the plugin monitors of the same template will be configured with a threshold profile '<Template name> - Default Threshold'. If you configure the threshold for messages in that threshold, it will be applied to all the plugins associated to the default threshold profile. In your case, for all the rabbitmq_per_queue plugins. 

To configure, different threshold profiles with different values for each queue, you can create new profiles for the required monitors and associate those profiles in the edit monitor page. When the specified value configured in the threshold associated to the monitor is breached, appropriate alerting will be triggered.

Steps to create new threshold profile:

  1. Log in to Site24x7.
  2. Go to Server > Plugin Integrations > click on the plugin for which you want to create a profile.
  3. Hover on the hamburger icon beside the monitor display name. Click Edit.
  4. In the Edit Monitor page, scroll down to Configuration Profiles and click on the (+) icon beside Threshold and Availability.
  5. Provide a name to the threshold profile. Configure the desired values and Save your changes.

Hope this helps. Let us know for further queries, if any, in the below thread.

 

Regards,

Anita

Like (0) Reply

Was this post helpful?