You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Jake Colman <co...@ppllc.com> on 2005/06/06 17:20:47 UTC

OT: Mail/Spam Stats and MRTG

Does anyone have any suggestions for using mrtg to produce a graph showing
the amount of received email and how much of it was flagged as spam?

I am using mrtg, sendmail, and procmail on all the same server.

Thanks!

...Jake

-- 
Jake Colman
Sr. Applications Developer
Principia Partners LLC
Harborside Financial Center
1001 Plaza Two
Jersey City, NJ 07311
(201) 209-2467
www.principiapartners.com


Re: OT: Mail/Spam Stats and MRTG

Posted by Jason Philbrook <jp...@saucer.midcoast.com>.
We uses these scripts with mrtg/postfix/clamav/spamassassin/procmail to 
sample the logfiles each time mrtg runs.

mc1:/usr/local/mis/sbin # cat sacleanratio.mrtg 
#!/bin/bash
tail -n 1000 /var/log/mail |grep spamd |grep "clean message" |wc -l |sed -e "s/"
tail -n 1000 /var/log/mail |grep spamd |grep "seconds, "|wc -l |sed -e "s/ *//g"
echo 0
echo 0
mc1:/usr/local/mis/sbin # cat saspamratio.mrtg 
#!/bin/bash
tail -n 1000 /var/log/mail |grep spamd |grep "identified spam" |wc -l |sed -e ""
tail -n 1000 /var/log/mail |grep spamd |grep "seconds, "|wc -l |sed -e "s/ *//g"
echo 0
echo 0
mc1:/usr/local/mis/sbin # cat satime.mrtg 
#!/bin/bash
tail -n 5000 /var/log/mail |grep spamd |grep seconds |cut -d: -f5 |cut -d" " -ftdc -e "1000 `awk -f /usr/local/mis/sbin/avg.awk  ~/num.txt` * p"
echo 0
echo 0
echo 0
mc1:/usr/local/mis/sbin # cat saratio.mrtg 
#!/bin/bash
tail -n 1000 /var/log/mail |grep spamd |grep "clean message" |wc -l |sed -e "s/"
tail -n 1000 /var/log/mail |grep spamd |grep "identified spam" |wc -l |sed -e ""
echo 0
echo 0

mc1:/usr/local/mis/sbin # more ../etc/mrtg/load.cfg 
WorkDir: /usr/local/apache/htdocs/mrtg
WithPeak[_]: ymw
#Options[_]: growright, gauge, nopercent, nolegend, nobanner, noo
#AbsMax[_]: 40
XSize[_]: 500
YSize[_]: 160

Target[load]: `cat /proc/loadavg |cut  -d" " -f1 ;echo 0 ; echo 0; echo 
0`
ShortLegend[load]: 1 min.
YLegend[load]: CPU Load
Options[load]: growright, gauge, nopercent, nolegend, nobanner, noo
MaxBytes[load]: 30
Unscaled[load]: d
Title[load]: CPU Load Analysis
PageTop[load]: <H3>Load Analysis</H3>

Target[spamd]: `/usr/local/mis/sbin/satime.mrtg`
YLegend[spamd]: MilliSeconds
Options[spamd]: growright, gauge, nopercent, nolegend, nobanner, noo
ShortLegend[spamd]: Millisec
MaxBytes[spamd]: 20000
Title[spamd]: Spamd processing time averages
PageTop[spamd]: <H3>spamd processing time average</H3>

Target[cratio]: `/usr/local/mis/sbin/sacleanratio.mrtg`
YLegend[cratio]: Messages
Options[cratio]: growright, gauge, nopercent, nolegend, nobanner, 
dorelpercent, 
integer
ShortLegend[cratio]: Messages
Legend1[cratio]: Clean Messages
Legend2[cratio]: Total Messages
LegendI[cratio]: Clean Messages
LegendO[cratio]: Total Messages
MaxBytes[cratio]: 500
Title[cratio]: Clean versus total email
PageTop[cratio]: <H3>Clean versus total email</H3>


