anchor.diff:  %% for metrics gathering (great for Graphite)
   %%
   %% Usage:
  -%% ./erlang_stats.erl -c epic_erlang_cookie -n metrics@127.0.0.1 -r epic_erlang_app@127.0.0.1 -s prod.epic_erlang_app
  -%%
  -%% If the script does not work, create a test cookie like:
  -%% echo -n secret > /opt/sensu/.erlang.cookie
  -%% chmod 600 /opt/sensu/.erlang.cookie
  -%% chown sensu:sensu /opt/sensu/.erlang.cookie
  +%% ./erlang_stats.erl -c epic_erlang_cookie -n metrics@127.0.0.1 -r epic_erlang_app@127.0.0.1 -s prod.epic_erlang_app -p named_process1 -d true
   %%
   %% Copyright 2013 Panagiotis Papadomitsos <pj@ezgr.net>.
   %%
  
positive.code:     ok = set_local_node_name(ParsedOptions),
      ok = set_connection_cookie(ParsedOptions),
      ok = connect_to_remote_node(ParsedOptions),
      ok = collect_stats(ParsedOptions),
      halt(0).
  
  usage() ->
      io:format(standard_error, "Usage: ~s [-s SCHEME] [-c COOKIE] [-n NODE_NAME] [-r REMOTE_NODE]~n~n", [escript:script_name()]),
      io:format(standard_error, "  -s SCHEME       Set the metric scheme (default: host FQDN)~n", []),
      io:format(standard_error, "  -c COOKIE       Set the Erlang cookie~n", []),
      io:format(standard_error, "  -n NODE_NAME    Set the Erlang node name (automatic short/long name detection)~n", []),
      io:format(standard_error, "  -r REMOTE_NODE  Set the Erlang node to connect to~n~n", []).
  
  parse_options(Options) ->
      parse_options(Options, []).
  
negative.code:         "-s" ->
              [Scheme|NewOptions] = Options,
              parse_options(NewOptions, [{scheme, Scheme}|ParsedOptions]);
          "-d" ->
              [_Debug|NewOptions] = Options,
              parse_options(NewOptions, [{debug, true}|ParsedOptions]);
          "-p" ->
              [ReadProcesses|NewOptions] = Options,
              Processes = string:tokens(ReadProcesses, ","),
              parse_options(NewOptions, [{processes, Processes}|ParsedOptions]);
          "-c" ->
              [Cookie|NewOptions] = Options,
              parse_options(NewOptions, [{cookie, Cookie}|ParsedOptions]);
  