Permalink
Browse files

Fix a couple of straggler Gemini'isms from imported code.

1. Move the central_conf() file out of riak_core_cinfo_basic.erl
and into riak_core_cinfo_core.erl, renaming it config_files().
It attempts to find the app.config and vm.args config files,
show their last modification times via "ls -l", and dump their
output.

2. Change the SASL alarm-handling dump to avoid referring to a
Gemini-specific function.  Also, include the alarm callback in
the module's list of all info callbacks.
  • Loading branch information...
1 parent 913f792 commit 0f189678f97145d2ad0361839f4489c8d23d0091 @slfritchie slfritchie committed Dec 6, 2010
Showing with 16 additions and 7 deletions.
  1. +5 −7 src/riak_core_cinfo_basic.erl
  2. +11 −0 src/riak_core_cinfo_core.erl
View
12 src/riak_core_cinfo_basic.erl
@@ -26,7 +26,6 @@
%% Export in case anyone else thinks they might be useful.
-export([alarm_info/1, application_info/1,
capture_ets_i/1, capture_net_kernel_i/1, nodes_info/1, capture_regs/1,
- central_conf/1,
erlang_memory/1, erlang_statistics/1,
erlang_system_info/1, global_summary/1, inet_db_summary/1,
loaded_modules/1, memory_hogs/2, non_zero_mailboxes/1, port_info/1,
@@ -55,16 +54,16 @@ cluster_info_generator_funs() ->
{"Nodes summary", fun nodes_info/1},
{"net_kernel summary", fun capture_net_kernel_i/1},
{"inet_db summary", fun inet_db_summary/1},
+ {"Alarm summary", fun alarm_info/1},
{"Global summary", fun global_summary/1},
- {"Application config (central.conf)", fun central_conf/1},
%% Longer output starts here.
{"erlang:system_info() summary", fun erlang_system_info/1},
{"Loaded modules", fun loaded_modules/1}
].
alarm_info(C) ->
- Alarms = gmt_util:get_alarms(),
+ Alarms = gmt_util_get_alarms(),
cluster_info:format(C, " Number of alarms: ~p\n", [length(Alarms)]),
cluster_info:format(C, " ~p\n", [Alarms]).
@@ -96,10 +95,6 @@ capture_regs(C) ->
cluster_info:format(
C, cluster_info:capture_io(1000, fun() -> shell_default:regs() end)).
-central_conf(C) ->
- {ok, Config} = file:read_file(gmt_config_svr:get_config_path()),
- cluster_info:send(C, ["\n", Config, "\n"]).
-
erlang_memory(C) ->
cluster_info:format(C, " ~p\n", [erlang:memory()]).
@@ -206,3 +201,6 @@ time_and_date(C) ->
timer_status(C) ->
cluster_info:format(C, " ~p\n", [timer:get_status()]).
+gmt_util_get_alarms() ->
+ alarm_handler:get_alarms().
+
View
11 src/riak_core_cinfo_core.erl
@@ -38,6 +38,7 @@ cluster_info_init() ->
cluster_info_generator_funs() ->
[
+ {"Riak Core config files", fun config_files/1},
{"Riak Core vnode modules", fun vnode_modules/1},
{"Riak Core ring", fun get_my_ring/1},
{"Riak Core latest ring file", fun latest_ringfile/1},
@@ -65,3 +66,13 @@ active_partitions(CPid) ->
end, ordsets:new(), Vnodes),
cluster_info:format(CPid, "~p\n", [Partitions]).
+config_files(C) ->
+ {ok, [[AppPath]]} = init:get_argument(config),
+ EtcDir = filename:dirname(AppPath),
+ VmPath = filename:join(EtcDir, "vm.args"),
@cmeiklejohn
cmeiklejohn Oct 22, 2013

This looks like it's problematic with cuttlefish.

+ [begin
+ cluster_info:format(C, "File: ~s\n", [os:cmd("ls -l " ++ File)]),
+ {ok, FileBin} = file:read_file(File),
+ cluster_info:format(C, "File contents:\n~s\n", [FileBin])
+ end || File <- [AppPath, VmPath]].
+

0 comments on commit 0f18967

Please sign in to comment.