Bug 101744 - up2date section of logwatch lists everything as undefined
Summary: up2date section of logwatch lists everything as undefined
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: logwatch
Version: 9
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-08-06 14:55 UTC by matt
Modified: 2007-04-18 16:56 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-08-20 19:06:43 UTC
Embargoed:


Attachments (Terms of Use)
unified diff of update script (for logwatch) (2.12 KB, text/plain)
2003-08-07 20:29 UTC, matt
no flags Details
up2date script for logwatch (2.17 KB, text/plain)
2003-08-12 13:47 UTC, matt
no flags Details

Description matt 2003-08-06 14:55:28 UTC
The up2date section of the logwatch mailings (RH9) lists everything that 
happened as undefined, even though the script looks like it's trying to filter 
out the frivilous stuff.  For those of us who run up2date as a cron job, this 
results in logwatch messages that are *very* long and pointless.

To fix it, you have to make changes to the regex 
in /etc/log.d/scripts/services/up2date

Here's what I did, in the while loop:

---------------

while (defined($ThisLine = <STDIN>)) {
   if ( $Debug >= 5 ) {
      print STDERR "DEBUG($DebugCounter): $ThisLine";
      $DebugCounter++;
   }
   if ( ( $ThisLine =~ /updating login info/ ) or
        ( $ThisLine =~ /Opening rpmdb in \/var\/lib\/rpm\/ with option ./ ) or
        ( $ThisLine =~ /successfully retrieved authentication token from 
up2date server/ ) or
        ( $ThisLine =~ /availablePackageList from network/ ) or
        ( $ThisLine =~ /logging into up2date server/ ) or
        ( $ThisLine =~ /A socket error occurred/ ) or
        ( $ThisLine =~ /new up2date run started/ ) or
        ( $ThisLine =~ /A protocol error occurred/ ) or
        ( $ThisLine =~ /Error communicating with server\.  The message was:/ ) 
or
        ( $ThisLine =~ /deleting \/var\/spool\/up2date\// ) ) {
      # We don't care about these
   } elsif ( $ThisLine =~ /installing packages/ ) {
      $PackageInstalled{$ThisLine}++;
   } elsif ( $ThisLine =~ /Adding packages/ ) {
      $PackageAddedToProfile{$ThisLine}++;
   } elsif ( $ThisLine =~ /Removing packages/ ) {
      $PackageRemovedFromProfile{$ThisLine}++;
   } else {
      # Report any unmatched entries...
       push @OtherList,$ThisLine;
   }
}

Comment 1 Elliot Lee 2003-08-07 18:22:17 UTC
Could you send a unified diff, please? Create a new attachment containing the patch.

Thanks...

Comment 2 matt 2003-08-07 20:29:33 UTC
Created attachment 93492 [details]
unified diff of update script (for logwatch)

Here is the unified diff of the update script (for logwatch)

Comment 3 matt 2003-08-12 13:47:07 UTC
Created attachment 93600 [details]
up2date script for logwatch

Another common log entry snuck through and was marked as 'undefined' in
logwatch.  This updated udiff catches it.

Comment 4 Elliot Lee 2004-08-20 19:02:38 UTC
Many thanks - it's in CVS now, should show up in rawhide soon.


Note You need to log in before you can comment on or make changes to this bug.