def main
client = MCollective::Client.new(options[:config])
client.options = options
counter = 0
command = configuration[:command]
command += " #{configuration[:argument]}" if configuration[:argument]
statistics = client.discovered_req(command, 'mcollective') do |response|
next unless response
counter += 1
sender = response[:senderid]
body = response[:body]
case command
when %r^stats$/
print_statistics(sender, body[:stats])
when %r^reload_agent(?:.+)/
printf("%40s> %s\n", sender, body)
else
if options[:verbose]
puts "#{sender}>"
pp body
else
puts if counter % 4 == 1
print "#{sender} "
end
end
end
client.disconnect
client.display_stats(statistics, false, "mcollectived controller summary")
end