technology from back to front

Introducing rabbitmq-status plugin

RabbitMQ is a becoming decent product, but it shares some of the common problems of young software - for example, beginners have a hard time understanding what happens under the hood. Don’t get me wrong, Rabbit generally works perfectly as a black-box. But at some point, when things go wrong or when Rabbit needs to be added to a monitoring infrastructure, it becomes necessary to understand more about the internals. This is when things get difficult.

I was wondering how we could address this issue and decided that Rabbit should serve a simple http status page similar to status pages that are known from Apache or Haproxy projects.

A picture is worth a thousand words, so here’s the screenshot of rabbitmq-server in action:

http://dev.lshift.net/majek/status-page.png

The status page shows memory, file descriptors and Erlang PIDS usage. You can also see basic information about connections and queues.

Installation

The installation is pretty straightforward. As with other RabbitMQ plugins, all you need to do is grab the compiled .ez binaries, put them in the correct place and then run the command: rabbitmq-activate-plugins.

Precompiled binaries are here (compiled using Erlang 5.6.3/R12B-3). They should work with RabbitMQ 1.7.0 and the latest default mercurial branch.

Step-by-step install instructions, checked on my Ubuntu Karmic box, follow:

wget http://dev.lshift.net/majek/rabbitmq-status_1.7.0.tar.gz
tar xvzf rabbitmq-status_1.7.0.tar.gz
sudo mkdir /usr/lib/rabbitmq/lib/rabbitmq_server-1.7.0/plugins
sudo mv rabbitmq-mochiweb.ez mochiweb.ez rabbit_status.ez \
           /usr/lib/rabbitmq/lib/rabbitmq_server-1.7.0/plugins
sudo rabbitmq-activate-plugins
sudo /etc/init.d/rabbitmq-server restart

Usage

Once you’re done with that, you should be able to access the local webserver under port 55672. You need to supply valid RabbitMQ username/password. The default URL should work in most cases: http://guest:guest@127.0.0.1:55672/.

You can also get raw data in JSON format:

$ curl http://guest:guest@127.0.0.1:55672/json
{'bound_to': '0.0.0.0:5672 ',
 'datetime': 'Sun, 29 Nov 2009 19:40:22 GMT',
 'fd_total': 1024,
 'fd_used': 31,
 'mem_binary': 4317158,
 'mem_ets': 1348072,
 'mem_total': 'unknown',
 'mem_used': 19856037,
 'pid': '24561',
 'proc_total': 32768,
 'proc_used': 118,
 'connections': [{'address': '127.0.0.1',
                 'channels': 1,
                 'frame_max': 131072,
                 'peer_address': '127.0.0.1',
                 'peer_port': 53700,
                 'pid': '<0.1052.0>',
                 'port': 5672,
                 'recv_cnt': 3271,
                 'recv_oct': 819137,
                 'send_cnt': 45,
                 'send_oct': 60139,
                 'send_pend': 0,
                 'state': 'running',
                 'timeout': 0,
                 'user': 'guest',
                 'vhost': '/'},
                   ...],
 'queues': [{'acks_uncommitted': 0,
            'arguments': '[]',
            'auto_delete': 'false',
            'consumers': 1,
            'durable': 'true',
            'memory': 371896,
            'messages': 501,
            'messages_ready': 500,
            'messages_unacknowledged': 1,
            'messages_uncommitted': 0,
            'name': 'b',
            'pid': '<0.1069.0>',
            'transactions': 0,
            'vhost': '/'},
               …]}

The plugin is beta quality and is tested only on Linux. Leave us a feedback if you found it useful or if you have any comments.

by
marek
on
30/11/09
  1. Holger Hoffstätte
    on 30/11/09 at 6:44 pm

    Works just fine on Windows as well. sweet :)

  2. [...] First Tweet: 51 minutes ago lshift Highly Influential LShift Ltd New blog post: Introducing rabbitmq-status plugin http://www.lshift.net/blog/2009/11/30/introducing-rabbitmq-status-plugin retweet [...]

  3. Holger Hoffstätte: Works just fine on Windows as well.

    That’s great. Thanks for checking that!

  4. Social comments and analytics for this post…

    This post was mentioned on Twitter by aaronfeng: gotta try this soon: New blog post: Introducing rabbitmq-status plugin http://bit.ly/4Fjxqj (via @lshift)…

  5. Is sources of the plugin published anywhere?
    Is there any ways to embed rabbitmq with several plugins into one debian package to simplify deployment to many servers?

  6. when i use curl tool,i only get “AMQ [root@centos usr/lib/rabbitmq]“.
    why?

  7. @wilson

    Haven’t you specified wrong port number? AMQ string sounds like initial string on port that’s listening to AMPQ. Please try port 55672.

  8. The source code is in rabbit mercurial repo:
    hg clone http://hg.rabbitmq.com/rabbitmq-status/

  9. Works on OS X (tested on Snow Leopard) as well.

  10. [...] requires installation of the rabbitmq-status plugin, which you can find out more about in our documentation. You will also have to install our latest [...]

 
 
2000-9 LShift Ltd, 1st Floor Office, Hoxton Point, 6 Rufus Street, London, N1 6PE, UK +44 (0)20 7729 7060