The rabbitmq-management plugin provides an HTTP-based API for management and monitoring of your RabbitMQ server, along with a browser-based UI and a command line tool, rabbitmqadmin. Features include:
The management plugin is included in the RabbitMQ distribution. To enable it, use rabbitmq-plugins:
rabbitmq-plugins enable rabbitmq_management
If you wish to build the plugin from source, it can be built like any other. See the plugin development page for more information, but be aware that it seems to be problematic to build rabbitmq-mochiweb on Windows.
rabbitmq-management uses the Mochiweb web server which requires a newer Erlang version. At least R13B01 is required, but later versions are recommended.
NB: The port for RabbitMQ versions prior to 3.0 is 55672.
To use the web UI you will need to authenticate as a RabbitMQ user (on a fresh installation the user "guest" is created with password "guest"). From here you can manage exchanges, queues, bindings, virtual hosts, users and permissions. Hopefully the UI is fairly self-explanatory.
The management UI is implemented as a single static HTML page which makes background queries to the HTTP API. As such it makes heavy use of Javascript. It has been tested with recent versions of Firefox, Chromium and Safari, and with versions of Microsoft Internet Explorer back to 6.0.
The management plugin extends the existing permissions model somewhat. Users can be given arbitrary tags within RabbitMQ. The management plugin makes use of tags called "management", "monitoring" and "administrator". The following table shows what the different types of user can do:
| Tag | Capabilities |
|---|---|
| (None) | No access to the management plugin |
| management |
Anything the user could do via AMQP plus:
|
| monitoring |
Everything "management" can plus:
|
| administrator |
Everything "monitoring" can plus:
|
Note that since "administrator" does everything "monitoring" does, and "monitoring" does everything "management" does, you only need to give each user a maximum of one tag.
Normal RabbitMQ permissions still apply to monitors and administrators; just because a user is a monitor or administrator does not give them full access to exchanges, queues and bindings through either AMQP or the management plugin.
All users can only list objects within a particular virtual host if they have any permissions for that virtual host.
If you get locked out due to only having non-administrator users, or no users at all, you can use rabbitmqctl add_user to create a non-administrator user and rabbitmqctl set_user_tags to promote a user to administrator.
There are several configuration options which affect the management plugin. These are managed through the main RabbitMQ configuration file.
The management plugin lets you export a JSON file containing definitions of all broker objects (queues, exchanges, bindings, users, virtual hosts, permissions and parameters). In some scenarios it may be useful to ensure the existence of these objects at every startup.
To do this, set the load_definitions variable to the path of a previously exported JSON file containing the definitions you want.
Note that the definitions in the file will overwrite anything already in the broker; using this option will not delete anything that is already there. However, if you start from a completely reset broker, use of this option will prevent the usual default user / virtual host / permissions from being created.
The message rates shown by the management plugin require fine-grained statistics to be enabled in the server. This will have a performance impact on a CPU-bound server; typically message throughput can be reduced by 5-10%. For ease of use, the management plugin will automatically enable fine-grained statistics when it is installed.
However, if you'd rather get the throughput than the statistics, you can prevent this from happening. Set the value of the force_fine_statistics variable to false in your configuration file for the rabbitmq_management_agent application and restart RabbitMQ.
By default the server will emit statistics events every 5000ms. The message rate values shown in the management plugin are calculated over this period. You may therefore want to increase this value in order to sample rates over a longer period, or to reduce the statistics load on a server with a very large number of queues or channels.
In order to do so, set the value of the collect_statistics_interval variable for the rabbit application to the desired interval in milliseconds and restart RabbitMQ.
To create simple access logs of requests to the HTTP API, set the value of the http_log_dir variable in the rabbitmq_management application to the name of a directory in which logs can be created and restart RabbitMQ. Note that only requests to the API at /api are logged, not requests to the static files which make up the browser-based GUI.
An example configuration file for RabbitMQ that switches on request logging, increases the statistics interval to 10000ms and explicitly sets some other relevant parameters to their default values, would look like this:
[
{rabbit, [ {tcp_listeners, [5672]},
{collect_statistics_interval, 10000} ] },
{rabbitmq_management, [ {http_log_dir, "/tmp/rabbit-mgmt"} ] },
{rabbitmq_management_agent, [ {force_fine_statistics, true} ] }
].
It is possible to configure rabbitmq-mochiweb to serve the management plugin on a different port or network interface, with SSL, etc. To do so, you should configure the listener configuration item:
[
...
{rabbitmq_management, [{listener, [{port, 12345}]}]},
...
].
See the rabbitmq-mochiweb guide for more details.
The management plugin will retain samples of some data such as message rates and queue lengths. You can configure how long such data is retained.
[
...
{rabbitmq_management, [{sample_retention_policies,
[{global, [{60, 5}, {3600, 60}, {86400, 1200}]},
{basic, [{60, 5}, {3600, 60}]},
{detailed, [{10, 5}]}]}
]},
...
].
There are three policies:
The management plugin is aware of clusters. You can enable it on one or more nodes in a cluster, and see information pertaining to the entire cluster no matter which node you connect to.
If you want to deploy cluster nodes which do not have the full management plugin enabled, you will still need to enable the rabbitmq-management-agent plugin on each node.
By default the management plugin will create an HTTP-based API at http://server-name:15672/api/. Browse to that location for more information on the API. For convenience you can read the latest HTTP API documentation on our Mercurial server.
It is possible to make the web UI available via any proxy that conforms with RFC 1738. The following sample Apache configuration illustrates the minimum necessary directives to coax Apache into conformance. It assumes a management web UI on the default port of 15672:
AllowEncodedSlashes On ProxyPass /api http://localhost:15672/api nocanon ProxyPass / http://localhost:15672/ ProxyPassReverse / http://localhost:15672/