Tested with ruby 1.9.3 time is not bad;
[ slmn@uriel ~]$ time ruby ipmap.rb "192.168.0.1" "192.168.0.10" real 0m2.393s user 0m0.750s sys 0m1.547s
I commented on areas if you want your operations to be streamed;
require 'ipaddr' ips = IPAddr.new("192.168.1.0/24").to_range threads = ips.map do |ip| Thread.new do status = system("ping -q -W 1 -c 1 #{ip}", [:err, :out] => "/dev/null")
source share