Erlang Mailing Lists

Author Message

<  RabbitMQ mailing list  ~  Monitoring queue size via Nagios

Guest
Posted: Thu Oct 29, 2009 11:56 am Reply with quote
Guest
I was searching for a Nagios plugin to monitor RabbitMQ, and only found an unanswered question to this mailing list of how it could be done.

I wanted to share the Ruby code I wrote for monitoring queue size. A next step for monitoring is to connect directly to the queue with the Bunny gem and make sure it is accepting connections.

#########

#!/usr/bin/ruby

VERSION_STRING = "Cloudspace RabbitMQ queue size checker v1.0 2009-10-20"


require 'optparse'

options = { :warning => 0, :critical => 0 }

OptionParser.new do |opts|
Guest
Posted: Thu Oct 29, 2009 12:05 pm Reply with quote
Guest
Tim,

Tim Rosenblatt wrote:
> output = `sudo rabbitmqctl list_queues`
> queue_sizes = output.scan(/\d+/)

You may want to supply the '-q' option to rabbitmqctl in order to
suppress the output of information messages ("Listing queues ..." ,
"...done", etc).


Regards,

Matthias.

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Thu Oct 29, 2009 12:10 pm Reply with quote
Guest
Yep! Good addition.

Also to note: you will probably have to configure sudoers to allow nagios to run rabbitmqctl without prompting for a password. Use the following line

nagios
Guest
Posted: Thu Oct 29, 2009 12:42 pm Reply with quote
Guest
On Oct 29, 2009, at 1:09 PM, Tim Rosenblatt wrote:

> Yep! Good addition.
>
> Also to note: you will probably have to configure sudoers to allow
> nagios to run rabbitmqctl without prompting for a password. Use the
> following line
>
> nagios ALL=(ALL) NOPASSWD: /usr/sbin/
> rabbitmqctl
>


Cool, I didn't know about -q.

You can even restrict it to specific rabbitmqctl subcommands, for my
munin plugins[1] I use:

munin ALL= NOPASSWD: /usr/sbin/rabbitmqctl list_queues *
munin ALL= NOPASSWD: /usr/sbin/rabbitmqctl list_connections

This way you don't give it access to stop, reset etc.


[1]: http://github.com/ask/rabbitmq-munin

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
timrila
Posted: Thu Jun 07, 2012 9:53 am Reply with quote
User Joined: 28 Mar 2012 Posts: 32
Interesting information. they are so useful! thank you for making it and thank you for sharing!
Soccer Jerseys
Soccer Jerseys
Spain Soccer Jersey
Portugal Soccer Jersey
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum