Wed, 08 Feb 2012 20:07:00 +0200
Update version, adapt patch, correct PID writing, correct build on newer
FreeBSD releases, and most importantly introduce new patch to try to
avoid segfault caused by multiple network interfaces with the same (or
no) address. This is common when configuring bridges and tunnels.
michael@146 | 1 | Index: pflogsumm.1 |
michael@495 | 2 | --- pflogsumm.1.orig 2012-02-05 23:34:29.000000000 +0100 |
michael@495 | 3 | +++ pflogsumm.1 2012-02-06 08:49:47.000000000 +0100 |
michael@495 | 4 | @@ -171,6 +171,8 @@ |
michael@495 | 5 | \& |
michael@495 | 6 | \& \-d today generate report for just today |
michael@495 | 7 | \& \-d yesterday generate report for just "yesterday" |
michael@495 | 8 | +\& \-d YYYY-MM-DD generate report for just "YYYY-MM-DD" |
michael@495 | 9 | +\& (Really takes string Date::Parse will handle) |
michael@495 | 10 | \& |
michael@495 | 11 | \& \-\-deferral\-detail <cnt> |
michael@495 | 12 | \& |
michael@146 | 13 | Index: pflogsumm.pl |
michael@495 | 14 | --- pflogsumm.pl.orig 2012-02-05 23:25:25.000000000 +0100 |
michael@495 | 15 | +++ pflogsumm.pl 2012-02-06 20:53:39.000000000 +0100 |
michael@146 | 16 | @@ -10,7 +10,7 @@ |
michael@146 | 17 | |
michael@146 | 18 | =head1 SYNOPSIS |
michael@146 | 19 | |
michael@495 | 20 | - pflogsumm.pl -[eq] [-d <today|yesterday>] [--detail <cnt>] |
michael@495 | 21 | + pflogsumm.pl -[eq] [-d <today|yesterday|YYYY-MM-DD>] [--detail <cnt>] |
michael@495 | 22 | [--bounce-detail <cnt>] [--deferral-detail <cnt>] |
michael@495 | 23 | [-h <cnt>] [-i|--ignore-case] [--iso-date-time] [--mailq] |
michael@495 | 24 | [-m|--uucp-mung] [--no-no-msg-size] [--problems-first] |
michael@495 | 25 | @@ -43,6 +43,9 @@ |
michael@146 | 26 | |
michael@146 | 27 | -d today generate report for just today |
michael@146 | 28 | -d yesterday generate report for just "yesterday" |
michael@146 | 29 | + -d YYYY-MM-DD generate report for just "YYYY-MM-DD" |
michael@146 | 30 | + (Actually this will take any date string |
michael@146 | 31 | + parsable by the perl Date::Parse module) |
michael@146 | 32 | |
michael@495 | 33 | --deferral-detail <cnt> |
michael@146 | 34 | |
michael@495 | 35 | @@ -398,6 +401,7 @@ |
michael@146 | 36 | use strict; |
michael@146 | 37 | use locale; |
michael@146 | 38 | use Getopt::Long; |
michael@146 | 39 | +use Date::Parse; |
michael@146 | 40 | eval { require Date::Calc }; |
michael@146 | 41 | my $hasDateCalc = $@ ? 0 : 1; |
michael@146 | 42 | |
michael@495 | 43 | @@ -639,8 +643,8 @@ |
michael@495 | 44 | --$msgMon; |
michael@495 | 45 | } |
michael@495 | 46 | |
michael@495 | 47 | - unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)(?:/(?:smtps|submission))?/([^\[:]*).*?: ([^:\s]+)#o) == 2 || |
michael@146 | 48 | - (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) |
michael@495 | 49 | + unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:postfix|$syslogName)(?:/(?:smtps|submission))?/([^\[:]*).*?: ([^:\s]+)#o) == 2 || |
michael@146 | 50 | + (($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) |
michael@146 | 51 | { |
michael@146 | 52 | #print UNPROCD "$_"; |
michael@146 | 53 | next; |
michael@495 | 54 | @@ -1514,11 +1518,11 @@ |
michael@146 | 55 | # Back up to yesterday |
michael@146 | 56 | $time -= ((localtime($time))[2] + 2) * 3600; |
michael@146 | 57 | } elsif($dateOpt ne "today") { |
michael@146 | 58 | - die "$usageMsg\n"; |
michael@146 | 59 | + $time = str2time($dateOpt); |
michael@146 | 60 | } |
michael@495 | 61 | my ($t_mday, $t_mon, $t_year) = (localtime($time))[3,4,5]; |
michael@146 | 62 | |
michael@495 | 63 | - return sprintf("%s %2d", $monthNames[$t_mon], $t_mday), sprintf("%04d-%02d-%02d", $t_year+1900, $t_mon+1, $t_mday); |
michael@495 | 64 | + return sprintf("%s %02d", $monthNames[$t_mon], $t_mday), sprintf("%04d-%02d-%02d", $t_year+1900, $t_mon+1, $t_mday); |
michael@146 | 65 | } |
michael@146 | 66 | |
michael@146 | 67 | # if there's a real domain: uses that. Otherwise uses the IP addr. |