Introducing rabbitmq-status plugin

By: on November 30, 2009

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 [old link: http://dev.lshift.net/majek/rabbitmq-status_1.7.0.tar.gz"] (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.

FacebookTwitterGoogle+

15 Comments

  1. Holger Hoffstätte says:

    Works just fine on Windows as well. sweet :)

  2. marek says:

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

    That’s great. Thanks for checking that!

  3. Anton says:

    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?

  4. wilson says:

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

  5. marek says:

    @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.

  6. marek says:

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

  7. Filip Tepper says:

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

  8. gareth reeves says:

    Since upgrading to rabbitmq 2.0.1, the status plugin returns me a empty page. I had a quick look at building the plugin, but the Makefile depends on ../include.mk.

    Could someone publish some new precompiled binaries that work with 2.0.1?

  9. gareth reeves says:

    2.1 – not 2.0.1

  10. mamu says:

    ECHO: gareth reeves’s comment

    2.1 is showing blank page, Can someone publish compiled plugin if fixed?

  11. Gareth, Mamu:

    Since approximately 2.1.0 or so we haven’t been maintaining the status plugin any more – it’s replaced by the management plugin which does everything the status plugin did and a great deal more. You can download precompiled binaries from:

    http://www.rabbitmq.com/plugins.html

Post a comment

Your email address will not be published.

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>