SF.net SVN: logwatch:[182]

[email protected]
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Revision: 182
          http://sourceforge.net/p/logwatch/code/182
Author:   stefjakobs
Date:     2014-01-26 12:46:02 +0000 (Sun, 26 Jan 2014)
Log Message:
-----------
apply patches from current debian package:
- Support nginx logfiles in httpd
- Cope with another time format in PHP logs
- Recognize more test types from smartd logs
- Fix documentation of --logdir parameter

Modified Paths:
--------------
    conf/logfiles/http.conf
    logwatch.8
    scripts/services/php
    scripts/services/smartd

Modified: conf/logfiles/http.conf
===================================================================
--- conf/logfiles/http.conf	2014-01-21 17:53:42 UTC (rev 181)
+++ conf/logfiles/http.conf	2014-01-26 12:46:02 UTC (rev 182)
@@ -11,6 +11,8 @@
 LogFile = apache2/*access_log
 LogFile = apache-ssl/*access.log.1
 LogFile = apache-ssl/*access.log
+LogFile = nginx/*access.log
+LogFile = nginx/*access.log.1
 
 
 # If the archives are searched, here is one or more line
@@ -28,6 +30,7 @@
 Archive = apache2/*access.log-*.gz
 Archive = apache2/*access_log-*.gz
 Archive = apache-ssl/*access.log-*.gz
+Archive = nginx/*access.log.*.gz
 
 # Expand the repeats (actually just removes them now)
 *ExpandRepeats

Modified: logwatch.8
===================================================================
--- logwatch.8	2014-01-21 17:53:42 UTC (rev 181)
+++ logwatch.8	2014-01-26 12:46:02 UTC (rev 182)
@@ -97,7 +97,7 @@
 .IP "\fB--logdir\fR directory"
 Look in
 .I directory
-for log subdirectories or log files instead of the default directory.
+for log subdirectories or log files first before looking in the default directories.
 .IP "\fB--hostlimit\fR host1,host2"
 Limit report to hostname - host1, host2.
 .IP "\fB--hostname\fR hostname"

Modified: scripts/services/php
===================================================================
--- scripts/services/php	2014-01-21 17:53:42 UTC (rev 181)
+++ scripts/services/php	2014-01-26 12:46:02 UTC (rev 182)
@@ -62,7 +62,9 @@
 while(<>) {
     my $line = $_;
     # skipping messages that are not within the requested range
-    next unless $line =~ /^\[($filter)\]/o;
+    # the last part of the regex matches optionally occurring specification
+    # of timezones, either in Continent/City or abbrevations like UTC
+    next unless $line =~ /^\[($filter)(?: \w+(?:\/\w+)?)?\]/o;
     $1 =~ /(\d+)-(\w+)-(\d+) (\d+):(\d+):(\d+)/;
     my $time;
 

Modified: scripts/services/smartd
===================================================================
--- scripts/services/smartd	2014-01-21 17:53:42 UTC (rev 181)
+++ scripts/services/smartd	2014-01-26 12:46:02 UTC (rev 182)
@@ -54,7 +54,7 @@
 my %NotInDatabase = ();
 my %CantMonitor = ();
 my $UnableToMonitor = 0;
-my %SelfTest = ();
+my %DriveTest = ();
 my %Failed = ();
 my %OtherList = ();
 my $DLine = 0;
@@ -162,8 +162,8 @@
    } elsif ( my ($Device, $Num) = ($ThisLine =~ /^Device: ([^,]+), (\d+) Offline uncorrectable sectors/) ) {
       $Offsectors{$Device}++;
       $NumOffsectors{$Device} = $Num;
-   } elsif ( my ($Device,$TestType) = ($ThisLine =~ /^Device: ([^,]+), starting scheduled (Short|Long) Self-Test/) ) {
-      $SelfTest{$Device}{$TestType}++;
+   } elsif ( my ($Device,$TestType) = ($ThisLine =~ /^Device: ([^,]+), starting scheduled ((?:Short|Long|Conveyance|Selective) Self-|Offline Immediate )Test/) ) {
+      $DriveTest{$Device}{$TestType}++;
    } elsif ( my ($Device,$AttribType,$Code,$Name) = ($ThisLine =~ /^Device: ([^,]+), Failed SMART ([A-Za-z]+) Attribute: ([0-9]+) ([A-Za-z_]+)/)) {
       $Failed{$Device}{"$AttribType attribute: $Name ($Code)"}++;
    } elsif ( my ($Device, $Text) = ($ThisLine =~ /^Device: ([^,]+), failed (.*)$/) ) {
@@ -313,11 +313,11 @@
    }
 }
 
-if (keys %SelfTest) {
-   foreach my $Device (sort keys %SelfTest) {
+if (keys %DriveTest) {
+   foreach my $Device (sort keys %DriveTest) {
       print "\n$Device :\n";
-      foreach my $Type (sort keys %{$SelfTest{$Device}}) {
-         print "   started scheduled $Type self-test " . $SelfTest{$Device}{$Type} . " Time(s)\n";
+      foreach my $Type (sort keys %{$DriveTest{$Device}}) {
+         print "   started scheduled ${Type}Test " . $DriveTest{$Device}{$Type} . " Time(s)\n";
       }
    }
 }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.