Borja fix this error

This commit is contained in:
Arturo Gonzalez 2017-10-10 11:44:15 +02:00
parent 391655f6fe
commit 1e6f3a9d9b
1 changed files with 9 additions and 1 deletions

View File

@ -606,7 +606,8 @@ sub process_module_data ($$$$$$$$$$) {
'str_warning' => '', 'str_critical' => '', 'critical_instructions' => '', 'warning_instructions' => '',
'unknown_instructions' => '', 'tags' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, 'quiet' => 0,
'module_ff_interval' => 0, 'alert_template' => '', 'crontab' => '', 'min_ff_event_normal' => 0,
'min_ff_event_warning' => 0, 'min_ff_event_critical' => 0, 'ff_timeout' => 0, 'each_ff' => 0, 'module_parent' => 0};
'min_ff_event_warning' => 0, 'min_ff_event_critical' => 0, 'ff_timeout' => 0, 'each_ff' => 0, 'module_parent' => 0,
'module_parent_unlink' => 0};
# Other tags will be saved here
$module_conf->{'extended_info'} = '';
@ -718,12 +719,19 @@ sub process_module_data ($$$$$$$$$$) {
my $module_parent = $module_conf->{'module_parent'};
delete $module_conf->{'module_parent'};
# module_parent_unlink is a special case. It is not stored in the DB, but we will need it later.
my $module_parent_unlink = $module_conf->{'module_parent_unlink'};
delete $module_conf->{'module_parent_unlink'};
# Create the module
my $module_id = pandora_create_module_from_hash ($pa_config, $module_conf, $dbh);
# Restore module_parent.
$module_conf->{'module_parent'} = $module_parent;
# Restore module_parent_unlink.
$module_conf->{'module_parent_unlink'} = $module_parent_unlink;
$module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND ' . db_text('nombre') . ' = ?', $agent->{'id_agente'}, safe_input($module_name));
if (! defined ($module)) {
logger($pa_config, "Could not create module '$module_name' for agent '$agent_name'.", 3);