summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_multi.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rabbit_multi.erl b/src/rabbit_multi.erl
index 2b11771770..9373e8cb1d 100644
--- a/src/rabbit_multi.erl
+++ b/src/rabbit_multi.erl
@@ -70,6 +70,7 @@ usage() ->
Available commands:
start_all <NodeCount> - start a local cluster of RabbitMQ nodes.
+ status - print status of all running nodes
stop_all - stops all local RabbitMQ nodes.
rotate_logs [Suffix] - rotate logs for all local and running RabbitMQ nodes.
"),
@@ -88,6 +89,17 @@ action(start_all, [NodeCount], RpcTimeout) ->
false -> timeout
end;
+action(status, [], RpcTimeout) ->
+ io:format("Status of all running nodes...~n", []),
+ call_all_nodes(
+ fun({Node, Pid}) ->
+ io:format("Node '~p' with Pid ~p: ", [Node, Pid]),
+ case rpc:call(Node, rabbit, status, [], RpcTimeout) of
+ {badrpc, Error} -> io:format("~p~n", [Error]);
+ [{running_applications, Apps} | _] -> io:format("~p~n", [Apps])
+ end
+ end);
+
action(stop_all, [], RpcTimeout) ->
io:format("Stopping all nodes...~n", []),
call_all_nodes(fun({Node, Pid}) ->