Hi perl monks, I'm trying to go through 250 aix lpars and capture. I SSH into each host and attempting to run a for loop within backticks, come to find out this does not work, it fails when it gets to "do" Any ideas or workarouns? Thanks.
sub aixstorage {
my $all_servers = 'path to my AIX list of servers';
my @hosts=`cat $all_servers`;
my $filename = '/tmp/aixstorage_report.rtf';
foreach my $one (@hosts){
chomp $one;
my $ping = `ping -c 1 -w 1 $one 1>/dev/null 2>&1`;
if (defined ($ping)) {
my $SSH ="/usr/bin/ssh -o ConnectTimeout=3 -o Stri
+ctHostKeyChecking=no";
my $space = $SSH root\@$one for i in lspv | awk '{pri
+nt \$1}'; do bootinfo -s \$i; done | awk '{sum+=\$1}END{print (sum\/1
+024)}'}'"`; print "$space\n";
}else {
print "\nATTENTION: $one is offline\n"
}
}
}