--- sysFs.pm 2003/09/09 13:44:04 1.3
+++ sysFs.pm 2003/09/10 12:29:06 1.4
@@ -37,7 +37,8 @@
my ($self, $obj) = @_;
if ($self->{-ctx}->{-platform}->id() =~ m/FreeBSD/i) {
- my @sysFsInfoENTRY = undef;
+ my @sysFsENTRY = undef;
+ my $n = 0;
# local workspace
my $out; my $raw; my $n2i; my @dat; my $new;
@@ -52,6 +53,7 @@
@dat = split(/ +/, $line);
if (@dat[$n2i->{Filesystem}] =~ m|^/dev/|) {
$new = {};
+ $new->{sysFsIndex} = $n;
if (defined $n2i->{Filesystem}) {
$new->{sysFsDevice} = @dat[$n2i->{Filesystem}];
}
@@ -67,20 +69,21 @@
if (defined $new->{sysFsMax} and defined $new->{sysFsFree}) {
$new->{sysFsUsed} = $new->{sysFsMax} - $new->{sysFsFree};
}
- push(@sysFsInfoENTRY, $new);
+ $sysFsENTRY[$n++] = $new;
}
}
}
- if ($obj->{-name} =~ m/\.sysFsInfoENTRY\.([^.]+)\.(\d+)$/) {
+ if ($obj->{-name} =~ m/\.sysFsENTRY\.([^.]+)\.(\d+)$/) {
my $col = $1;
my $row = ($2 > 0 ? $2 - 1 : 0);
$self->{-ctx}->{-log}->printf(4, "col=%s row=%s", $col, $row);
- $obj->{-value} = @sysFsInfoENTRY[$row]->{$col} if (defined @sysFsInfoENTRY[$row] and defined @sysFsInfoENTRY[$row]->{$col});
+ $obj->{-value} = $sysFsENTRY[$row]->{$col} if (defined $sysFsENTRY[$row] and defined $sysFsENTRY[$row]->{$col});
}
}
elsif ($self->{-ctx}->{-platform}->id() =~ m/Linux/i) {
- my @sysFsInfoENTRY = undef;
+ my @sysFsENTRY = undef;
+ my $n = 0;
# local workspace
my $out; my $raw; my $n2i; my @dat; my $new;
@@ -95,6 +98,7 @@
@dat = split(/ +/, $line);
if (@dat[$n2i->{Filesystem}] =~ m|^/dev/|) {
$new = {};
+ $new->{sysFsIndex} = $n;
if (defined $n2i->{Filesystem}) {
$new->{sysFsDevice} = @dat[$n2i->{Filesystem}];
}
@@ -110,20 +114,21 @@
if (defined $new->{sysFsMax} and defined $new->{sysFsFree}) {
$new->{sysFsUsed} = $new->{sysFsMax} - $new->{sysFsFree};
}
- push(@sysFsInfoENTRY, $new);
+ $sysFsENTRY[$n++] = $new;
}
}
}
- if ($obj->{-name} =~ m/\.sysFsInfoENTRY\.([^.]+)\.(\d+)$/) {
+ if ($obj->{-name} =~ m/\.sysFsENTRY\.([^.]+)\.(\d+)$/) {
my $col = $1;
my $row = ($2 > 0 ? $2 - 1 : 0);
$self->{-ctx}->{-log}->printf(4, "col=%s row=%s", $col, $row);
- $obj->{-value} = @sysFsInfoENTRY[$row]->{$col} if (defined @sysFsInfoENTRY[$row] and defined @sysFsInfoENTRY[$row]->{$col});
+ $obj->{-value} = $sysFsENTRY[$row]->{$col} if (defined $sysFsENTRY[$row] and defined $sysFsENTRY[$row]->{$col});
}
}
elsif($self->{-ctx}->{-platform}->id() =~ m/SunOS/i) {
- my @sysFsInfoENTRY = undef;
+ my @sysFsENTRY = undef;
+ my $n = 0;
# local workspace
my $out; my $raw; my $n2i; my @dat; my $new;
@@ -138,6 +143,7 @@
@dat = split(/ +/, $line);
if (@dat[$n2i->{Filesystem}] =~ m|^/dev/|) {
$new = {};
+ $new->{sysFsIndex} = $n;
if (defined $n2i->{Filesystem}) {
$new->{sysFsDevice} = @dat[$n2i->{Filesystem}];
}
@@ -153,16 +159,16 @@
if (defined $new->{sysFsMax} and defined $new->{sysFsFree}) {
$new->{sysFsUsed} = $new->{sysFsMax} - $new->{sysFsFree};
}
- push(@sysFsInfoENTRY, $new);
+ $sysFsENTRY[$n++] = $new;
}
}
}
- if ($obj->{-name} =~ m/\.sysFsInfoENTRY\.([^.]+)\.(\d+)$/) {
+ if ($obj->{-name} =~ m/\.sysFsENTRY\.([^.]+)\.(\d+)$/) {
my $col = $1;
my $row = ($2 > 0 ? $2 - 1 : 0);
$self->{-ctx}->{-log}->printf(4, "col=%s row=%s", $col, $row);
- $obj->{-value} = @sysFsInfoENTRY[$row]->{$col} if (defined @sysFsInfoENTRY[$row] and defined @sysFsInfoENTRY[$row]->{$col});
+ $obj->{-value} = $sysFsENTRY[$row]->{$col} if (defined $sysFsENTRY[$row] and defined $sysFsENTRY[$row]->{$col});
}
}
return;
|