diff --git a/centreon/plugins/misc.pm b/centreon/plugins/misc.pm index 7139a6a68..463a95ddc 100644 --- a/centreon/plugins/misc.pm +++ b/centreon/plugins/misc.pm @@ -140,13 +140,24 @@ sub execute { $sub_cmd .= $options{command_path} . '/' if (defined($options{command_path})); $sub_cmd .= $options{command} . ' ' if (defined($options{command})); $sub_cmd .= $options{command_options} if (defined($options{command_options})); - ($lerror, $stdout, $exit_code) = backtick( + # On some equipment. Cannot get a pseudo terminal + if (defined($options{ssh_pipe}) && $options{ssh_pipe} == 1) { + $cmd = "echo '" . $sub_cmd . "' | " . $cmd . ' ' . join(" ", @$args); + ($lerror, $stdout, $exit_code) = backtick( + command => $cmd, + timeout => $options{options}->{timeout}, + wait_exit => 1, + redirect_stderr => 1 + ); + } else { + ($lerror, $stdout, $exit_code) = backtick( command => $cmd, arguments => [@$args, $sub_cmd], timeout => $options{options}->{timeout}, wait_exit => 1, redirect_stderr => 1 ); + } } else { $cmd = 'sudo ' if (defined($options{sudo})); $cmd .= $options{command_path} . '/' if (defined($options{command_path})); diff --git a/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm b/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm index 54f48bd33..471603653 100644 --- a/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm +++ b/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm @@ -169,6 +169,7 @@ sub manage_selection { my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, + ssh_pipe => 1, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options}); diff --git a/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm b/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm index 3facda27b..b6f6761a4 100644 --- a/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm +++ b/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm @@ -113,6 +113,7 @@ sub run { my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, + ssh_pipe => 1, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options}); diff --git a/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm b/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm index c93e152aa..c171dd872 100644 --- a/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm +++ b/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm @@ -199,6 +199,7 @@ sub manage_selection { my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, + ssh_pipe => 1, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options}); diff --git a/storage/fujitsu/eternus/dx/ssh/mode/psu.pm b/storage/fujitsu/eternus/dx/ssh/mode/psu.pm index 47d7d0fd9..ee49f1400 100644 --- a/storage/fujitsu/eternus/dx/ssh/mode/psu.pm +++ b/storage/fujitsu/eternus/dx/ssh/mode/psu.pm @@ -107,6 +107,7 @@ sub run { my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, + ssh_pipe => 1, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options}); diff --git a/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm b/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm index 2392dfa7b..665ddb156 100644 --- a/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm +++ b/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm @@ -264,6 +264,7 @@ sub manage_selection { my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, + ssh_pipe => 1, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options}); diff --git a/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm b/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm index 31669fdcf..34b1e8453 100644 --- a/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm +++ b/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm @@ -259,6 +259,7 @@ sub manage_selection { my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, + ssh_pipe => 1, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options});