Merge branch 'ent-7978-timeout-en-ejecuciones-de-plugins' into 'develop'

Add a timeout message for Plug-in modules.

See merge request artica/pandorafms!4656
This commit is contained in:
Daniel Rodriguez 2022-02-07 17:19:51 +00:00
commit 279ddb0eeb
1 changed files with 9 additions and 1 deletions

View File

@ -297,7 +297,7 @@ sub data_consumer ($$) {
elsif ($ReturnCode == 2){
$module_data = 0;
}
elsif ($ReturnCode == 3 || $ReturnCode == 124){
elsif ($ReturnCode == 3 || $ReturnCode == 124 || $ReturnCode == 137){
# 124 should be a exit code of the timeout command (command times out)
$module_data = ''; # not defined = Uknown
}
@ -305,7 +305,15 @@ sub data_consumer ($$) {
$module_data = 1;
}
}
} else {
# Timeout.
if ($ReturnCode == 124 || $ReturnCode == 137) {
logger($pa_config, "Plug-in module " . $module->{'nombre'} . " for agent " . $agent->{'nombre'} . " timed out.", 3);
pandora_update_module_on_error ($pa_config, $module, $dbh);
return;
}
}
if (! defined $module_data || $module_data eq '') {
logger (
$pa_config,