Changeset 509


Ignore:
Timestamp:
Jun 5, 2010, 8:22:08 PM (10 years ago)
Author:
obibi
Message:

Improvements on the count of the input connections, see #12.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postfix-logtools/poststat/poststat

    r488 r509  
    1111use strict;
    1212use warnings;
     13#use Getopt::Long;
    1314
    1415my @probes = qw/
    15   ci_connect_mx
     16  ci_connect
     17  ci_connect_int
    1618  ci_connect_ext
    1719  ci_connect_local
     
    3739my %stat;
    3840
    39 while (<>) {
     41while (<STDIN>) {
    4042  next if !s/.* postfix\/(.*?)\[\d+\]: //;
    4143  my $prog = $1;
     
    4446  if ($prog eq 'smtpd') {
    4547    # Incoming SMTP connexions
    46     $stat{ci_connect_mx}++,      next if /^connect from ns3\.bearstech\.net/;
     48    # TODO: Define the MX backups servers (use getopt).
     49    # TODO: Edit the anonymizer to keep the MX backups servers in the logs.
     50    $stat{ci_connect_int}++,      next if /^connect from tooty\.bearstech\.com/;
    4751    $stat{ci_connect_ext}++,     next if /^connect/;
    48     # Don't count local connections, most of the are reinjections from a/v
     52    # Don't count local connections, most of them are reinjections from a/v
    4953    #$stat{ci_connect_local}++,   next if /^connect from localhost/;
    5054
     
    9599}
    96100
     101$stat{ci_connect} = $stat{ci_connect_int} + $stat{ci_connect_ext};
    97102printf("%-20s: %u\n", $_, $stat{$_}) foreach sort keys %stat;
Note: See TracChangeset for help on using the changeset viewer.