Permalink
Browse files

Merge pull request #29 from joecaswell/joecaswell

Check that rpc returned a list before calling lists:member
  • Loading branch information...
Joe Caswell
Joe Caswell committed Oct 5, 2012
2 parents a01d43d + a577602 commit 4fe22aa5cec52e0d872debc70524c81018d75161
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/check_riak_kv_up.erl
View
@@ -8,9 +8,14 @@ run(Options, _) ->
check_riak_kv_up(Node) ->
Services = rpc:call(Node, riak_core_node_watcher, services, []),
+ check_riak_kv_services(Node, Services).
+
+check_riak_kv_services(Node, Services) when is_list(Services) ->
case lists:member(riak_kv, Services) of
true ->
{ok, "riak_kv is running on ~s", [Node]};
false ->
{critical, "riak_kv not found in running services on ~s: ~p", [Node, Services]}
- end.
+ end;
+check_riak_kv_services(Node, Services) ->
+ {critical, "Unable to get list of services running on ~s: ~p", [Node, Services]}.

0 comments on commit 4fe22aa

Please sign in to comment.