<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Mail Statistics from Spamassassin with MRTG</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi list,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I have found some scripts on the web about MRTG / Spamassassin and wanted to implement this into my server.</FONT>
<BR><FONT SIZE=2 FACE="Arial">This is the linux shell script ("linux_spamassassin") I use (displays first the number of spam and then the number of good mail):</FONT></P>
<P><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">#!/bin/sh</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">grep "identified spam" /var/log/mail.info | wc -l | tr -d ' '</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">grep "clean message" /var/log/mail.info | wc -l | tr -d ' '</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">echo none</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">echo none</FONT></B>
</P>
<P><FONT SIZE=2 FACE="Arial">I can execute this by hand and it works fine:</FONT>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">WEBSER:~ # ./linux_spamassassin</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">17</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">2323</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">none</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">none</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">WEBSER:~ #</FONT></B>
</P>
<P><FONT SIZE=2 FACE="Arial">So I setup a config file for mrtg:</FONT><B></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Target[mail]: `/root/linux_spamassassin`</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">MaxBytes[mail]: 10000000000000</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Options[mail]: growright</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">...</FONT></B>
</P>
<P><FONT SIZE=2 FACE="Arial">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:</FONT>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">1184740210 17 2323</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">1184740210 0 0 0 0</FONT></B>
<BR><B><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">1184739909 0 0 0 0</FONT></B>
</P>
<P><FONT SIZE=2 FACE="Arial">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?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Could anyone who has spamassassin setup test this script?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Thanks…</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Lucas</FONT>
</P>
</BODY>
</HTML>