diff --git a/plugins/amavis/amavis_awk b/plugins/amavis/amavis_awk index 04b6e279..7a3741fc 100755 --- a/plugins/amavis/amavis_awk +++ b/plugins/amavis/amavis_awk @@ -69,15 +69,13 @@ fi $LOGTAIL ${MAIL_LOG} $STATEFILE | \ -awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; total= 0 } +awk 'BEGIN { clean_count=0; passed_spam_count=0; blocked_spam_count=0; infected_count=0; total=0 } { - if (index($0, "Passed CLEAN")) { na++ ; total++ } - else if (index($0, "Passed SPAMMY")) { nb++ ; total++ } - else if (index($0, "Blocked SPAMMY")) { nc++ ; total++ } - else if (index($0, "INFECTED")) { nd++ ; total++ } + if (index($0, "Passed CLEAN")) { clean_count++ ; total++ } + else if (index($0, "Passed SPAMMY")) { passed_spam_count++ ; total++ } + else if (index($0, "Blocked SPAMMY")) { blocked_spam_count++ ; total++ } + else if (index($0, "INFECTED")) { infected_count++ ; total++ } } - END { print "clean.value " na"\np_spam.value " nb"\nb_spam.value " nc"\nvirus.value " nd"\ntotal.value " total }' - - + END { print "clean.value " clean_count"\np_spam.value " passed_spam_count"\nb_spam.value " blocked_spam_count"\nvirus.value " infected_count"\ntotal.value " total }'