On Mon, 19 Jan 2004, Kayne Kruse wrote:
> >
> > Suggestions, improvements anyone?
> >
> > Best Regards,
> > Fredrik Hansen
>
> I'd like a copy of your polling script for cacti. ;D
>
Sure, its below:
Be sure to modify your MDLOG tags so they match.
Then call the script like: mail.pl /var/log/maillog
/Fredrik
#!/usr/bin/perl
use POSIX qw(strftime);
my $mail_counter = 0;
my $spam_counter = 0;
my $virus_counter = 0;
$date = strftime "%b %e %H:", localtime;
while (<>) {
if (m|$date|) {
if ($_ =~ /mail_in/){
$mail_counter++;
}
if ($_ =~ /spam/){
$spam_counter++;
}
if ($_ =~ /virus/){
$virus_counter++;
}
} else {
}
}
printf("mail_in:%d mail_spam:%d
mail_virus:%d",$mail_counter,$spam_counter,$virus_counter);
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang