Fix util_count_mail_in to update values for every supported plugins

tags/smeserver-zabbix-agent-0.4.3-1 0.4.1_el5
Daniel Berteaud 9 years ago
parent c481de7f61
commit 2a62a32732
  1. 4
      root/var/lib/zabbix/bin/util_count_mail_in
  2. 7
      root/var/lib/zabbix/bin/util_parse_mail_in

@ -6,9 +6,7 @@ LOGFILE='/var/log/qpsmtpd/current'
TMPDIR='/var/lib/zabbix/tmp/' TMPDIR='/var/lib/zabbix/tmp/'
for WHAT in dnsbl rhsbl clamav check_earlytalker check_basicheaders \ for WHAT in $($BINDIR/util_parse_mail_in keys); do
check_goodrcptto check_spamhelo total_denied spam_denied \
other_denied spam_queued queued total; do
$LOGTAIL $LOGFILE $TMPDIR/mail.in.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.in.$WHAT $LOGTAIL $LOGFILE $TMPDIR/mail.in.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.in.$WHAT
done done

@ -42,6 +42,13 @@ my %denied = (
); );
my @others = qw(total_denied spam_denied other_denied spam_queued queued total); my @others = qw(total_denied spam_denied other_denied spam_queued queued total);
# If arg is keys, just print the supported keys and exit
if ($what eq "keys"){
print join "\n", (keys %denied, @others);
exit (0)
}
my %cnt; my %cnt;
foreach (keys %denied, @others){ foreach (keys %denied, @others){
$cnt{$_} = 0; $cnt{$_} = 0;

Loading…
Cancel
Save