From a10eccfda8dc0b31dbc1c14980a62a62b7074049 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Fri, 13 Jul 2018 16:39:45 +0200 Subject: [PATCH] enh aix local inodes, wrong parsing (#1057) --- os/aix/local/mode/inodes.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/os/aix/local/mode/inodes.pm b/os/aix/local/mode/inodes.pm index 1f4539d9c..04c835bee 100644 --- a/os/aix/local/mode/inodes.pm +++ b/os/aix/local/mode/inodes.pm @@ -93,9 +93,11 @@ sub manage_selection { ); $self->{inodes} = {}; my @lines = split /\n/, $stdout; + # Header not needed + shift @lines; foreach my $line (@lines) { - next if ($line !~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/); - my ($fs, $size, $used, $available, $percent, $iused, $ifree, $ipercent, $mount) = ($1, $2, $3, $4, $5, $6, $7, $8, $9); + next if ($line !~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/); + my ($fs, $size, $available, $percent, $iused, $ipercent, $mount) = ($1, $2, $3, $4, $5, $6, $7); next if (defined($self->{option_results}->{filter_fs}) && $self->{option_results}->{filter_fs} ne '' && $fs !~ /$self->{option_results}->{filter_fs}/); @@ -108,8 +110,9 @@ sub manage_selection { && $mount ne $self->{option_results}->{name}); next if ($ifree !~ m/^\d+$/ || $iused !~ m/^\d+$/); - - $self->{inodes}->{$mount} = { display => $mount, used => $iused }; + + $ipercent =~ s/%//g; + $self->{inodes}->{$mount} = { display => $mount, used => $ipercent }; } if (scalar(keys %{$self->{inodes}}) <= 0) {