Created
September 12, 2017 09:04
-
-
Save t0d0r/c805ed3ae87d13f145f01030175fd125 to your computer and use it in GitHub Desktop.
Revisions
-
t0d0r created this gist
Sep 12, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ data = <<__EOF__ node-bg-os 127.0.0.1 127.0.0.1 __EOF__ require 'net/ssh' exit if ARGV[0].nil? count = 0 data.split(/\n/).each do |line| name,ip1,ip = line.split(/\s+/) #puts "#{name}\n#{ip}\n#{ip}\n\n" print ">> #{name}: " Net::SSH.start(ip, 'user', :password => "PASSWORD") do |ssh| # capture all stderr and stdout output from a remote process output = ssh.exec!("#{ARGV[0]}") count += output.to_i puts output end # puts "speeping 60 sec" # sleep 60 end puts "Total: #{count}"