+ fix fujitsu eternus

This commit is contained in:
garnier-quentin 2015-08-21 13:39:02 +02:00
parent 8bdff17fea
commit a01f3c80eb
7 changed files with 18 additions and 1 deletions

View File

@ -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}));

View File

@ -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});

View File

@ -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});

View File

@ -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});

View File

@ -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});

View File

@ -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});

View File

@ -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});