diff options
author | Emile Joubert <emile@rabbitmq.com> | 2011-05-31 16:07:13 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2011-05-31 16:07:13 +0100 |
commit | 39e3f17926ccc20917a7aa44ba958a7541a8f14e (patch) | |
tree | 8f8b881a35e904eca10956655887b6fe607fefa2 | |
parent | 2b70875cc5a34c273def6f1c62c8696c15c4acee (diff) | |
download | rabbitmq-server-39e3f17926ccc20917a7aa44ba958a7541a8f14e.tar.gz |
Move status info (again)
-rw-r--r-- | src/rabbit.erl | 12 | ||||
-rw-r--r-- | src/rabbit_control.erl | 15 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index c239262d..88b16474 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -180,6 +180,10 @@ -spec(status/0 :: () -> [{pid, integer()} | {running_applications, [{atom(), string(), string()}]} | + {os , {atom(), atom()}} | + {erlang_version , string()} | + {memory , any()} | + {env , [{atom() | term()}]} | {nodes, [{rabbit_mnesia:node_type(), [node()]}]} | {running_nodes, [node()]}]). -spec(log_location/1 :: ('sasl' | 'kernel') -> log_location()). @@ -218,7 +222,13 @@ stop_and_halt() -> status() -> [{pid, list_to_integer(os:getpid())}, - {running_applications, application:which_applications()}] ++ + {running_applications, application:which_applications()}, + {os, os:type()}, + {erlang_version, erlang:system_info(system_version)}, + {memory, erlang:memory()}, + {env, lists:filter(fun ({default_pass, _}) -> false; + (_) -> true + end, application:get_all_env(rabbit))}] ++ rabbit_mnesia:status(). rotate_logs(BinarySuffix) -> diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index f012c246..ecd1b81f 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -17,7 +17,7 @@ -module(rabbit_control). -include("rabbit.hrl"). --export([start/0, stop/0, action/5, diagnostics/1, node_status/0]). +-export([start/0, stop/0, action/5, diagnostics/1]). -define(RPC_TIMEOUT, infinity). -define(WAIT_FOR_VM_ATTEMPTS, 5). @@ -38,7 +38,6 @@ -> 'ok'). -spec(diagnostics/1 :: (node()) -> [{string(), [any()]}]). -spec(usage/0 :: () -> no_return()). --spec(node_status/0 :: () -> [{atom(), any()}]). -endif. @@ -140,15 +139,6 @@ usage() -> io:format("~s", [rabbit_ctl_usage:usage()]), quit(1). -node_status() -> - [{node_name, erlang:node()}, - {os, os:type()}, - {erlang_version, erlang:system_info(system_version)}, - {memory, erlang:memory()}, - {env, lists:filter(fun ({default_pass, _}) -> false; - (_) -> true - end, application:get_all_env(rabbit))}]. - %%---------------------------------------------------------------------------- action(stop, Node, [], _Opts, Inform) -> @@ -330,8 +320,7 @@ action(list_permissions, Node, [], Opts, Inform) -> action(report, Node, _Args, _Opts, Inform) -> io:format("Reporting server status on ~p~n", [erlang:universaltime()]), - action(status, Node, [], [], Inform), - [io:format("~p~n", [rpc_call(N, rabbit_control, node_status, [])]) || + [action(status, N, [], [], Inform) || N <- rpc_call(Node, rabbit_mnesia, running_clustered_nodes, [])], GlobalQueries = [{"connections", rabbit_networking, connection_info_all, connection_info_keys}, |