diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index ec2c4a3f0f..1423f42e01 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1731,28 +1731,48 @@ sub execute_command_timeout { # $std_files = ' >> /tmp/stdout 2>> /tmp/stderr ################################################################################ sub execute_command_block { - my ($commands, $std_files, $timeout) = @_; + my ($commands, $std_files, $timeout, $retry) = @_; return 0 unless defined($commands); + my $retries = $retry; + + $retries = 1 unless looks_like_number($retries) && $retries > 0; + my $err_level = 0; $std_files = '' unless defined ($std_files); if (ref($commands) ne "ARRAY") { return 0 if $commands eq ''; - $err_level = execute_command_timeout( - "($commands) $std_files", - $timeout - ); + + do { + $err_level = execute_command_timeout( + "($commands) $std_files", + $timeout + ); + + # Do not retry if success. + last if looks_like_number($err_level) && $err_level == 0; + } while ((--$retries) > 0); } else { foreach my $comm (@{$commands}) { next unless defined($comm); - $err_level = execute_command_timeout( - "($comm) $std_files", - $timeout - ); + $retries = $retry; + $retries = 1 unless looks_like_number($retries) && $retries > 0; + do { + $err_level = execute_command_timeout( + "($comm) $std_files", + $timeout + ); + + # Do not retry if success. + last if looks_like_number($err_level) && $err_level == 0; + + } while ((--$retries) > 0); + + # Do not continue evaluating block if failed. last unless ($err_level == 0); } } diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index d75570107d..720caefc58 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -5416,6 +5416,14 @@ function get_help_info($section_name) } break; + case 'omnishell': + if ($es) { + $result .= 'Omnishell&printable=yes'; + } else { + $result .= 'Omnishell&printable=yes'; + } + break; + case 'module_type_tab': if ($es) { $result .= 'Operacion&printable=yes#Tipos_de_m.C3.B3dulos';