From e064e0fd9af45674af634b46caba59e43c2a16b4 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 20 Apr 2023 16:36:23 +0200 Subject: [PATCH] Fixed set for string type modules (async_string and generic_data_string) --- .../godmode/agentes/configurar_agente.php | 23 +++++++++++++++++-- .../agentes/module_manager_editor_common.php | 4 ++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 529867ad96..da75fd6342 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1519,7 +1519,7 @@ if ($update_module === true || $create_module === true) { $critical_instructions = (string) get_parameter('critical_instructions'); $warning_instructions = (string) get_parameter('warning_instructions'); $unknown_instructions = (string) get_parameter('unknown_instructions'); - // Warning thresholds + // Warning thresholds. $warning_threshold_check_type = get_parameter('warning_thresholds_checks'); if ($warning_threshold_check_type === 'normal_warning') { $percentage_warning = 0; @@ -1532,7 +1532,7 @@ if ($update_module === true || $create_module === true) { $warning_inverse = 0; } - // Critical thresholds + // Critical thresholds. $critical_threshold_check_type = get_parameter('critical_thresholds_checks'); if ($critical_threshold_check_type === 'normal_critical') { $percentage_critical = 0; @@ -1545,6 +1545,25 @@ if ($update_module === true || $create_module === true) { $critical_inverse = 0; } + // Inverse string checkbox. + if ($id_module_type === MODULE_TYPE_GENERIC_DATA_STRING || $id_module_type === MODULE_TYPE_ASYNC_STRING) { + // Warning inverse string checkbox. + $warning_string_checkbox = get_parameter('warning_inverse_string'); + if (!empty($warning_string_checkbox) && $warning_string_checkbox === 'warning_inverse_string') { + $warning_inverse = (int) get_parameter('warning_inverse_string_sent'); + } else { + $warning_inverse = 0; + } + + // Critial inverse string checkbox. + $critical_string_checkbox = get_parameter('critical_inverse_string'); + if (!empty($critical_string_checkbox) && $critical_string_checkbox === 'critical_inverse_string') { + $critical_inverse = (int) get_parameter('critical_inverse_string_sent'); + } else { + $critical_inverse = 0; + } + } + $id_category = (int) get_parameter('id_category'); $hour_from = get_parameter('hour_from'); diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 2c4f3777cb..9d28b10148 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -485,7 +485,7 @@ $basicThresholdsIntervalWarning = []; $basicThresholdsIntervalWarning[] = ''.__('Inverse interval').''; $basicThresholdsIntervalWarning[] = html_print_checkbox_switch( 'warning_inverse_string', - 1, + 'warning_inverse_string', $warning_inverse, true, $disabledBecauseInPolicy @@ -569,7 +569,7 @@ $basicThresholdsIntervalCritical = []; $basicThresholdsIntervalCritical[] = ''.__('Inverse interval').''; $basicThresholdsIntervalCritical[] = html_print_checkbox_switch( 'critical_inverse_string', - 1, + 'critical_inverse_string', $critical_inverse, true, $disabledBecauseInPolicy