1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 02:18:08 +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

@ -21,9 +21,9 @@ This version supports monitoring:
=head1 REQUIREMENTS
- The server running this plugin must be allowed to connect to the web
- The server running this plugin must be allowed to connect to the web
server(s) you are going to monitor.
- Some perl modules:
- Some perl modules:
Time::HiRes, LWP::UserAgent, HTML::LinkExtor, LWP::ConnCache
=head1 CONFIGURATION
@ -131,7 +131,7 @@ sub read_urls{
my %urls=();
if(-r $file){
open(FILE,'<'.$file);
while (<FILE>) {
while (<FILE>) {
my $url=$_;
chomp($url);
my $id=get_id($url);
@ -150,7 +150,7 @@ sub read_cache{
my %cache=();
if(-r $file){
open(FILE,'<'.$file);
while (<FILE>) {
while (<FILE>) {
m/^(\S*)\s+(.*)$/;
$cache{ $1 } = $2;
}
@ -297,7 +297,7 @@ sub loadtime_config{
print "graph_total Total\n";
print "graph_info This graph is generated by a set of serial GETs to calculate the total time to load $urls{$id}. ";
print "Note that browsers usually fork() the GET requests, resulting in a shorter total loading time.\n";
if(keys(%cache)>0){
for my $key ( sort reverse keys %cache ){
my $value=$cache{$key};
@ -496,7 +496,7 @@ sub cache_values{
my $value=$cache{$key};
if($key =~ m/^([A-Za-z]+)\_(\S+)$/){
my $name=$2;
if ($1 eq $type){
$name=get_fieldname($name);
print $name . ".value " . $value . "\n";
@ -609,7 +609,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
exit(0);
} elsif($ARGV[0] and $ARGV[0] eq "cron") {
# This thing is run by cron and should write a cache file for munin-node to
# This thing is run by cron and should write a cache file for munin-node to
# read from
my $verbose=0;
@ -629,7 +629,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
while ( my ($id, $url) = each(%urls) ) {
$verbose && print "Fetching $url (id: $id)... \n";
$t0=0;
$status=0;
%output=();
@ -682,7 +682,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
$tag=$$link[0] . " " . $$link[1];
}
$output{"tags_" . $$link[0] . "-" . $$link[1]}+=1;
if(filter($tag)){
$verbose && print " Processing: " . $$link[0] . " " . $$link[1] . " " . $$link[2] . "\n";
@ -693,7 +693,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
}
my $suburl=$$link[2];
$t0 = [gettimeofday];
$response = $browser->get($suburl);
$output{"loadtime_" . $host} += sprintf("%.6f",tv_interval ( $t0, [gettimeofday]));
@ -720,13 +720,13 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
while ( my ($id, $value) = each(%input) ) {
$input{$id}="U";
}
# Adding new values
while ( my ($id, $value) = each(%output) ) {
$input{$id}=$value;
$verbose && print " Result: " . $id . " -> " . $value . "\n";
}
# Writing the cache
$verbose && print "Writing cache file: " . $cachefile . "... ";
open(FILE,">".$cachefile);
@ -739,7 +739,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
exit(0);
}elsif($ARGV[0] and $ARGV[0] eq "config") {
my %urls=&read_urls($url_file);
$debug && print "Reading cache file\n";
my $cachefile=$cachedir . "/" . &get_cache_file_name($scriptname,$id);
my %cache=read_cache($cachefile);
@ -773,6 +773,6 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
} else {
cache_values(\%cache, $type);
}
}
}
# vim:syntax=perl