#####
sub tail_file {
my $node = shift;
my $command = ();
if ($node =~ /all nodes/i) {
$command = "tail -100f $logdir/syslog";
}else{
$command = "tail -100f $logdir/syslog | grep -i $node";
}
my $count = 0;
print "
Tailing /var/log/syslog...
\n";
open (TAIL,"$command |") or die "Can't open TAIL($command):$!\n";
while ($count <= $max) {
chomp(my $line = );
$line =~ s/\s/$space/g;
print "$line
\n";
$count++;
maxed_out() if $count >= $max
}
}
#####