1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Whitespace cleanup

* remove trailing whitespace
* remove empty lines at the end of files
This commit is contained in:
Lars Kruse 2018-08-02 02:03:42 +02:00
parent ef851f0c34
commit 17f784270a
604 changed files with 2927 additions and 2945 deletions

View file

@ -3,7 +3,7 @@
# Raphaël Droz <raphael.droz@gmail.com> - 2016-01-08
#
# Monitors the average time requests matching a custom regexp takes
# For instance monitor time execution of files in http://example.com/foo/bar,
# For instance monitor time execution of files in http://example.com/foo/bar,
# requests from google, images etc.
#
# Simply add an entry in the 'type' hashref and modify the description fields
@ -13,7 +13,7 @@
#
# NOTE: You need to add a field in your Apache logs showing time executed.
# This is normally done using the %T (seconds) or %D (microseconds)
# For instance:
# 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
#
@ -62,14 +62,14 @@ my $types = {
# any kind of request
total => {
munin_fields => {
label => 'All requests',
label => 'All requests',
draw => 'LINE2',
info => 'Average seconds per any request',
},
sum => 0,
lines => 0,
matches => sub {
return 1;
matches => sub {
return 1;
},
},
@ -82,11 +82,11 @@ my $types = {
},
sum => 0,
lines => 0,
matches => sub {
my ($fields) = @_;
my $script;
($script = $fields->[6]) =~ s/\?.*\z //mx;
return $script =~ m{ \.(png|jpe?g|gif|tiff|ilbm|tga) \z }mx;
matches => sub {
my ($fields) = @_;
my $script;
($script = $fields->[6]) =~ s/\?.*\z //mx;
return $script =~ m{ \.(png|jpe?g|gif|tiff|ilbm|tga) \z }mx;
},
},
};
@ -101,7 +101,7 @@ if (@ARGV && $ARGV[0] eq 'config') {
}
}
exit(0);
}
}
my $config_file = `ls -1 $ACCESS_LOG_PATTERN | tail -n 1`;
@ -121,13 +121,13 @@ foreach my $line (@lines) {
$types->{$type}->{'lines'}++;
}
}
}
}
}
foreach my $type (keys %{$types}) {
my $value = $types->{$type}->{'lines'} ? $types->{$type}->{'sum'} / $types->{$type}->{'lines'} : 'U';
printf "%s.value %s\n", ($type, $value);
}
}