Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'csv'
- require 'net/ssh'
- CSV.foreach("serverlist.csv",',') do |server|
- host = server[0]
- username = server[1]
- passwd = server[2]
- command = "/bin/ls"
- Net::SSH.start(host, username, :password => passwd) do |ssh|
- result = ssh.exec!(command)
- puts result
- ssh.close
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement