If anyone uses Munin and wants a graph of average amavis
TIMINGs (how
long it takes amavis to scan each email)... here's you a
plugin. If
anyone knows how to contribute this to the Munin project,
let me know, I
couldn't find anything other than joining their list and
that's too much
work, and I'm no programmer anyways, and it's a little slow
for no more
that it does. Just trying to do my part, post back if you
have any
questions or suggestions.
#!/bin/sh
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Amavis Times'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel average scan times / ms'
echo 'graph_category Mail'
echo 'averagetime.label average-time'
echo 'averagetime.type GAUGE'
echo 'averagetime.min 0'
exit 0
fi
i=$1
TTIME=1
until test "$i" = "10"; do
#You have to grep on SA check so that you want get
those
bdb_open's
LINE=`grep "SA check"
/var/run/amavisd/amavis.log|tail
-"$i"|head -1`
TIME=`expr match "$LINE"
'.*[total.(.*)ms]'`
i=`expr $i + 1`
#echo "LINE = "$LINE
#echo "TIME = "$TIME " NUMBER =
"$i
TEMPTIME=$TTIME
#TTIME=`echo "scale=8; $TIME +
$TEMPTIME"|bc`
TTIME=`expr $TIME + $TTIME`
#echo $TTIME
done
#echo "AVERAGE TIME: "`echo "scale=8; $TTIME
/ 100"|bc`
AVERAGETIME=`echo "scale=0; $TTIME / 10"|bc`
#echo $AVERAGETIME
echo "averagetime.value "$AVERAGETIME
This email and any files transmitted with it are
confidential and intended for use only by the individual or
entity named above. If you are not the intended recipient
or the employee or agent responsible for delivering this
message to the intended recipient, you are hereby notified
that any disclosure, dissemination, distribution, copying of
this communication, or unauthorized use is strictly
prohibited. Please notify us immediately by reply email and
then delete this message from your system. Please note
that any views or opinions presented in this email are
solely those of the author and do not necessarily represent
those of Randolph County Government. This email and any
file attachments have been scanned for potential viruses;
however, the recipient should check this email for the
presence of viruses and/or malicious code. Randolph County
accepts no liability for any damage transmitted via this
email.
_______________________________________________
Maia-users mailing list
Maia-users renaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users
|