#!/usr/bin/perl

# reads the name of a file created with log-loads
# and print lines where the load average was at least 2.1
# to look for high load times

$infile = $ARGV[0];

open(INF, $infile) or die "Cannot open $infile";

while($line1 = <INF>) {
 $line = $line1;
 chomp($line);
 $line =~ s/.*average://g;
 @loads = split /,/, $line;
 for $j (@loads) {
   if($j>=2.1) { print $line1; last;}
 }
}

close(INF);

