Sha256: d9948636fec12577c97c196429314a4f77a07c8f263fa43aaaaad41d574c5f34
Contents?: true
Size: 977 Bytes
Versions: 9
Compression:
Stored size: 977 Bytes
Contents
#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" require "poolpartycl" available_monitors = PoolParty::Monitors.available_monitors o = PoolParty::Optioner.new(ARGV) do |opts, optioner| opts.on('-n name', '--name name', 'Listing for cloud name') { |c| optioner.cloudname c } opts.on('-m name', '--monitor monitor_name', "Monitor name (default: cpu) (Available monitors: #{available_monitors.join(", ")})") {|c| optioner.monitorname c} end load_pool(o.spec || Binary.get_existing_spec_location) include Remote @clouds = extract_cloud_from_options o @monitor = o.monitorname || "cpu" @clouds.each do |cl| with_cloud(cl, {:testing => o.testing, :monitorname => @monitor, :verbose => o.verbose }) do vputs "Getting #{monitorname} load through the messenger" load = PoolParty::Messenger.messenger_send!("get_load #{monitorname}", testing) msg = load =~ /[0-9\.]+/ ? load : "-1" print msg end end
Version data entries
9 entries across 9 versions & 1 rubygems