def request_agent_stats(agent_name, options)
      res = false
      config_options = AgentConfig.agent_options(agent_name)
      unless config_options.empty? || (listen_port = config_options[:listen_port]).nil?
        client = CommandClient.new(listen_port, config_options[:cookie])
        command = {:name => :stats, :reset => options[:reset]}
        begin
          client.send_command(command, verbose = false, options[:timeout]) { |r| display(agent_name, r, options) }
          res = true
        rescue Exception => e
          msg = "Could not retrieve #{agent_name} agent stats: #{e}"
          msg += "\n" + e.backtrace.join("\n") unless e.message =~ /Timed out/
          fail(msg)
        end
      end
      res
    end
def request_agent_stats(agent_name, options)
      res = false
      config_options = AgentConfig.agent_options(agent_name)
      unless config_options.empty? || (listen_port = config_options[:listen_port]).nil?
        client = CommandClient.new(listen_port, config_options[:cookie])
        command = {:name => :stats, :reset => options[:reset]}
        begin
          client.send_command(command, verbose = false, options[:timeout]) { |r| display(agent_name, r, options) }
          res = true
        rescue Exception => e
          msg = "Could not retrieve #{agent_name} agent stats: #{e}"
          msg += "\n" + e.backtrace.join("\n") unless e.message =~ /Timed out/
          fail(msg)
        end
      end
      res
    end
Request and display statistics for agent

 === Parameters
 agent_name(String):: Agent name
 options(Hash):: Command line options

 === Return
 (Boolean):: true if agent running, otherwise false