Mcollective remote execution returns empty for slow hosts

asked 2017-11-23 13:52:07 -0600

Hi,

mc = rpcclient("hc_agent')
  mc.identity_filter(hostfilter) if hostfilter
  mc.compound_filter(factfilter) if factfilter
  mc.progress = false
  mc.discovery_timeout = 3
  out =  mc.GetStatsforWlhc()

In case of a slow responding host, where the remote execution takes longer than expected (but less than the timeout mentioned in the DDL), it's just returning the status code as 0 without any data. Printing in below way gives me nothing.

out[i].results[:data][:output]

Is there any way to stop and wait for the result to come from the slow performing host?

DDL Details:

 metadata :name        => 'hc_agent',
             :description => 'Health check',
             :author      => 'Author',
             :Group       => 'MCollective',
             :license     => 'GPL',
             :version     => '0.1',
             :url         => 'http://example.com',
             :timeout     => 180

action "GetStatsforWlhc", :description => "Sample description" do
  display :always

  output :output,
         :description => "Current Status",
         :display_as => "Status"
  output :err,
         :description => "Errors",
         :display_as => "Error"
end

Regards, Suhadri

edit retag flag offensive close merge delete