From 6360067e8992c1aff872cb643fe4772161051c60 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Wed, 6 Nov 2013 14:45:50 +0100 Subject: [PATCH] added support for Pure-FTPD logs in the 'ftp.pm' graph --- lib/ftp.pm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/ftp.pm b/lib/ftp.pm index 919cdc9..5cccab4 100644 --- a/lib/ftp.pm +++ b/lib/ftp.pm @@ -252,6 +252,43 @@ sub ftp_update { } } } + if(lc($ftp->{server}) eq "pure-ftpd") { + my $date = strftime("%b %e", localtime); + if(/^$date /) { + if(/ \[NOTICE\] .*? downloaded \((\d+) bytes,.*?/) { + $retr++; + $bytes_down += int($1); + } + if(/ \[NOTICE\] .*? uploaded \((\d+) bytes,.*?/) { + $stor++; + $bytes_up += int($1); + } + if(/ \[DEBUG\] Command \[mkd\] /) { + $mkd++; + } + if(/ \[DEBUG\] Command \[rmd\] /) { + $rmd++; + } + if(/ \[DEBUG\] Command \[dele\] /) { + $dele++; + } + if(/ \[DEBUG\] Command (\[mlsd\]|\[list\]) /) { + $mlsd++; + } + if(/ \[INFO\] .*? is now logged in/) { + if(/ anon password /) { # XXX + $anon_logins++; # XXX + $logins++; # XXX + } else { + $good_logins++; + $logins++; + } + } + if(/ \[WARNING\] Authentication failed for user /) { + $bad_logins++; + } + } + } } close(IN); }