-
-
Save rickhull/7feaf1fb643f37169f28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/ssh' | |
filename = ARGV.shift || raise("no filename provided") | |
user = ARGV.shift || raise("no host provided") | |
pass = ARGV.shift || raise("no user provided") | |
File.open(filename).each do |i| | |
host = i.chomp | |
print "#{host}: " | |
Net::SSH.start(host, user, :password => pass ) do|ssh| | |
result = ssh.exec!('uptime') | |
puts result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment