>скриптик, ключи запуска сендмейла и кроновую строчку покажи
cron:
0 8 * * * root /usr/local/send.pl
-----------------------
sendmail - классический только "-bd"
----------------------
send.pl
#!/usr/bin/perl
$|="1";
$subject="Traffic Output";
$message="";
$to_email="noc\@xxxx\.ru";
open(MSG, "ipastat -a |");
foreach (<MSG>)
{
if ((substr($_,0,1) ne "+") and (substr($_,1,1) ne "*" ))
{
if (((substr($_,0,1)) = "|") and ((substr($_,2,4) ne "Rule" )))
{
$len = length ($_);
$x = substr ($_, 2, $len-11);
open(MSG2, "ipastat -r $x |");
foreach (<MSG2>)
{
$message.=$_ ;
}
close MSG2;
#print "$x\n";
};
}
}
close MSG;
open (SENDMAIL, "|/usr/sbin/sendmail -t") || die "ERROR: Can not run sendmail";
print SENDMAIL "MIME-Version: 1.0\n";
print SENDMAIL "Content-Type: text/plain; charset=\"koi8-r\"\n";
print SENDMAIL "Content-Transfer-Encoding: 8bit\n";
print SENDMAIL "To: $to_email\n";
print SENDMAIL "From: TechSupport <noc\@xxxx\.ru>\n";
print SENDMAIL "Subject: $subject\n\n";
print SENDMAIL $message . "\n";
close (SENDMAIL);