Skip to content
Browse files

Added status command for checking for handoffs.

  • Loading branch information...
1 parent eb8d9eb commit d2e3e5389c6fc1ca0c8630ed2fd3ef0aa381f800 @Licenser Licenser committed
Showing with 26 additions and 3 deletions.
  1. +20 −1 apps/snarl/src/snarl_console.erl
  2. +6 −2 rel/files/snarl-admin
View
21 apps/snarl/src/snarl_console.erl
@@ -9,6 +9,7 @@
down/1,
reip/1,
config/1,
+ status/1,
aae_status/1,
staged_join/1,
ringready/1]).
@@ -60,7 +61,8 @@
revoke_user/1,
revoke_group/1,
passwd/1,
- config/1
+ config/1,
+ status/1
]).
list_user([]) ->
@@ -490,6 +492,23 @@ config(["set" | R]) ->
end.
+status([]) ->
+ case riak_core_status:transfers() of
+ {[], []} ->
+ io:format("The cluster is fine!~n"),
+ ok;
+ {[], H} ->
+ io:format("There are ~p handoffs pending!~n", [length(H)]),
+ error;
+ {S, []} ->
+ io:format("There are ~p servers down!~n", [length(S)]),
+ error;
+ {S, H} ->
+ io:format("There are ~p handoffs pending and ~p servers down!~n",
+ [length(H), length(S)]),
+ error
+ end.
+
%%%===================================================================
%%% Private
%%%===================================================================
View
8 rel/files/snarl-admin
@@ -274,15 +274,19 @@ case "$1" in
shift
run snarl_console ringready $@
;;
- "config")
+ config)
shift
run snarl_console config $@
;;
+ status)
+ shift
+ run snarl_console status $@
+ ;;
*)
echo "Usage: $SCRIPT { join | leave | reip | ringready | remove |"
echo " services | wait-for-service | member_status |"
- echo " ring_status}"
+ echo " ring_status | status}"
echo " config show - shows global config options."
echo " config set <key> <value> - sets global config options."
echo " users list - list users."

0 comments on commit d2e3e53

Please sign in to comment.
Something went wrong with that request. Please try again.