1 |
diff -Nur -x '*.orig' -x '*.rej' smeserver-qpsmtpd-1.2.1/root/usr/local/bin/qplogsumm.pl mezzanine_patched_smeserver-qpsmtpd-1.2.1/root/usr/local/bin/qplogsumm.pl |
2 |
--- smeserver-qpsmtpd-1.2.1/root/usr/local/bin/qplogsumm.pl 2007-06-09 13:52:32.000000000 -0600 |
3 |
+++ mezzanine_patched_smeserver-qpsmtpd-1.2.1/root/usr/local/bin/qplogsumm.pl 2007-02-27 01:45:31.000000000 -0700 |
4 |
@@ -65,7 +65,7 @@ |
5 |
chomp(); |
6 |
next if m/^#/; |
7 |
next if m/^\s*$/; |
8 |
- my ($plug_name, $plug_epoch, $plug_cumulative) = split /\s/; |
9 |
+ my ($plug_name, $plug_epoch, $plug_cumulative) = split /\s+/; |
10 |
my $c = { epoch => $plug_epoch, cum => $plug_cumulative, curr => 0 }; |
11 |
$disp{$plug_name} = $c; |
12 |
} |
13 |
@@ -91,10 +91,10 @@ |
14 |
my (@log_items) = split $FS, $log_part; |
15 |
my $disposition = $log_items[5]; |
16 |
next unless defined $disposition; |
17 |
- |
18 |
+ |
19 |
if ($disp{$disposition}) |
20 |
{ |
21 |
- $disp{$disposition}->{curr} = 1; |
22 |
+ $disp{$disposition}->{curr} += 1; |
23 |
} |
24 |
else # a new plugin -- make a note of when it first appeared |
25 |
{ |
26 |
@@ -123,9 +123,9 @@ |
27 |
# |
28 |
for my $c (keys %disp) |
29 |
{ |
30 |
- $disp{$c}->{cum} = $disp{$c}->{curr}; |
31 |
- $current_total = $disp{$c}->{curr}; |
32 |
- $cumulative_total = $disp{$c}->{cum}; |
33 |
+ $disp{$c}->{cum} += $disp{$c}->{curr}; |
34 |
+ $current_total += $disp{$c}->{curr}; |
35 |
+ $cumulative_total += $disp{$c}->{cum}; |
36 |
|
37 |
printf "%-30.30s %s %12d\n", $c, $disp{$c}->{epoch}, $disp{$c}->{cum}; |
38 |
} |
39 |
@@ -178,14 +178,14 @@ |
40 |
; |
41 |
|
42 |
|
43 |
-# |
44 |
+# |
45 |
# Output per-plugin stats |
46 |
# |
47 |
|
48 |
print "# |
49 |
# Most Recent Logfile Cumulative Totals |
50 |
# Disposition (plugin) Total Avg/Day Total Avg/Day |
51 |
-# ----------------------------------------------------------------------------\n"; |
52 |
+# ----------------------------------------------------------------------------\n"; |
53 |
|
54 |
my $printf_format = "# %-30.30s %6d %3d%% %8d %10d %3d%% %8d\n"; |
55 |
|
56 |
@@ -193,7 +193,7 @@ |
57 |
{ |
58 |
next if ($c eq 'LOGFILE_EPOCH'); |
59 |
|
60 |
- printf $printf_format, |
61 |
+ printf $printf_format, |
62 |
$c, |
63 |
$disp{$c}->{curr}, |
64 |
$disp{$c}->{curr} / $current_total * 100, |
65 |
@@ -205,7 +205,7 @@ |
66 |
} |
67 |
|
68 |
print "# ----------------------------------------------------------------------------\n"; |
69 |
-printf $printf_format, |
70 |
+printf $printf_format, |
71 |
'TOTALS', |
72 |
$current_total, |
73 |
100, |
74 |
@@ -269,4 +269,3 @@ |
75 |
$secs %= 3600; |
76 |
$phrase .= sprintf "%d mins, %d secs", ($secs / 60), ($secs % 60); |
77 |
} |
78 |
- |