Bug#298275: [Logwatch-Devel]

Jeff Frost jeff at frostconsultingllc.com
Tue Feb 21 18:58:57 MST 2006


On Mon, 23 Jan 2006, Mike Tremaine wrote:

> My 2 cents on this thread would be you could make a eximstats wrapper
> script as a new service that would call the eximstats as required.
> Keeping it separate from the provide exim service we already have. Then
> it mearly becomes as configuration choice in the logwatch.conf file
>
> Service = -exim
> Service = eximstats

Sorry it took me so long, but attached is the simple eximstats wrapper 
script and eximstats.conf service config file.

Comments/complaints welcome.

-- 
Jeff Frost, Owner 	<jeff at frostconsultingllc.com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954
-------------- next part --------------
###########################################################################
# $Id: exim.conf,v 1.5 2005/02/24 17:05:20 kirk Exp $
###########################################################################

# You can put comments anywhere you want to.  They are effective for the
# rest of the line.

# this is in the format of <name> = <value>.  Whitespace at the beginning
# and end of the lines is removed.  Whitespace before and after the = sign
# is removed.  Everything is case *insensitive*.

# Yes = True  = On  = 1
# No  = False = Off = 0

Title = "EXIMSTATS"

# Which logfile group...
LogFile = exim

# Only give lines pertaining to the mountd service...
#*OnlyService = 
#*RemoveHeaders = 

# Location of eximstats executable
$eximstats = "/usr/sbin/eximstats"

########################################################
# This was written and is maintained by:
#    Jeff Frost <jeff.frost at frostconsultingllc.com>
#
# Please send all comments, suggestions, bug reports,
#    etc, to jeff.frost at frostconsultingllc.com and
#    logwatch-devel at logwatch.org
########################################################

# vi: shiftwidth=3 tabstop=3 et
-------------- next part --------------
##########################################################################
# $Id: eximstats,v 1.0 2006/01/16 20:41:44 jeff Exp $
##########################################################################
# This is a wrapper for the eximstats program
#
# Please send all comments, suggestions, bug reports,
#    etc, to jeff.frost at frostconsultingllc.com and
#    logwatch-devel at logwatch.org
########################################################

use Logwatch ':all';

$Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;


my $SearchDate = TimeFilter("%Y-%m-%d %H:%M:%S");

if ( $Debug >= 5 ) {
         print STDERR "\n\nDEBUG: Inside eximstats Filter \n\n";
         $DebugCounter = 1;
}

open(EXIMSTATS,"| $ENV{'eximstats'}");

while (defined($ThisLine = <STDIN>)) {

    next unless $ThisLine =~ /^$SearchDate /o;

    if ( $Debug >= 5 ) {
       print STDERR "DEBUG($DebugCounter): $ThisLine";
       $DebugCounter++;
    }
    print EXIMSTATS $ThisLine;
}

close EXIMSTATS;

exit(0);

# vi: shiftwidth=3 tabstop=3 syntax=perl et



More information about the Logwatch-Devel mailing list