plugin-spamassassin: spamassassin.txt

File spamassassin.txt, 2.1 kB (added by me@homeofevil.com, 6 years ago)

File for getting Spamassassin throughput with amavisd_new (not using spamd)

Line 
1 #!/bin/sh
2 #
3 # Plugin to count the SpamAssassin troughput
4 #
5 # Contributed by David Obando - 16.11.2005
6 # edited by Cornelius Bolten - 07.11.2006
7 #
8 #
9 # Magic markers - optional - used by installation scripts and
10 # munin-config:
11 #
12 #%# family=manual
13 #%# capabilities=autoconf
14
15 if [ "$1" = "autoconf" ]; then
16         echo yes
17         exit 0
18 fi
19
20 if [ "$1" = "config" ]; then
21
22         echo 'graph_title SpamAssassin amount'
23         echo 'graph_args --base 1000 -l 0 '
24         echo 'graph_vlabel  SpamAssassin amount'
25         echo 'graph_order spam ham'
26         echo 'graph_category Mail'
27         echo 'ham.label ham'
28         echo 'ham.type DERIVE'
29         echo 'ham.min 0'
30         echo 'ham.draw LINE2'
31         echo 'spam.label spam'
32         echo 'spam.type DERIVE'
33         echo 'spam.min 0'
34         echo 'spam.draw AREA'
35         exit 0
36 fi
37
38
39
40 grep "Hits" /var/log/syslog >> /tmp/$$
41
42 echo -n "spam.value " && grep "Hits: [1-9]" /tmp/$$ | wc -l
43 echo -n "ham.value " && grep "Hits: 0" /tmp/$$ | wc -l
44
45 rm /tmp/$$