1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-20 01:23:36 +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 @@
use strict;
my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user";
my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user";
my $s3cmd = 's3curl.pl --id ' . $s3_id . ' http://s3.amazonaws.com/';
@ -29,14 +29,14 @@ sub get_bucket_list() {
my @bucket_list = ();
my $pos = 0;
while ($str =~ /.<Name>([\w._-]+)<\/Name>/) {
$bucket_list[$pos++] = $1;
$str = $';
}
}
return @bucket_list;
return @bucket_list;
}
@ -47,16 +47,16 @@ my ($name) = @_;
my $stats = `$s3cmd_local`;
my %res;
$res{'size'} = 0;
$res{'count'} = 0;
$res{'size'} = 0;
$res{'count'} = 0;
while ($stats =~ /.<Size>([\w._-]+)<\/Size>/) {
$stats = $';
$res{'size'} += $1;
$res{'count'}++;
}
}
return %res;
}
@ -69,32 +69,32 @@ if ( $ARGV[0] eq "config" ) {
print "graph_category cloud\n";
print "graph_vlabel items\n";
print 'graph_info Plugin available at <a href="http://www.ohardt.com/dev/munin/">http://www.ohardt.com/dev/munin/</a>' . "\n";
my @bucket_list = get_bucket_list();
my $bucket_name;
foreach $bucket_name ( @bucket_list ) {
print $bucket_name . ".label Bucket " . $bucket_name . "\n";
}
print $bucket_name . ".label Bucket " . $bucket_name . "\n";
}
exit;
}
my @bucket_list = get_bucket_list();
my $bucket_name;
foreach $bucket_name ( @bucket_list ) {
my %stats = get_bucket_stats( $bucket_name );
my %stats = get_bucket_stats( $bucket_name );
print $bucket_name . ".value " . $stats{'count'} . "\n";
}

View file

@ -3,7 +3,7 @@
use strict;
use warnings;
my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user";
my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user";
my $s3curl = "perl s3-curl/s3curl.pl --id $s3_id -- -s -S";
sub get_bucket_list()
@ -11,13 +11,13 @@ sub get_bucket_list()
my $buckets = `$s3curl http://s3.amazonaws.com`;
my $str = $buckets;
my @bucket_list;
while ($buckets =~ s/.<Name>([\w._-]+)<\/Name>//)
{
push @bucket_list, $1;
}
}
return @bucket_list;
return @bucket_list;
}
my @bucket_list = split /\s+/, ($ENV{'buckets'} || '');
@ -45,9 +45,9 @@ sub get_bucket_stats
my ($name) = @_;
my $stats = `$s3curl http://$name.s3.amazonaws.com`;
my %res;
$res{'size'} = 0;
while ($stats =~ s/.<Size>([\w._-]+)<\/Size>//)
{
$res{'size'} += $1;
@ -65,18 +65,18 @@ if ($ARGV[0] and $ARGV[0] eq "config")
print "graph_args --base 1024 -l 0\n";
print "graph_vlabel bytes\n";
print "graph_info Plugin available at <a href='https://github.com/aptivate/munin-contrib/blob/master/plugins/s3/s3_storage'>https://github.com/aptivate/munin-contrib/blob/master/plugins/s3/s3_storage</a>\n";
foreach my $bucket_name (@bucket_list)
{
print "$bucket_name.label Bucket $bucket_name\n";
}
}
exit;
}
foreach my $bucket_name (@bucket_list)
{
my %stats = get_bucket_stats($bucket_name);
my %stats = get_bucket_stats($bucket_name);
print "$bucket_name.value " . $stats{'size'} . "\n";
}