[mrtg] Mail Statistics from Spamassassin with MRTG

Pfirter Lukas lp at rpag.ch
Wed Jul 18 08:45:20 CEST 2007


Hi list,

I have found some scripts on the web about MRTG / Spamassassin and
wanted to implement this into my server.
This is the linux shell script ("linux_spamassassin") I use (displays
first the number of spam and then the number of good mail):
#!/bin/sh
grep "identified spam" /var/log/mail.info | wc -l | tr -d ' '
grep "clean message" /var/log/mail.info | wc -l | tr -d ' '
echo none
echo none

I can execute this by hand and it works fine:
WEBSER:~ # ./linux_spamassassin
17
2323
none
none
WEBSER:~ #

So I setup a config file for mrtg:
Target[mail]: `/root/linux_spamassassin`
MaxBytes[mail]: 10000000000000
Options[mail]: growright
...

When I run mrtg, it seems to work right but the data files mail.log and
mail.old only have numbers in the first line:
1184740210 17 2323
1184740210 0 0 0 0
1184739909 0 0 0 0

These numbers are slowly incrementing as mails come into my server
(there should be about one mail per 5 minutes average). But nothing is
displayed in the graphs and no numbers are put into the log file below
the first line. What am I missing? I know I can't use the gauge option
as this is not a "current status" option but a incrementing number. Is
the number of incoming mail to my server too small?
Could anyone who has spamassassin setup test this script?
Thanks...

Lucas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20070718/623e817b/attachment.html 


More information about the mrtg mailing list