LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-06-2006, 10:35 AM   #1
rustyz82
Member
 
Registered: May 2004
Posts: 69

Rep: Reputation: 15
Logwatch Filter for DenyHosts - Getting Error


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

Code:
#!/usr/bin/perl -w
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.
 
Old 08-07-2006, 07:52 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Since the syntax of the 'use' lines is the same as on my system, it may be that the Perl POSIX module isn't installed or is the wrong version. If not, you could try the following instead, but I haven't tested it here:
Code:
use POSIX "strftime";
There's some info on the POSIX module at http://perldoc.perl.org/POSIX.html, but it doesn't tell me much except that strftime is part of the package.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LogWatch error: aacraid:ID(0:03:0); Mechanical Positioning Error ...: 1 Time(s) tor_user Linux - Hardware 1 07-26-2006 05:00 PM
Error message received from system Error while reading filter description for true Steel_J Linux - Software 2 03-04-2006 06:10 PM
LXer: Preventing SSH Dictionary Attacks With DenyHosts LXer Syndicated Linux News 0 02-19-2006 11:01 AM
LogWatch logged error in xmdms Linux - Networking 0 12-02-2004 08:52 AM
LogWatch error messages XT8088 Red Hat 0 09-10-2003 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration