mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 10:58:12 +00:00
whitespace cleanup
This commit is contained in:
parent
fdcc9f79a7
commit
5ebdabf44a
1 changed files with 20 additions and 25 deletions
|
@ -95,7 +95,7 @@ my $properties = {
|
||||||
|
|
||||||
type => "Read-only property that identifies the dataset type as"
|
type => "Read-only property that identifies the dataset type as"
|
||||||
." filesystem (file system or clone), volume, or"
|
." filesystem (file system or clone), volume, or"
|
||||||
." snapshot.",
|
." snapshot.",
|
||||||
|
|
||||||
used => "Read-only property that identifies the amount of disk"
|
used => "Read-only property that identifies the amount of disk"
|
||||||
." space consumed by a dataset and all its descendents.",
|
." space consumed by a dataset and all its descendents.",
|
||||||
|
@ -142,7 +142,6 @@ my @order = (
|
||||||
);
|
);
|
||||||
|
|
||||||
sub do_collect {
|
sub do_collect {
|
||||||
|
|
||||||
my $fslist=(`$zfsexec list -H -r -o name $zpool`);
|
my $fslist=(`$zfsexec list -H -r -o name $zpool`);
|
||||||
|
|
||||||
my @params = join(',',( keys %{$properties} ));
|
my @params = join(',',( keys %{$properties} ));
|
||||||
|
@ -150,8 +149,8 @@ sub do_collect {
|
||||||
my $fsget="$zfsexec get -H -p @params";
|
my $fsget="$zfsexec get -H -p @params";
|
||||||
|
|
||||||
foreach my $fsname (split(/\n/,$fslist)) {
|
foreach my $fsname (split(/\n/,$fslist)) {
|
||||||
foreach my $line (split(/\n/, `$fsget $fsname` )) {
|
foreach my $line (split(/\n/, `$fsget $fsname` )) {
|
||||||
my ($name, $key, $value, undef ) = (split(/\t/,$line));
|
my ($name, $key, $value, undef ) = (split(/\t/,$line));
|
||||||
($name =~ s/\//_/g);
|
($name =~ s/\//_/g);
|
||||||
$filesystems->{$name}->{$key}=$value;
|
$filesystems->{$name}->{$key}=$value;
|
||||||
}
|
}
|
||||||
|
@ -224,20 +223,18 @@ sub do_fetch_fs {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub do_config {
|
sub do_config {
|
||||||
|
|
||||||
foreach my $fs ( sort keys %{$filesystems}) {
|
foreach my $fs ( sort keys %{$filesystems}) {
|
||||||
do_config_fs($fs);
|
do_config_fs($fs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub do_autoconf {
|
sub do_autoconf {
|
||||||
|
if (`which $zpoolexec 2>/dev/null` =~ m{^/}) {
|
||||||
if (`which $zpoolexec 2>/dev/null` =~ m{^/}) {
|
print "yes\n";
|
||||||
print "yes\n";
|
} else {
|
||||||
} else {
|
print "no ($zpoolexec could not be found)\n";
|
||||||
print "no ($zpoolexec could not be found)\n";
|
}
|
||||||
}
|
exit 0;
|
||||||
exit 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -247,7 +244,6 @@ sub do_suggest {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub do_fetch {
|
sub do_fetch {
|
||||||
|
|
||||||
foreach my $fs ( sort keys %{$filesystems}) {
|
foreach my $fs ( sort keys %{$filesystems}) {
|
||||||
do_fetch_fs($fs);
|
do_fetch_fs($fs);
|
||||||
}
|
}
|
||||||
|
@ -260,15 +256,14 @@ sub do_setpool {
|
||||||
elsif ($0 =~ /zfs_usage_(.+)*$/) {
|
elsif ($0 =~ /zfs_usage_(.+)*$/) {
|
||||||
$zpool = $1;
|
$zpool = $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ARGV[0]) {
|
if ($ARGV[0]) {
|
||||||
if ($ARGV[0] eq "config") {
|
if ($ARGV[0] eq "config") {
|
||||||
do_setpool();
|
do_setpool();
|
||||||
do_collect();
|
do_collect();
|
||||||
do_config();
|
do_config();
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
elsif ($ARGV[0] eq "autoconf") {
|
elsif ($ARGV[0] eq "autoconf") {
|
||||||
do_autoconf();
|
do_autoconf();
|
||||||
|
@ -280,9 +275,9 @@ if ($ARGV[0]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
do_setpool();
|
do_setpool();
|
||||||
do_collect();
|
do_collect();
|
||||||
do_fetch();
|
do_fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue