Good morning net-ssh-users,
I am using net-ssh to deploy and execute software remotely, and it has been
causing me problems.
I have deployed a program (./multi_traceroute.rb) to multiple servers, and I
am trying to this program on as many of the servers as i can. I am using the
following code to achieve this.
def measure_installed_nodes
puts "Starting Measurements"
threads = []
measured_nodes = NodeSet.new
for node in @installed_nodes.to_array
puts "Starting query on #{node}"
threads << Thread.new(node) { |nextNode|
measured_nodes.add_node(nextNode)
qa = QueryActuator.new
qa.do_multi_traceroute(nextNode, @slice_nodes) # The second
arguement contains the nodes to be measured by pvm.
}
end
# Proccess.wait
threads.each { |thread| thread.join }
puts "All threads home and safe"
return message
end
def send_command (session, command, remote_host)
session.open_channel do |channel|
channel.on_data do |ch, data|
puts "[#{remote_host}] -> #{data}"
end
channel.exec "#{command}"
end
end
>From QueryActuator
def do_multi_traceroute( remote_host, node_set )
puts "Sending Measurement to #{remote_host}"
target_hosts = "google.com gmail.com"
Net::SSH.start( remote_host, ''sussex_day_pvm'') do
|session|
puts " Attached to planet lab node #{remote_host}"
send_command(session, "./multi_traceroute.rb #{target_hosts}",
remote_host)
session.loop
end
success = true
rescue Net::SSH::AuthenticationFailed => exception
success = false
rescue Errno::ETIMEDOUT
success = false
puts "Measurement Completed. Success?: #{success}"
return success
end
The code appears to work some of the time, however, I regularly get his eror
message:
[2006-03-07 11:22:08] ERROR NameError: uninitialized constant
Net::SSH::Transport::Compress::ZLibCompressor
/usr/lib64/ruby/gems/1.8/gems/net-ssh-1.0.5/lib/net/ssh/transport/compress/services.rb:30:in
`register_services''
Does anyone have any idea what could cause this? I am running gentoo with a
2.6.15 kernel (amd64) - I thought this might be part of the problem. Has
anyone else even seen this? I have also seen a couple of errors related to
this, i might be able to reproduce them if anyone thinks it would be
pertinent... Would you expect this code to work in your systems?
Please help, I don''t want to submit these commands with system ssh
username at host ./multitraceroute .
Rob D
University of Sussex
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/net-ssh-users/attachments/20060307/b8aec854/attachment.htm