Changeset 629


Ignore:
Timestamp:
Oct 18, 2011, 11:41:49 PM (9 years ago)
Author:
ben
Message:

cleaning ci_connect, see #28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postfix-logtools/poststat/poststat

    r628 r629  
    2828
    2929my %stat = (
    30   ci_connect         => 0,
    31   ci_connect_ext     => 0,
    32   ci_connect_lan     => 0,
    33   ci_connect_local   => 0,
    34   ci_connect_mx      => 0,
    3530  ce_blacklist       => 0,
    3631  ce_hangup          => 0,
     
    4439  ce_ssl_error       => 0,
    4540  ce_timeout         => 0,
     41  ci_connect_auth    => 0,
     42  ci_connect_ext     => 0,
     43  ci_connect_ext_tot => 0,
     44  ci_connect_global  => 0,
     45  ci_connect_int_tot => 0,
     46  ci_connect_lan     => 0,
     47  ci_connect_local   => 0,
     48  ci_connect_mx      => 0,
     49  ci_connect_tot     => 0,
     50  ci_connect_wm      => 0,
    4651  grey_spf           => 0,
    4752  grey_delayed       => 0,
     
    113118        }
    114119    }
     120    $stat{ci_connect_wm}++,      next if /^([[:xdigit:]]{8,16}): client=localhost\[.*, sasl_username=/;
     121    $stat{ci_connect_auth}++,    next if /^([[:xdigit:]]{8,16}): .*, sasl_username=/;
    115122    $stat{ci_connect_local}++,   next if /^connect from localhost/;
    116     $stat{ci_connect_ext}++,     next if /^connect/;
     123    $stat{ci_connect_global}++,  next if /^connect/;
    117124
    118125    # Rejected connexions (no delivery)
     
    179186}
    180187
    181 $stat{ci_connect} += $stat{$_} foreach grep {/^ci_/} keys %stat;
    182 $stat{ce_ok} += $stat{$_} foreach grep {/^ce_/} keys %stat;
     188$stat{mi_ham}             = $stat{mi_deliver} - $stat{mi_spam} - $stat{mi_unsure};
    183189
    184 $stat{mi_ham} = $stat{mi_deliver} - $stat{mi_spam} - $stat{mi_unsure};
     190$stat{ci_connect_ext_tot} = $stat{ci_connect_global} - $stat{ci_connect_auth};
     191$stat{ci_connect_ext}     = $stat{ci_connect_ext_tot} - $stat{ci_connect_mx} - $stat{ci_connect_lan};
     192$stat{ci_connect_int_tot} = $stat{ci_connect_auth} + $stat{ci_connect_wm};
     193$stat{ci_connect_tot}     = $stat{ci_connect_ext_tot} + $stat{ci_connect_int_tot};
    185194
    186195printf("%-20s: %u\n", $_, $stat{$_}) foreach sort keys %stat;
Note: See TracChangeset for help on using the changeset viewer.