Do not add module_parent to extended_info.

This commit is contained in:
Ramon Novoa 2017-02-16 11:43:23 +01:00
parent 9ddee676b6
commit 9fef698df4
1 changed files with 8 additions and 1 deletions

View File

@ -615,7 +615,7 @@ 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};
'min_ff_event_warning' => 0, 'min_ff_event_critical' => 0, 'ff_timeout' => 0, 'each_ff' => 0, 'module_parent' => 0};
# Other tags will be saved here
$module_conf->{'extended_info'} = '';
@ -723,9 +723,16 @@ sub process_module_data ($$$$$$$$$$) {
}
delete $module_conf->{'crontab'};
# module_parent is a special case. It is not stored in the DB, but we will need it later.
my $module_parent = $module_conf->{'module_parent'};
delete $module_conf->{'module_parent'};
# 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;
$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);