Date: Mon, 19 Aug 2002 21:41:50 +1000 From: "Leigh V" <leighv@roq.com> To: <stable@freebsd.org> Subject: ftpd log idea suggestion Message-ID: <003301c24775$6a6fe920$2d01a8c0@michael>
next in thread | raw e-mail | index | archive | help
I don't know where to post suggestions for new ideas / features so I decided to post here. I wanted to code up a byte accounter for ftp usage for the bsd ftpd server. I quickly noticed that the ftpd log file (with -ll) doesn't do enough helpful logging for ftp transfers to log for a per user byte total. It would be good if the ftpd server could log with the users name at the end or somewhere else in the ftpd log line such as my example below. normal ftpd logging with -ll Aug 3 16:52:22 mikey ftpd[92674]: put /usr/home/michael/uploadtest/icq2002a.exe = 4078456 bytes being able to start ftpd with -lll or -lle with extra username logging code Aug 3 16:52:22 mikey ftpd[92674]: put /usr/home/michael/uploadtest/icq2002a.exe = 4078456 bytes michael My limited byte counter perl script (only does total transfers without knowing individual users transfer totals) #!/usr/bin/perl open(INFILE, "/var/log/ftpd.log"); while (<INFILE>) { #s/^$domain:.*//g; if (/.*: (put)/) { /= (\d+) bytes/; $u = $1; $utotal += $u; } if (/.*: (get)/) { /= (\d+) bytes/; $d = $1; $dtotal += $d; } } close(INFILE); print "Upload total $utotal\n"; print "Download total $dtotal\n"; Any chance somebody could do this? I would really appreciate it :) Thanks all http://roq.com/bsd/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003301c24775$6a6fe920$2d01a8c0>