forked from munin-monitoring/contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to configure Apache access_log field number
- Loading branch information
Raphaël Droz
committed
Oct 16, 2015
1 parent
b02fe4e
commit 2229202
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/perl -w | ||
# $Id$ | ||
# Author: Nicolas Mendoza <[email protected]> - 2008-06-18 | ||
# | ||
# Monitors the average time requests matching a custom regexp takes | ||
|
@@ -16,12 +15,16 @@ | |
# For instance: | ||
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %T %v" | ||
# Check http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats for more info | ||
# | ||
# Configurable variables | ||
# fieldno - Override the default field number | ||
#%# 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 $TIME_FIELD_INDEX = -2; # second last field | ||
my $TIME_FIELD_INDEX = exists $ENV{'fieldno'} ? $ENV{'fieldno'} : -2; # second last field | ||
|
||
my $config =<< "CONFIG" | ||
graph_title Apache average seconds last $LAST_N_REQUESTS requests | ||
|