diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2016-01-11 19:04:36 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2016-01-11 19:04:36 +0300 |
| commit | 36f4160a97499eeab4426fa4f81fd7b9ccf59164 (patch) | |
| tree | c79bc8e178b21d350e32382bf95fe73d932692e1 | |
| parent | ece8197016fcb9f91362efef6897aab5bf7d4908 (diff) | |
| parent | 93b9e37c3ea0cade4e30da0aa1f14fa97c82e669 (diff) | |
| download | rabbitmq-server-git-36f4160a97499eeab4426fa4f81fd7b9ccf59164.tar.gz | |
Merge branch 'stable'
| -rw-r--r-- | src/rabbit_control_main.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index 71234fb6a0..c6e39b17f5 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -365,7 +365,10 @@ action(status, Node, [], _Opts, Inform) -> action(cluster_status, Node, [], _Opts, Inform) -> Inform("Cluster status of node ~p", [Node]), - display_call_result(Node, {rabbit_mnesia, status, []}); + Status = unsafe_rpc(Node, rabbit_mnesia, status, []), + io:format("~p~n", [Status ++ [{alarms, + [alarms_by_node(Name) || Name <- nodes_in_cluster(Node)]}]]), + ok; action(environment, Node, _App, _Opts, Inform) -> Inform("Application environment of node ~p", [Node]), @@ -878,3 +881,11 @@ prettify_typed_amqp_value(_Type, Value) -> Value. split_list([]) -> []; split_list([_]) -> exit(even_list_needed); split_list([A, B | T]) -> [{A, B} | split_list(T)]. + +nodes_in_cluster(Node) -> + unsafe_rpc(Node, rabbit_mnesia, cluster_nodes, [running]). + +alarms_by_node(Name) -> + Status = unsafe_rpc(Name, rabbit, status, []), + {_, As} = lists:keyfind(alarms, 1, Status), + {Name, As}. |
