all_machines=['192.168.0.100']
gateway = Net::SSH::Gateway.new('192.168.0.1', 'root', :password => 'root')
all_machines.each do |machine|
gateway.ssh(machine,'root') do |ssh|
uname = ssh.exec!('uname -a')
puts "machine: #{machine}; OS: #{uname}"
end
end