Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 204869300f
Fetching contributors…

Cannot retrieve contributors at this time

executable file 25 lines (18 sloc) 0.558 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/usr/bin/env ruby

require 'mcollective'

oparser = MCollective::Optionparser.new({}, "filter")

options = oparser.parse{|parser, options|
    parser.define_head "Find hosts matching criteria"
    parser.banner = "Usage: mc-find-hosts [options] [filters]"
}

begin
    client = MCollective::Client.new(options[:config])
    client.options = options

    stats = client.req("ping", "discovery") do |resp|
        puts resp[:senderid]
    end
rescue Exception => e
    raise
end

client.display_stats(stats) if options[:verbose]

# vi:tabstop=4:expandtab:ai
Something went wrong with that request. Please try again.