diff --git a/plugins/apache/apache_average_time_last_n_requests b/plugins/apache/apache_average_time_last_n_requests index f01bb638..04002839 100755 --- a/plugins/apache/apache_average_time_last_n_requests +++ b/plugins/apache/apache_average_time_last_n_requests @@ -18,13 +18,14 @@ # # Configurable variables # fieldno - Override the default field number +# linecount - How many last request to consider #%# family=auto use strict; -my $LAST_N_REQUESTS = 100000; # calculate based on this amount of requests -my $ACCESS_LOG_PATTERN = '/var/log/apache2/access.log.*'; # log pattern, if many it will take the last one. +my $LAST_N_REQUESTS = exists $ENV{'linecount'} ? $ENV{'linecount'} : 100000; # calculate based on this amount of requests my $TIME_FIELD_INDEX = exists $ENV{'fieldno'} ? $ENV{'fieldno'} : -2; # second last field +my $ACCESS_LOG_PATTERN = '/var/log/apache2/access.log.*'; # log pattern, if many it will take the last one. my $config =<< "CONFIG" graph_title Apache average seconds last $LAST_N_REQUESTS requests