#!/usr/bin/perl use strict; use FindBin qw ($Bin); use lib "$Bin/lib"; use ForkManager; use General; use Benchmark; getPassword("Please enter your password: "); my $start = new Benchmark; open SERVERS,"$ARGV[0]" or die $!; my (@hosts)=; close SERVERS; my $sshscript = "checkUname.pl"; my $maxProbes = 20; # set this to one to do one at a time my $pm = new ForkManager($maxProbes); foreach my $hostname (@hosts) { $pm->start and next; my $stdout = `./$sshscript $hostname`; print "$stdout\n"; $pm->finish; } $pm->wait_all_children; print "done\n"; my $end = new Benchmark; my $diff = timediff($end, $start); print "Time taken was ", timestr($diff, 'all'), " seconds";