diff options
author | Emile Joubert <emile@rabbitmq.com> | 2011-05-31 14:40:39 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2011-05-31 14:40:39 +0100 |
commit | 2b70875cc5a34c273def6f1c62c8696c15c4acee (patch) | |
tree | 3fa1de322425a71d5d889385d7bc4ff72d8a49c6 | |
parent | 3fcdbab4ba7c2f043fccc36a694f840d0f342571 (diff) | |
download | rabbitmq-server-2b70875cc5a34c273def6f1c62c8696c15c4acee.tar.gz |
Report node-specific details separately
-rw-r--r-- | src/rabbit.erl | 5 | ||||
-rw-r--r-- | src/rabbit_control.erl | 17 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 7b507ff1..c239262d 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -178,7 +178,8 @@ -spec(stop_and_halt/0 :: () -> 'ok'). -spec(rotate_logs/1 :: (file_suffix()) -> rabbit_types:ok_or_error(any())). -spec(status/0 :: - () -> [{running_applications, [{atom(), string(), string()}]} | + () -> [{pid, integer()} | + {running_applications, [{atom(), string(), string()}]} | {nodes, [{rabbit_mnesia:node_type(), [node()]}]} | {running_nodes, [node()]}]). -spec(log_location/1 :: ('sasl' | 'kernel') -> log_location()). @@ -217,8 +218,6 @@ stop_and_halt() -> status() -> [{pid, list_to_integer(os:getpid())}, - {os, os:type()}, - {erlang_version, erlang:system_info(system_version)}, {running_applications, application:which_applications()}] ++ rabbit_mnesia:status(). diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index 7d3f7907..f012c246 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]). +-export([start/0, stop/0, action/5, diagnostics/1, node_status/0]). -define(RPC_TIMEOUT, infinity). -define(WAIT_FOR_VM_ATTEMPTS, 5). @@ -38,6 +38,7 @@ -> 'ok'). -spec(diagnostics/1 :: (node()) -> [{string(), [any()]}]). -spec(usage/0 :: () -> no_return()). +-spec(node_status/0 :: () -> [{atom(), any()}]). -endif. @@ -139,6 +140,15 @@ 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) -> @@ -320,8 +330,9 @@ action(list_permissions, Node, [], Opts, Inform) -> action(report, Node, _Args, _Opts, Inform) -> io:format("Reporting server status on ~p~n", [erlang:universaltime()]), - [action(status, ClusterNode, [], [], Inform) || - ClusterNode <- rpc_call(Node, rabbit_mnesia, running_clustered_nodes, [])], + action(status, Node, [], [], Inform), + [io:format("~p~n", [rpc_call(N, rabbit_control, node_status, [])]) || + N <- rpc_call(Node, rabbit_mnesia, running_clustered_nodes, [])], GlobalQueries = [{"connections", rabbit_networking, connection_info_all, connection_info_keys}, {"channels", rabbit_channel, info_all, info_keys}], |