Being thankful for SpamAssassin and it's sharing community of add-ons and
improvements, I'll share my mrtg scripts for SA in case anyone wants to
graph their SA performance.

The first graph, called "load" just graphs the CPU load on the computer.  
Not SA specific, but handy since SA is pretty computing intensive.  This
is linux specific.

The second graph called "spamd" keeps track of average time spent by SA on
a message. SA syslogs the amount of time spent, so the script satime.mrtg
tails the logfile and computes an average using awk. My server is
massively busy, so I tail 5000 lines. If your box is not very busy use a
smaller number, but then again, if it's not very busy, performance
measurement is probably not a major concern either.

It would not take much creativity for an admin to add scripts and sections 
to graph scores or percentage of spam versus clean messages based on 
syslog'd information if they were interested.

Thanks,
Jason

mc3:~ # cat /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
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
ShortLegend[spamd]: Millisec
MaxBytes[spamd]: 20000
Title[spamd]: Spamd processing time averages
PageTop[spamd]: <H3>spamd processing time average</H3>

mc3:~ # cat /usr/local/mis/sbin/satime.mrtg
#!/bin/bash
tail -n 5000 /var/log/mail |grep spamd |grep seconds |cut -d: -f5 |cut -d" " -f3 
>~/num.txt
dc -e "1000 `awk -f /usr/local/mis/sbin/avg.awk  ~/num.txt` * p"
echo 0
echo 0
echo 0

mc3:~ # cat /usr/local/mis/sbin/avg.awk
BEGIN {
 n = ""
}

{
 sum += $n
}

END {
  average = sum/NR

  print average
}



in crontab:
4-59/5 * * * * /usr/bin/mrtg /etc/mrtg/load.cfg

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


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to