mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Merge remote-tracking branch 'origin/ent-8321-formularios-modulos-de-tendencias-ticket-7456' into ent-7456-modulos-de-tendencias-trending-modules
This commit is contained in:
commit
5f8c5f215a
@ -1788,7 +1788,7 @@ if ($update_module) {
|
|||||||
"Fail to try update module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
|
"Fail to try update module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if ($prediction_module == 3) {
|
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC) {
|
||||||
enterprise_hook(
|
enterprise_hook(
|
||||||
'modules_create_synthetic_operations',
|
'modules_create_synthetic_operations',
|
||||||
[
|
[
|
||||||
@ -1931,7 +1931,7 @@ if ($create_module) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($prediction_module == 3 && $serialize_ops == '') {
|
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC && $serialize_ops == '') {
|
||||||
$id_agent_module = false;
|
$id_agent_module = false;
|
||||||
} else {
|
} else {
|
||||||
$id_agent_module = modules_create_agent_module(
|
$id_agent_module = modules_create_agent_module(
|
||||||
@ -1972,7 +1972,7 @@ if ($create_module) {
|
|||||||
"Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
|
"Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if ($prediction_module == 3) {
|
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC) {
|
||||||
enterprise_hook(
|
enterprise_hook(
|
||||||
'modules_create_synthetic_operations',
|
'modules_create_synthetic_operations',
|
||||||
[
|
[
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
enterprise_include_once('include/functions_policies.php');
|
enterprise_include_once('include/functions_policies.php');
|
||||||
enterprise_include_once('godmode/agentes/module_manager_editor_prediction.php');
|
enterprise_include_once('godmode/agentes/module_manager_editor_prediction.php');
|
||||||
require_once 'include/functions_agents.php';
|
require_once 'include/functions_agents.php';
|
||||||
|
ui_require_jquery_file('validate');
|
||||||
|
|
||||||
$disabledBecauseInPolicy = false;
|
$disabledBecauseInPolicy = false;
|
||||||
$disabledTextBecauseInPolicy = '';
|
$disabledTextBecauseInPolicy = '';
|
||||||
@ -38,7 +39,7 @@ if ($row !== false && is_array($row)) {
|
|||||||
|
|
||||||
switch ($prediction_module) {
|
switch ($prediction_module) {
|
||||||
case MODULE_PREDICTION_SERVICE:
|
case MODULE_PREDICTION_SERVICE:
|
||||||
$is_service = true;
|
$selected = 'service_selected';
|
||||||
$custom_integer_2 = 0;
|
$custom_integer_2 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -61,20 +62,32 @@ if ($row !== false && is_array($row)) {
|
|||||||
|
|
||||||
|
|
||||||
if (isset($first_op[1]) && $first_op[1] == 'avg') {
|
if (isset($first_op[1]) && $first_op[1] == 'avg') {
|
||||||
$is_synthetic_avg = true;
|
$selected = 'synthetic_avg_selected';
|
||||||
} else {
|
} else {
|
||||||
$is_synthetic = true;
|
$selected = 'synthetic_selected';
|
||||||
}
|
}
|
||||||
|
|
||||||
$custom_integer_1 = 0;
|
$custom_integer_1 = 0;
|
||||||
$custom_integer_2 = 0;
|
$custom_integer_2 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MODULE_PREDICTION_TRENDING:
|
||||||
|
$selected = 'trending_selected';
|
||||||
|
$prediction_module = $custom_integer_1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODULE_PREDICTION_MODULE:
|
||||||
|
$selected = 'module_selected';
|
||||||
|
$prediction_module = $custom_integer_1;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
$prediction_module = $custom_integer_1;
|
$prediction_module = $custom_integer_1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$selected = 'module_selected';
|
||||||
$custom_integer_1 = 0;
|
$custom_integer_1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +110,7 @@ $data[0] = __('Source module');
|
|||||||
$data[0] .= ui_print_help_icon('prediction_source_module', true);
|
$data[0] .= ui_print_help_icon('prediction_source_module', true);
|
||||||
$data[1] = '';
|
$data[1] = '';
|
||||||
// Services and Synthetic are an Enterprise feature.
|
// Services and Synthetic are an Enterprise feature.
|
||||||
$module_service_synthetic_selector = enterprise_hook('get_module_service_synthetic_selector', [$is_service, $is_synthetic, $is_synthetic_avg]);
|
$module_service_synthetic_selector = enterprise_hook('get_module_service_synthetic_selector', [$selected]);
|
||||||
if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
|
if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
|
||||||
$data[1] = $module_service_synthetic_selector;
|
$data[1] = $module_service_synthetic_selector;
|
||||||
|
|
||||||
@ -135,7 +148,8 @@ $params['use_hidden_input_idagent'] = true;
|
|||||||
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
|
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
|
||||||
$data[1] .= ui_print_agent_autocomplete_input($params);
|
$data[1] .= ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
$data[1] .= html_print_label(__('Module'), 'prediction_module', true);
|
$data[1] .= '<br />';
|
||||||
|
$data[1] .= html_print_label(__('Module'), 'prediction_module', true).'<br />';
|
||||||
if ($id_agente) {
|
if ($id_agente) {
|
||||||
$sql = 'SELECT id_agente_modulo, nombre
|
$sql = 'SELECT id_agente_modulo, nombre
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
@ -156,6 +170,7 @@ if ($id_agente) {
|
|||||||
$data[1] .= '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
|
$data[1] .= '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data[1] .= '<br />';
|
||||||
$data[1] .= html_print_label(__('Period'), 'custom_integer_2', true).'<br/>';
|
$data[1] .= html_print_label(__('Period'), 'custom_integer_2', true).'<br/>';
|
||||||
|
|
||||||
$periods[0] = __('Weekly');
|
$periods[0] = __('Weekly');
|
||||||
@ -187,10 +202,20 @@ if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
|
|||||||
$data[0] = '';
|
$data[0] = '';
|
||||||
$data[1] = $synthetic_module_form;
|
$data[1] = $synthetic_module_form;
|
||||||
|
|
||||||
$table_simple->colspan['synthetic_module'][1] = 3;
|
|
||||||
push_table_simple($data, 'synthetic_module');
|
push_table_simple($data, 'synthetic_module');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$trending_module_form = enterprise_hook('get_trending_module_form', [$custom_string_1]);
|
||||||
|
if ($trending_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||||
|
$data = [];
|
||||||
|
$data[0] = '';
|
||||||
|
$data[1] .= $trending_module_form;
|
||||||
|
|
||||||
|
push_table_simple($data, 'trending_module');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Netflow modules are an Enterprise feature.
|
// Netflow modules are an Enterprise feature.
|
||||||
$netflow_module_form = enterprise_hook('get_netflow_module_form', [$custom_integer_1]);
|
$netflow_module_form = enterprise_hook('get_netflow_module_form', [$custom_integer_1]);
|
||||||
if ($netflow_module_form !== ENTERPRISE_NOT_HOOK) {
|
if ($netflow_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||||
@ -214,9 +239,7 @@ unset($table_advanced->data[3]);
|
|||||||
enterprise_hook(
|
enterprise_hook(
|
||||||
'setup_services_synth',
|
'setup_services_synth',
|
||||||
[
|
[
|
||||||
$is_service,
|
$selected,
|
||||||
$is_synthetic,
|
|
||||||
$is_synthetic_avg,
|
|
||||||
$is_netflow,
|
$is_netflow,
|
||||||
$ops,
|
$ops,
|
||||||
]
|
]
|
||||||
|
@ -368,12 +368,15 @@ define('MODULE_WUX', 8);
|
|||||||
define('MODULE_WIZARD', 9);
|
define('MODULE_WIZARD', 9);
|
||||||
|
|
||||||
// Type of Modules of Prediction.
|
// Type of Modules of Prediction.
|
||||||
|
define('MODULE_PREDICTION_MODULE', 1);
|
||||||
define('MODULE_PREDICTION_SERVICE', 2);
|
define('MODULE_PREDICTION_SERVICE', 2);
|
||||||
define('MODULE_PREDICTION_SYNTHETIC', 3);
|
define('MODULE_PREDICTION_SYNTHETIC', 3);
|
||||||
define('MODULE_PREDICTION_NETFLOW', 4);
|
define('MODULE_PREDICTION_NETFLOW', 4);
|
||||||
define('MODULE_PREDICTION_CLUSTER', 5);
|
define('MODULE_PREDICTION_CLUSTER', 5);
|
||||||
define('MODULE_PREDICTION_CLUSTER_AA', 6);
|
define('MODULE_PREDICTION_CLUSTER_AA', 6);
|
||||||
define('MODULE_PREDICTION_CLUSTER_AP', 7);
|
define('MODULE_PREDICTION_CLUSTER_AP', 7);
|
||||||
|
define('MODULE_PREDICTION_TRENDING', 8);
|
||||||
|
|
||||||
|
|
||||||
// Forced agent OS ID for cluster agents.
|
// Forced agent OS ID for cluster agents.
|
||||||
define('CLUSTER_OS_ID', 100);
|
define('CLUSTER_OS_ID', 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user