mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Updated DataServer to accept 'alert_template' directive.
This commit is contained in:
parent
2734265f1b
commit
5679fa3f48
@ -544,7 +544,7 @@ sub process_module_data ($$$$$$$$$) {
|
|||||||
'datalist' => 0, 'status' => 0, 'unit' => 0, 'timestamp' => 0, 'module_group' => 0, 'custom_id' => '',
|
'datalist' => 0, 'status' => 0, 'unit' => 0, 'timestamp' => 0, 'module_group' => 0, 'custom_id' => '',
|
||||||
'str_warning' => '', 'str_critical' => '', 'critical_instructions' => '', 'warning_instructions' => '',
|
'str_warning' => '', 'str_critical' => '', 'critical_instructions' => '', 'warning_instructions' => '',
|
||||||
'unknown_instructions' => '', 'tags' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, 'quiet' => 0,
|
'unknown_instructions' => '', 'tags' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, 'quiet' => 0,
|
||||||
'module_ff_interval' => 0};
|
'module_ff_interval' => 0, 'alert_template' => ''};
|
||||||
|
|
||||||
# Other tags will be saved here
|
# Other tags will be saved here
|
||||||
$module_conf->{'extended_info'} = '';
|
$module_conf->{'extended_info'} = '';
|
||||||
@ -623,6 +623,12 @@ sub process_module_data ($$$$$$$$$) {
|
|||||||
delete $module_conf->{'tags'};
|
delete $module_conf->{'tags'};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $initial_alert_template = undef;
|
||||||
|
if(defined ($module_conf->{'alert_template'})) {
|
||||||
|
$initial_alert_template = $module_conf->{'alert_template'};
|
||||||
|
delete $module_conf->{'alert_template'};
|
||||||
|
}
|
||||||
|
|
||||||
# Create the module
|
# Create the module
|
||||||
my $module_id = pandora_create_module_from_hash ($pa_config, $module_conf, $dbh);
|
my $module_id = pandora_create_module_from_hash ($pa_config, $module_conf, $dbh);
|
||||||
|
|
||||||
@ -650,6 +656,16 @@ sub process_module_data ($$$$$$$$$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Assign alert-template if the spceicied one exists
|
||||||
|
if( $initial_alert_template ) {
|
||||||
|
my $id_alert_template = get_db_value ($dbh,
|
||||||
|
'SELECT id FROM talert_templates WHERE talert_templates.name = ?',
|
||||||
|
safe_input($initial_alert_template) );
|
||||||
|
|
||||||
|
if( defined($id_alert_template) ) {
|
||||||
|
pandora_create_template_module ($pa_config, $dbh, $module->{'id_agente_modulo'}, $id_alert_template);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Control NULL columns
|
# Control NULL columns
|
||||||
|
Loading…
x
Reference in New Issue
Block a user