(plugin) os::linux::local - fix improper AIX field descriptor (#4495)

This commit is contained in:
qgarnier 2023-06-30 12:42:37 +02:00 committed by GitHub
parent be1a646699
commit cdde685baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -199,16 +199,16 @@ sub parse_output {
my ($stdout) = $options{custom}->execute_command(
command => 'ps',
command_options => '-e -o state -o ===%t===%p===%P=== -o comm:50 -o ===%a -w 2>&1'
command_options => '-e -o state -o etime -o pid -o ppid -o comm:50 -o %a -w 2>&1'
);
$self->{global} = { processes => 0 };
$self->{processes} = {};
my @lines = split /\n/, $stdout;
my $line = shift @lines;
my @lines = split(/\n/, $stdout);
my $line = shift(@lines);
foreach my $line (@lines) {
next if ($line !~ /^(.*?)===(.*?)===(.*?)===(.*?)===(.*?)===(.*)$/);
next if ($line !~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.{50})\s+(.*)$/);
my ($state, $elapsed, $pid, $ppid, $cmd, $args) = (
centreon::plugins::misc::trim($1),
centreon::plugins::misc::trim($2),