Net probe fails with timeout on check_dhcp request with a lot of iface and vlans

Change-Id: I49610410eb414bea43e3cb3dc62b043bee9d5427
Solution: Provide interface to limit time waiting for response and times request is repeated
This commit is contained in:
Dima 2013-10-14 18:20:58 +03:00
parent 65f8f5d09e
commit dcbea32b06
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@ metadata :name => "Network Probe Agent",
:license => "MIT",
:version => "0.1",
:url => "http://mirantis.com",
:timeout => 40
:timeout => 120
action "start_frame_listeners", :description => "Starts catching packets on interfaces" do
display :always

View File

@ -44,8 +44,9 @@ module MCollective
action "dhcp_discover" do
interfaces = request[:interfaces][get_uid]
format = request.data[:format] || "json"
timeout = request.data[:timeout] || 7
cmd = "dhcpcheck vlans '#{interfaces}' --timeout=#{timeout} --format=#{format} "
timeout = request.data[:timeout] || 2
repeat = request.data[:repeat] || 1
cmd = "dhcpcheck vlans '#{interfaces}' --timeout=#{timeout} --format=#{format} --repeat=#{repeat} "
reply[:status] = run(cmd, :stdout => :out, :stderr => :err)
end