From 2a62a32732956813822c544d0e53b49148310d5e Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 20 Apr 2016 14:34:24 +0200 Subject: [PATCH] Fix util_count_mail_in to update values for every supported plugins --- root/var/lib/zabbix/bin/util_count_mail_in | 4 +--- root/var/lib/zabbix/bin/util_parse_mail_in | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/root/var/lib/zabbix/bin/util_count_mail_in b/root/var/lib/zabbix/bin/util_count_mail_in index 9d2e9e0..e6aa1d0 100644 --- a/root/var/lib/zabbix/bin/util_count_mail_in +++ b/root/var/lib/zabbix/bin/util_count_mail_in @@ -6,9 +6,7 @@ LOGFILE='/var/log/qpsmtpd/current' TMPDIR='/var/lib/zabbix/tmp/' -for WHAT in dnsbl rhsbl clamav check_earlytalker check_basicheaders \ - check_goodrcptto check_spamhelo total_denied spam_denied \ - other_denied spam_queued queued total; do +for WHAT in $($BINDIR/util_parse_mail_in keys); do $LOGTAIL $LOGFILE $TMPDIR/mail.in.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.in.$WHAT done diff --git a/root/var/lib/zabbix/bin/util_parse_mail_in b/root/var/lib/zabbix/bin/util_parse_mail_in index b2d1491..8205bfa 100644 --- a/root/var/lib/zabbix/bin/util_parse_mail_in +++ b/root/var/lib/zabbix/bin/util_parse_mail_in @@ -42,6 +42,13 @@ my %denied = ( ); 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; foreach (keys %denied, @others){ $cnt{$_} = 0;