Koozali.org: home of the SME Server

looking for a perl guru to convert shell script to perl

Tim Litwiller

looking for a perl guru to convert shell script to perl
« on: May 26, 2003, 07:31:27 PM »
To get the rrd contrib working with spamassassin I need to convert or rewrite this short shell script to perl

echo -e "spam:" grep "identified spam" /var/log/maillog | wc -l
echo -e "clean:" grep "clean message" /var/log/maillog | wc -l
echo -e "skipped:" grep "skipped large" /var/log/maillog | wc -l
echo -e "total:" grep "spamd[[0-9]*]: connection from" /var/log/maillog | wc -l
echo -e "processed:" grep "processing message" /var/log/maillog | wc -l

I just  need the numbers from the grep commands output each on a new line.  I don't need the labels on the lines.


Thanks.

Michiel

Re: looking for a perl guru to convert shell script to perl
« Reply #1 on: May 28, 2003, 04:53:22 AM »
Hi Tim,

I don't mind writing these lines, provided that you write a little how-to for this community. Deal?

BTW, why do you need it as Perl code? I'm not too familiar with rrd, but it's predecessor mrtg would happily take input from a script.

Regards,
Michiel

Tim Litwiller

Re: looking for a perl guru to convert shell script to perl
« Reply #2 on: May 28, 2003, 09:38:22 AM »
I settled for mrtg - it seems quite a bit easier to get working well.  I am tweaking the code and adding some other items to the reports.  You can see what I have go so far here:
http://mailhost.bccwebhosting.com/mrtg/

Now I am adding some top reports
top 10 spam recipients
top 10 spam sources

not sure what all I'll add yet.

when I get done I can let someone make an rpm or whatever

It is currently running in a ibay.  I may give it it's own space out of /opt later but want to make sure everything works fine first.