OS: CentOS 3.5
VPS Server
I got the Logwatch filter for the DenyHosts logfile and installed it, but when I went to test logwatch it throws the following error:
Code:
root@vps [/etc/log.d]# ./logwatch
/etc/log.d/scripts/shared/applydhdate: line 13: syntax error near unexpected token `('
/etc/log.d/scripts/shared/applydhdate: line 13: `use POSIX qw(strftime);'
Now here is the entire offending file:
Code:
##########################################################################
# $Id: applyusdate,v 1.5 2005/05/03 19:32:48 bjorn Exp $
##########################################################################
########################################################
#
#
#
#
#
########################################################
use POSIX qw(strftime);
use Logwatch ':dates';
my $time = time;
my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
$SearchDate = TimeFilter('%Y-%m-%d %H:%M:%S');
#$SearchDate = TimeFilter('%F');
if ( $Debug > 5 ) {
print STDERR "DEBUG: Inside ApplyDHDate...\n";
print STDERR "DEBUG: Looking For: " . $SearchDate . "\n";
}
while (defined($ThisLine = <STDIN>)) {
if ($ThisLine =~ m/^$SearchDate /o) {
print $ThisLine;
}
}
# vi: shiftwidth=3 syntax=perl tabstop=3 et
The top line is actualy the first line of code, but the 13th line of the file. I have checked the syntax and it all looks good as far as I can tell. Is there something i'm missing? The only thing I notice thats different about it from another file thats nearly identicle is the other file has
at the top, and this one does not. Adding it didn't fix the issue, although it did get past line 13, failing on 15. Any suggestions are welcome. Thanks.