Target[sratio]: `/usr/local/mis/sbin/saspamratio.mrtg`
YLegend[sratio]: Messages
Options[sratio]: growright, gauge, nopercent, nolegend, nobanner, 
dorelpercent, 
integer
ShortLegend[sratio]: Messages
Legend1[sratio]: Spam Messages
Legend2[sratio]: Total Messages
LegendI[sratio]: Spam Messages
LegendO[sratio]: Total Messages
MaxBytes[sratio]: 500
Title[sratio]: Spam versus total email
PageTop[sratio]: <H3>Spam versus total email</H3>


On Mon, Jun 06, 2005 at 11:20:47AM -0400, Jake Colman wrote:
> 
> Does anyone have any suggestions for using mrtg to produce a graph showing
> the amount of received email and how much of it was flagged as spam?
> 
> I am using mrtg, sendmail, and procmail on all the same server.
> 
> Thanks!
> 
> ...Jake
> 
> -- 
> Jake Colman
> Sr. Applications Developer
> Principia Partners LLC
> Harborside Financial Center
> 1001 Plaza Two
> Jersey City, NJ 07311
> (201) 209-2467
> www.principiapartners.com

-- 
/*
Jason Philbrook   |   Midcoast Internet Solutions - Internet Access,
    KB1IOJ        |  Hosting, and TCP-IP Networks for Midcoast Maine
 http://f64.nu/   |             http://www.midcoast.com/
*/

Re: OT: Mail/Spam Stats and MRTG

Posted by Patrick von der Hagen <pa...@wudika.de>.
Jake Colman wrote:
> Does anyone have any suggestions for using mrtg to produce a graph showing
> the amount of received email and how much of it was flagged as spam?
> 
> I am using mrtg, sendmail, and procmail on all the same server.
Have a look at http://munin.sf.net
It gathers data from several plugins and does nice statistics using 
mrtg. Either use it or have a look at the sendmail and 
spamassassin-plugins to get ideas how to analyse you logfiles and push 
everything to rrdtool.
-- 
CU,
    Patrick.

Re: OT: Mail/Spam Stats and MRTG

Posted by Ed Kasky <ed...@esson.net>.
At 08:20 AM Monday, 6/6/2005, Jake Colman wrote -=>

>Does anyone have any suggestions for using mrtg to produce a graph showing
>the amount of received email and how much of it was flagged as spam?
>
>I am using mrtg, sendmail, and procmail on all the same server.

Try this:

http://users.2z.net/rpuhek/scripts_public/spamd/

Ed Kasky
~~~~~~~~~
Randomly Generated Quote (274 of 477):
Difficulties increase the nearer we approach our goal.
    -Goethe (1749-1832)


Re: Mail/Spam Stats and MRTG

Posted by Mike Jackson <mj...@barking-dog.net>.
> Does anyone have any suggestions for using mrtg to produce a graph showing
> the amount of received email and how much of it was flagged as spam?
>
> I am using mrtg, sendmail, and procmail on all the same server.

This wouldn't be perfect, but I'd write a script in the scripting language 
of your choice that reads in the mail log, counts the lines containing 
"checking message", counts the lines containing "identified spam", then 
spits out both numbers in an MRTG-compatible format. I can't remember the 
exact config syntax, but I think you can tell MRTG that this is going to be 
a constantly-incrementing number, not the diff between this run and the 
previous run. If that's not possible, then you'd have to have your script do 
the math.

(I'd count the "checking message" lines rather than a message count from 
Sendmail because the latter would count messages sent out from the server as 
well, not just the messages SA saw.) 


Re: OT: Mail/Spam Stats and MRTG

Posted by Paolo Cravero as2594 <pc...@as2594.net>.
Jake Colman wrote:
> Does anyone have any suggestions for using mrtg to produce a graph showing
> the amount of received email and how much of it was flagged as spam?
> 
> I am using mrtg, sendmail, and procmail on all the same server.

You need to write an external "program" (script) for the SNMPdeamon on 
the server. It returns a single number computed out of sendmail/procmail 
maillog of whatever you want to monitor. Then use MRTG to manipulate the 
value (cumulative vs last-5-minutes).

Here we use Cricket to monitor SpamAssassin performance in 
quasi-real-time. But I didn't set it up myself.

HTHAL,
Paolo

---
SpamAssassin-based email antispam/antivirus solutions
     Italian/English-to/from-Croatian translations