Hmmm, couldn't use that one at work. The mail.info file growse about 5 GBytes/Day - so all 5 inutes parsing 4 times through that file would kill the server. I'd rather add logtail, and redefine the Options.
Same for apache logs etc. :) Cheers Joerg On Thursday 16 October 2003 18:52, Jack Coates wrote: > Made some modifications to an existing script set. I was trying to > extend pfixmrtg but had a lot of trouble with the bdb stuff. > > 1) put this kludgy mofo into /usr/local/sbin/spam-stats > #!/bin/bash > # > # spam-stats -- print counts of clean and spammy messages > # from spamassassin. > > echo -e "spam:" `grep "identified spam" /var/log/mail/info | wc -l` > echo -e "clean:" `grep "clean message" /var/log/mail/info | wc -l` > echo -e "skipped:" `grep "skipped large" /var/log/mail/info | wc -l` > echo -e "total:" `grep "spamd[[0-9]*]: connection from" > /var/log/mail/info | wc -l` > echo -e "processed:" `grep "processing message" /var/log/mail/info | wc > -l` > > 2) put this less kludgy attachment into /usr/local/sbin/spamstats.pl. > > 3) edit your mrtg.cfg and add something like: > # show number of messages that were spam, total number of > # messages _processed_ by spamd > Target[spam]: `/usr/local/sbin/spamstats.pl localhost spam` > Directory[spam]: felix > MaxBytes[spam]: 100000 > Options[spam]: gauge, nopercent, growright > Title[spam]: Spam Statistics > PageTop[spam]: <H1>SA-identified spam, SA-processed email</H1> > WithPeak[spam]: dwmy > YLegend[spam]: No. of messages > ShortLegend[spam]: messages > LegendI[spam]: spam: > LegendO[spam]: total: -- It is not doing the thing we like to do, but liking the thing we have to do, that makes life blessed. -- Goethe ------------------------------------------------------------------------ | Joerg Mertin : [EMAIL PROTECTED] (Home)| | in Neuchâtel/Schweiz : [EMAIL PROTECTED] (Alt1)| | Stardust's LiNUX System : [EMAIL PROTECTED] (Alt2)| | Web: http://www.solsys.org: Voice & Fax: +41(0)32 / 725 52 54 | ------------------------------------------------------------------------ PGP Fingerprint: AF0F FB75 997B 025F 4538 5AD6 9888 5D97 170B 8B7A
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com