Blame scripts/services/slon

Packit 57988d
##########################################################################
Packit 57988d
# $Id$
Packit 57988d
##########################################################################
Packit 57988d
# $Log: slon,v $
Packit 57988d
# Revision 1.6  2008/06/30 23:07:51  kirk
Packit 57988d
# fixed copyright holders for files where I know who they should be
Packit 57988d
#
Packit 57988d
# Revision 1.5  2008/03/24 23:31:27  kirk
Packit 57988d
# added copyright/license notice to each script
Packit 57988d
#
Packit 57988d
# Revision 1.4  2005/10/31 16:21:20  bjorn
Packit 57988d
# Updates to paths to reflect new Filesystem Hierarchy Standard,
Packit 57988d
# by Ivana Varekova.
Packit 57988d
#
Packit 57988d
# Revision 1.3  2005/10/06 23:36:04  mike
Packit 57988d
# Added #vi tag -mgt
Packit 57988d
#
Packit 57988d
# Revision 1.2  2005/09/28 20:14:53  bjorn
Packit 57988d
# Added filtering, by Jeff Frost
Packit 57988d
#
Packit 57988d
# Revision 1.1  2005/09/27 21:51:25  bjorn
Packit 57988d
# New slon service by Jeff Frost
Packit 57988d
#
Packit 57988d
##########################################################################
Packit 57988d
# This was written and is maintained by:
Packit 57988d
#    Jeff Frost <jeff.frost@frostconsultingllc.com>
Packit 57988d
#
Packit 57988d
# Heavily based on xntpd script
Packit 57988d
#
Packit 57988d
# This script and config file assumes that slon is
Packit 57988d
# logging to /var/log/messages, if not, you need to
Packit 57988d
# update the /usr/share/logwatch/default.conf/services/slon.conf and
Packit 57988d
# possibly add a new entry in /usr/share/logwatch/default.conf/logfiles
Packit 57988d
#
Packit 57988d
# Please send all comments, suggestions, bug reports,
Packit 57988d
#    etc, to jeff.frost@frostconsultingllc.com and
Packit 57988d
#    logwatch-devel@lists.sourceforge.net
Packit 57988d
########################################################
Packit 57988d
Packit 57988d
#######################################################
Packit 57988d
## Copyright (c) 2008 Jeff Frost
Packit 57988d
## Covered under the included MIT/X-Consortium License:
Packit 57988d
##    http://www.opensource.org/licenses/mit-license.php
Packit 57988d
## All modifications and contributions by other persons to
Packit 57988d
## this script are assumed to have been donated to the
Packit 57988d
## Logwatch project and thus assume the above copyright
Packit 57988d
## and licensing terms.  If you want to make contributions
Packit 57988d
## under your own copyright or a different license this
Packit 57988d
## must be explicitly stated in the contribution an the
Packit 57988d
## Logwatch project reserves the right to not accept such
Packit 57988d
## contributions.  If you have made significant
Packit 57988d
## contributions to this script and want to claim
Packit 57988d
## copyright please contact logwatch-devel@lists.sourceforge.net.
Packit 57988d
#########################################################
Packit 57988d
Packit 57988d
use Logwatch ':all';
Packit 57988d
Packit 57988d
$Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
Packit 57988d
$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
Packit 57988d
Packit 57988d
if ( $Debug >= 5 ) {
Packit 57988d
         print STDERR "\n\nDEBUG: Inside SLON Filter \n\n";
Packit 57988d
         $DebugCounter = 1;
Packit 57988d
}
Packit 57988d
Packit 57988d
while (defined($ThisLine = <STDIN>)) {
Packit 57988d
    if ( $Debug >= 5 ) {
Packit 57988d
       print STDERR "DEBUG($DebugCounter): $ThisLine";
Packit 57988d
       $DebugCounter++;
Packit 57988d
    }
Packit 57988d
    chomp($ThisLine);
Packit 57988d
    if (
Packit 57988d
        ($ThisLine =~ m/new sl_action_seq/) or
Packit 57988d
        ($ThisLine =~ m/new sl_rowid_seq value/) or
Packit 57988d
        ($ThisLine =~ m/seconds delay for first row/) or
Packit 57988d
        ($ThisLine =~ m/seconds until close cursor/) or
Packit 57988d
        ($ThisLine =~ m/syncing set \d+ with .* from provider/) or
Packit 57988d
        ($ThisLine =~ m/no sets need syncing/) or
Packit 57988d
	($ThisLine =~ m/SYNC \d+ processing/)
Packit 57988d
    ) {
Packit 57988d
       # Ignore these
Packit 57988d
    } elsif ($ThisLine =~ m/main process started/) {
Packit 57988d
      $Starts++;
Packit 57988d
    } elsif ($ThisLine =~ m/exit/) {
Packit 57988d
      $Kills++;
Packit 57988d
    } elsif ($ThisLine =~ m/Received event/) {
Packit 57988d
      $ReceivedEvent++;
Packit 57988d
    } elsif ($ThisLine =~ m/forward confirm/) {
Packit 57988d
      $ForwardConfirm++;
Packit 57988d
    } elsif ($ThisLine =~ m/queue event/) {
Packit 57988d
      $QueueEvent++;
Packit 57988d
    } elsif ($ThisLine =~ m/SYNC \d+ done/) {
Packit 57988d
      $SyncsProcessed++;
Packit 57988d
    } elsif ($ThisLine =~ m/cleanupThread:/) {
Packit 57988d
      $CleanupThread++;
Packit 57988d
    } elsif ($ThisLine =~ m/ERROR/) {
Packit 57988d
      $Errors++;
Packit 57988d
      push @ErrorList, "$ThisLine\n";
Packit 57988d
    } else {
Packit 57988d
       # Report any unmatched entries...
Packit 57988d
       push @OtherList, "$ThisLine\n";
Packit 57988d
    }
Packit 57988d
}
Packit 57988d
Packit 57988d
###########################################################
Packit 57988d
Packit 57988d
if ($Detail >= 5) {
Packit 57988d
	if ($Kills) {
Packit 57988d
	    print "\nSLON Killed: " . $Kills . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
	if ($Starts) {
Packit 57988d
	    print "\nSLON Started: " . $Starts . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
Packit 57988d
	if ($CleanupThread) {
Packit 57988d
	   print "\nSLON CleanupThread Event: " . $CleanupThread . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
Packit 57988d
	if ($ForwardConfirm) {
Packit 57988d
	   print "\nSLON ForwardConfirm Event: " . $ForwardConfirm . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
Packit 57988d
	if ($ReceivedEvent) {
Packit 57988d
	   print "\nSLON Received Event: " . $ReceivedEvent . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
Packit 57988d
	if ($QueueEvent) {
Packit 57988d
	   print "\nSLON Queue Event: " . $QueueEvent . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
Packit 57988d
	if ($SyncsProcessed) {
Packit 57988d
	   print "\nSLON Syncs Processing: " . $SyncsProcessed . " Time(s)\n";
Packit 57988d
	}
Packit 57988d
}
Packit 57988d
Packit 57988d
if ($Errors) {
Packit 57988d
    print "\nSLON Errors: " . $Errors . "\n";
Packit 57988d
    print @ErrorList;
Packit 57988d
}
Packit 57988d
Packit 57988d
if ($#OtherList >= 0) {
Packit 57988d
    print "\n**Unmatched Entries**\n";
Packit 57988d
    print @OtherList;
Packit 57988d
}
Packit 57988d
Packit 57988d
exit(0);
Packit 57988d
Packit 57988d
# vi: shiftwidth=3 tabstop=3 syntax=perl et
Packit 57988d
# Local Variables:
Packit 57988d
# mode: perl
Packit 57988d
# perl-indent-level: 3
Packit 57988d
# indent-tabs-mode: nil
Packit 57988d
# End: