#!/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"; #### #!/usr/bin/perl use strict; use FindBin qw ($Bin); use lib "$Bin/lib"; use General; use Functions; my $host=$ARGV[0]; $General::password=$ENV{'PASSWORD'}; my $login = getPrompt($host); die "Could not connect to $host" if $login ne "SUCCESSFUL!"; my $result = getOSType(); print $result; #### #!/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`; my $login = getPrompt($hostname); next if $login ne "SUCCESSFUL!"; my $stdout = getOSType(); 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";