summaryrefslogtreecommitdiff
path: root/src/rabbit_control.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rabbit_control.erl')
-rw-r--r--src/rabbit_control.erl27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index bc588279..d6f5ad73 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -89,12 +89,18 @@ Available commands:
list_user_vhosts <UserName>
list_vhost_users <VHostPath>
+ list_queues <InfoItem> [<InfoItem> ...]
+
<node> should be the name of the master node of the RabbitMQ cluster. It
defaults to the node named \"rabbit\" on the local host. On a host named
\"server.example.com\", the master node will usually be rabbit@server (unless
NODENAME has been set to some non-default value at broker startup time). The
output of hostname -s is usually the correct suffix to use after the \"@\" sign.
+<InfoItem> must be a member of the list [name, durable, auto_delete, arguments,
+pid, messages_ready, messages_unacknowledged, messages_uncommitted, messages,
+acks_uncommitted, consumers, transactions, memory].
+
"),
halt(1).
@@ -179,7 +185,26 @@ action(list_user_vhosts, Node, Args = [_Username]) ->
action(list_vhost_users, Node, Args = [_VHostPath]) ->
io:format("Listing users for vhosts ~p...", Args),
- display_list(call(Node, {rabbit_access_control, list_vhost_users, Args})).
+ display_list(call(Node, {rabbit_access_control, list_vhost_users, Args}));
+
+action(list_queues, Node, Args) ->
+ io:format("Listing queues ...~n"),
+ lists:map(
+ fun (ResultRow) ->
+ lists:map(
+ fun(ResultColumn) ->
+ case ResultColumn of
+ {name, #resource{virtual_host = VHostPath, kind = queue, name = Name}} ->
+ io:format("~s@~s ", [Name, VHostPath]);
+ {_, Res} ->
+ io:format("~w ", [Res])
+ end
+ end,
+ ResultRow),
+ io:nl()
+ end,
+ rpc_call(Node, rabbit_amqqueue, info_all, [[list_to_atom(X) || X <- Args]])),
+ ok.
display_list(L) when is_list(L) ->
lists:foreach(fun (I) ->