7. #!/bin/sh
#
# Plugin to monitor SAPM email detection and reject counter
# 2011/11/28
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ] ; then
if [ -n "$SPAMS" ] ; then
y
echo "yes"
else
echo "¥$SPAMS not defined."
fi
exit
fi
if [ "$1" = "config" ] ; then
" fi " h
echo "graph_args --base 1000 -r --lower-limit 0";
#echo "graph_args --base 1000 -r --lower-limit 0 --units-exponent 3";
echo "graph_title SPAM E il Reject Counter, by type";
h " h titl E-mails R j t C t b t "
echo "graph_category sendmail";
echo "graph_info This graph shows procmail filter counter.";
echo 'graph printf %3 0lf'
graph_printf %3.0lf
echo 'graph_vlabel SPAMs'
echo "graph_order $SPAM"
8. FIRSTSPAM=1;
for SPAM in $SPAMS; do
echo "${SPAM}.label $SPAM"
echo "${SPAM}.info procmail recipe by $SPAM"
echo "${SPAM}.type GAUGE"
if [ $FIRSTSPAM -eq 1 ] ; then
echo "${SPAM}.draw AREA"
h "${SPAM} d
export FIRSTSPAM=0;
else
echo "${SPAM} dra STACK"
"${SPAM}.draw
fi
done ;
exit
fi
for SPAM in $SPAMS ; do {
grep $SPAM /var/lib/munin/plugin-state/SpamFiltered.state
}
done;
9. 4,9,14,19,24,29,34,39,44,49,54,59 * * * *
/usr/share/munin/plugins/countSpamFiltered.sh > /var/lib/munin/plugin-
state/SpamFiltered.state
t t /S Filt d t t
#!/bin/sh
# by zembutsu@link co jp 2011/11/28
zembutsu@link.co.jp
# env spam.body spam.from spam.received
for SPAM in body from received x info Subject Body null body Nov class mailer
x-info Subject_Body_null body-Nov
messageid reply return body-DotAsia RegacyAddress Subject-Word X-Mailer-
Outlook-Forged body-Dec
do
echo -n "${SPAM}.value "
grep ^Message- /var/spool/procmail/spam.${SPAM}.log | wc -l
done