On regroupe les plugins munin dans un rpertoire commun toutes les machines
darcs-hash:20060420130121-72cb0-50f87f8f01382a2ddc9afec1b1b6e02890d8d32c.gz
This commit is contained in:
parent
674ee00ed0
commit
f672fa493b
23 changed files with 1451 additions and 0 deletions
54
munin/amavis
Executable file
54
munin/amavis
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the amavis mail filter.
|
||||
#
|
||||
# Usage: Place in /etc/lrrd/client.d/ (or link it there using ln -s)
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional)
|
||||
#
|
||||
# Config variables:
|
||||
#
|
||||
# amavislog - file where amavis logs are written
|
||||
#
|
||||
|
||||
TEMP_FILE=/tmp/lrrd-amavis
|
||||
AMAVIS_LOG=/var/log/mail/mail.info
|
||||
OFFSET=/var/lib/munin/plugin-state/amavis.offset
|
||||
LOGTAIL=`which logtail`
|
||||
|
||||
if [ "$amavislog" ]; then AMAVIS_LOG=$amavislog ; fi
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -f ${AMAVIS_LOG} -a -x ${LOGTAIL} ] ; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title Amavis filter statistics'
|
||||
echo 'graph_order virus spam_maybe spam_sure total'
|
||||
echo 'graph_vlabel nb'
|
||||
echo 'virus.label virus'
|
||||
echo 'spam_maybe.label probably spam'
|
||||
echo 'spam_sure.label surely spam'
|
||||
echo 'total.label total'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
logtail -o ${OFFSET} -f ${AMAVIS_LOG} ${OFFSET} | grep 'amavis\[.*\]:' > ${TEMP_FILE}
|
||||
total=`cat ${TEMP_FILE} | wc -l`
|
||||
virus=`grep infected ${TEMP_FILE} | wc -l`
|
||||
spamm=`grep 'Passed.*Hits: 1[0-9][.]' ${TEMP_FILE} | wc -l`
|
||||
spams=`grep 'Passed.*Hits: [2-9][0-9][0-9]*[.]' ${TEMP_FILE} | wc -l`
|
||||
|
||||
echo "virus.value ${virus}"
|
||||
echo "spam_maybe.value ${spamm}"
|
||||
echo "spam_sure.value ${spams}"
|
||||
echo "total.value ${total}"
|
Loading…
Add table
Add a link
Reference in a new issue