From b315a1c8c253807557ef6f665f14a7990a8a6783 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Mon, 9 Mar 2015 12:44:43 +0000 Subject: [PATCH] Improve vsftpd plugin - Allow log file path to be configured via plugin-conf.d env.logfile - Add counters for successful and failed renames - Switch to use DERIVE and min 0 to fix problems during rotation and show request counts per period - Improve performance for large log files by using awk --- plugins/ftp/vsftpd | 148 +++++++++++++++++++++++++++++---------------- 1 file changed, 97 insertions(+), 51 deletions(-) diff --git a/plugins/ftp/vsftpd b/plugins/ftp/vsftpd index ea4d4016..298c5025 100755 --- a/plugins/ftp/vsftpd +++ b/plugins/ftp/vsftpd @@ -1,58 +1,104 @@ -LOGFILE=/var/log/vsftpd.log +#!/bin/bash + +logfile=${logfile:-/var/log/vsftpd.log} if [ "$1" = "autoconf" ]; then - if [ -f "${LOGFILE}" ]; then - echo yes - exit 0 - else - echo no - exit 1 - fi + if [ -f "${logfile}" ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi fi if [ "$1" = "config" ]; then - echo 'graph_title FTP Server' - echo 'graph_args --base 1000 -l 0' - echo 'graph_vlabel Requests' - echo 'graph_category FTP' - echo 'ftp_c.label connections' - echo 'ftp_sl.label successful_logins' - echo 'ftp_fl.label failed_logins' - echo 'ftp_su.label successful_uploads' - echo 'ftp_fu.label failed_uploads' - echo 'ftp_sd.label successful_downloads' - echo 'ftp_fd.label failed_downloads' - echo 'ftp_sde.label successful_deletes' - echo 'ftp_fde.label failed_deletes' - exit 0 + cat <