Subject: Q: reporting utilities?

From: [email-masked] (Hassan Schroeder)
Date: Thu, 28 Dec 1995 11:06:23 -0800

In the interests of not re-inventing the wheel -

Has anyone written any analysis utilities for the wu-ftpd transfer log?

I'm primarily interested in identifying transfers that failed (i.e.,
byte count transferred != byte count of the source document). 

H*
= Hassan Schroeder = [email-masked] ======| 415-473-7106 (voice)=
= Webmaster, Java Products Group =============| 800-408-9864 (pager)=
=[  Java(tm): Programming for the Internet - http://java.sun.com/  ]=

---

From: "JB.PJB.PROJO.COM" <[email-masked]>
Date: Fri, 29 Dec 1995 09:11:42 -0500

Here is a little perl script that notifies interested parties when a guest 
account drops off them a file. 
Not a stat program but it shows one way to notify certin folks or departments 
when a file has arrived. 

#!/usr/local/bin/perl 
$XFRFILE = "/var/adm/ftpxferlog"; 
%modes = ('a',"ascii",'b',"binary"); 
%action = ('C',"Compressed",'U',"Uncompressed",'T',"Tar'ed",'_',"None"); 
%direction = ('o',"Outgoing",'i',"Incoming"); 
%access_mode = ('a',"anonymous",'g',"guest",'r',"real"); 
%auth_mode = ('0',"none",'1',"RFC931"); 
# the mail list should have a guest account  followed by zero or more mail 
user id's enclosed in quotes 
%mail_list = ('guest1',"larry",'guest2',"moe",'guest3',"curly schemp"); 
sub parse_log_line 
        { 

($dow,$mon,$day,$time,$year,$ttime,$rhost,$fsize,$file,$mode,$aflag,$flow,$amod
e,$user,$service,$auth,$id)=split(' ',$line); 
        } 
sub mail_log 
        { 
        print MAIL "\n*** Ftp Transaction Report from $HOST ***\n"; 
        print MAIL "$dow $mon $day $time $year\n\n"; 
        print MAIL "Account:        $user\n"; 
        print MAIL "Remote Host:    $rhost\n"; 
        print MAIL "File Name:      $file\n"; 
        print MAIL "File Size:      $fsize bytes\n"; 
        print MAIL "Transfer Time:  $ttime secs.\n"; 
        print MAIL "Direction:      $direction{$flow}\n"; 
        print MAIL "Transfer mode:  $modes{$mode}\n"; 
        print MAIL "Access Mode:    $access_mode{$amode}\n"; 
        print MAIL "Special action: $action{$aflag}\n"; 
       print MAIL "Authentication: $auth_mode{$auth}\n\n"; 
        } 
$HOST = `uname -n`; 
open(XFRLOG,"tail -1lf $XFRFILE|") || die "Can't open $XFRFILE"; 
<XFRLOG>;  # kludge to get right to the end of file -0lf above doesn't seem to 
work 
while ($line = <XFRLOG> ) 
        { 
        chop($line); 
        &parse_log_line($line) ; 
	# notify interested parties and sysadmin by mail of transfers 
        open(MAIL,"|/usr/ucb/mail -s \"ftp transfer log \($HOST\)\" 
$mail_list{$user}\@domain.com sysadmin\@domain.com ") || die "Can't open mail"; 
        &mail_log ; 
        close(MAIL); 
        } 
 
John Ballem 
[email-masked] 

Subject: Q: reporting utilities?
From: "Hassan Schroeder" <[email-masked]>
To: [email-masked]
Date: 28 Dec 95 11:06:23

H*