Removed autofill proxi in auth server

Former-commit-id: 448622c39e6697ead1a3a515da3e573abfc0384d
This commit is contained in:
manuel 2019-04-16 12:37:06 +02:00
parent 8bf92720ee
commit bac1e44608
2 changed files with 113 additions and 91 deletions

View File

@ -23,10 +23,10 @@ ui_require_javascript_file('encode_decode_base64');
check_login();
// Get tab parameter to check ACL in each tabs
// Get tab parameter to check ACL in each tabs.
$tab = get_parameter('tab', 'main');
// See if id_agente is set (either POST or GET, otherwise -1
// See if id_agente is set (either POST or GET, otherwise -1.
$id_agente = (int) get_parameter('id_agente');
$group = 0;
$all_groups = [$group];
@ -46,6 +46,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
break;
default:
// Default.
break;
}
@ -63,11 +64,11 @@ require_once 'include/functions_modules.php';
require_once 'include/functions_alerts.php';
require_once 'include/functions_reporting.php';
// Get passed variables
// Get passed variables.
$alerttype = get_parameter('alerttype');
$id_agent_module = (int) get_parameter('id_agent_module');
// Init vars
// Init vars.
$descripcion = '';
$comentarios = '';
$campo_1 = '';
@ -137,7 +138,7 @@ $alert_priority = 0;
$server_name = '';
$grupo = 0;
$id_os = 9;
// Windows
// Windows.
$custom_id = '';
$cascade_protection = 0;
$cascade_protection_modules = 0;
@ -156,7 +157,7 @@ $cps = 0;
$create_agent = (bool) get_parameter('create_agent');
$module_macros = [];
// Create agent
// Create agent.
if ($create_agent) {
$mssg_warning = 0;
$alias_safe_output = io_safe_output(get_parameter('alias', ''));
@ -165,14 +166,14 @@ if ($create_agent) {
$direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0);
// safe_output only validate ip
// Safe_output only validate ip.
$direccion_agente = trim(io_safe_output($direccion_agente));
if (!validate_address($direccion_agente)) {
$mssg_warning = 1;
}
// safe-input before validate ip
// Safe-input before validate ip.
$direccion_agente = io_safe_input($direccion_agente);
$nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
@ -208,7 +209,7 @@ if ($create_agent) {
$field_values[$field['id_field']] = (string) get_parameter_post('customvalue_'.$field['id_field'], '');
}
// Check if agent exists (BUG WC-50518-2)
// Check if agent exists (BUG WC-50518-2).
if ($alias == '') {
$agent_creation_error = __('No agent alias specified');
$agent_created_ok = 0;
@ -256,7 +257,7 @@ if ($create_agent) {
}
if ($id_agente !== false) {
// Create custom fields for this agent
// Create custom fields for this agent.
foreach ($field_values as $key => $value) {
$update_custom = db_process_sql_insert(
'tagent_custom_data',
@ -268,7 +269,7 @@ if ($create_agent) {
);
}
// Create address for this agent in taddress
// Create address for this agent in taddress.
if ($direccion_agente != '') {
agents_add_address($id_agente, $direccion_agente);
}
@ -311,7 +312,7 @@ if ($create_agent) {
"Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}';
// Create the secondary groups
// Create the secondary groups.
enterprise_hook(
'agents_update_secondary_groups',
[
@ -341,14 +342,14 @@ if ($create_agent) {
}
}
// Show tabs
// Show tabs.
$img_style = [
'class' => 'top',
'width' => 16,
];
if ($id_agente) {
// View tab
// View tab.
$viewtab['text'] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
if ($tab == 'view') {
@ -359,7 +360,7 @@ if ($id_agente) {
$viewtab['operation'] = 1;
// Main tab
// Main tab.
$maintab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup')]).'</a>';
if ($tab == 'main') {
$maintab['active'] = true;
@ -367,7 +368,7 @@ if ($id_agente) {
$maintab['active'] = false;
}
// Module tab
// Module tab.
$moduletab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_modules.png', true, ['title' => __('Modules')]).'</a>';
if ($tab == 'module') {
@ -376,7 +377,7 @@ if ($id_agente) {
$moduletab['active'] = false;
}
// Alert tab
// Alert tab.
$alerttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_alerts.png', true, ['title' => __('Alerts')]).'</a>';
if ($tab == 'alert') {
@ -385,7 +386,7 @@ if ($id_agente) {
$alerttab['active'] = false;
}
// Template tab
// Template tab.
$templatetab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'.html_print_image('images/templates.png', true, ['title' => __('Module templates')]).'</a>';
if ($tab == 'template') {
@ -395,7 +396,7 @@ if ($id_agente) {
}
// Inventory
// Inventory.
$inventorytab = enterprise_hook('inventory_tab');
if ($inventorytab == -1) {
@ -412,7 +413,7 @@ if ($id_agente) {
}
if ($has_remote_conf === true) {
// Plugins
// Plugins.
$pluginstab = enterprise_hook('plugins_tab');
if ($pluginstab == -1) {
$pluginstab = '';
@ -421,21 +422,21 @@ if ($id_agente) {
$pluginstab = '';
}
// Collection
// Collection.
$collectiontab = enterprise_hook('collection_tab');
if ($collectiontab == -1) {
$collectiontab = '';
}
// Group tab
// Group tab.
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image('images/group.png', true, [ 'title' => __('Group')]).'</a>';
$grouptab['active'] = false;
$gistab = [];
// GIS tab
// GIS tab.
if ($config['activate_gis']) {
$gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'.html_print_image('images/gm_gis.png', true, [ 'title' => __('GIS data')]).'</a>';
@ -446,10 +447,10 @@ if ($id_agente) {
}
}
// Agent wizard tab
// Agent wizard tab.
$agent_wizard['text'] = '<a href="javascript:" class="agent_wizard_tab">'.html_print_image('images/wand_agent.png', true, [ 'title' => __('Agent wizard')]).'</a>';
// Hidden subtab layer
// Hidden subtab layer.
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu" style="display:none; float:none;">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_snmp.png', true, [ 'title' => __('SNMP Wizard')]).'</a>';
@ -471,7 +472,7 @@ if ($id_agente) {
$total_incidents = agents_get_count_incidents($id_agente);
// Incident tab
// Incident tab.
if ($total_incidents > 0) {
$incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=incident&amp;id_agente='.$id_agente.'">'.html_print_image('images/book_edit.png', true, ['title' => __('Incidents')]).'</a>';
@ -532,7 +533,7 @@ if ($id_agente) {
];
}
// Only if the agent has incidents associated show incidents tab
// Only if the agent has incidents associated show incidents tab.
if ($total_incidents) {
$onheader['incident'] = $incidenttab;
}
@ -545,7 +546,7 @@ if ($id_agente) {
];
}
// Extensions tabs
// Extensions tabs.
foreach ($config['extensions'] as $extension) {
if (isset($extension['extension_god_tab'])) {
if (check_acl($config['id_user'], $group, $extension['extension_god_tab']['acl'])) {
@ -574,7 +575,7 @@ if ($id_agente) {
}
$help_header = '';
// This add information to the header
// This add information to the header.
switch ($tab) {
case 'main':
$tab_description = '- '.__('Setup');
@ -639,6 +640,10 @@ if ($id_agente) {
case 'wmi_explorer':
$tab_description = '- '.__('WMI Wizard');
break;
default:
// Default.
break;
}
break;
@ -649,10 +654,15 @@ if ($id_agente) {
$tab_description = '- '.__('SNMP explorer');
$help_header = 'snmp_explorer';
break;
default:
// Default.
break;
}
break;
default:
// Default.
break;
}
@ -668,7 +678,7 @@ if ($id_agente) {
$config['item_title_size_text']
);
} else {
// Create agent
// Create agent.
ui_print_page_header(
__('Agent manager'),
'images/bricks.png',
@ -682,12 +692,12 @@ $delete_conf_file = (bool) get_parameter('delete_conf_file');
if ($delete_conf_file) {
$correct = false;
// Delete remote configuration
// Delete remote configuration.
if (isset($config['remote_config'])) {
$agent_md5 = md5(io_safe_output(agents_get_name($id_agente, 'none')), false);
if (file_exists($config['remote_config'].'/md5/'.$agent_md5.'.md5')) {
// Agent remote configuration editor
// Agent remote configuration editor.
$file_name = $config['remote_config'].'/conf/'.$agent_md5.'.conf';
$correct = @unlink($file_name);
@ -703,7 +713,7 @@ if ($delete_conf_file) {
);
}
// Show agent creation results
// Show agent creation results.
if ($create_agent) {
if (!isset($agent_creation_error)) {
$agent_creation_error = __('Could not be created');
@ -720,17 +730,17 @@ if ($create_agent) {
}
}
// Fix / Normalize module data
// Fix / Normalize module data.
if (isset($_GET['fix_module'])) {
$id_module = get_parameter_get('fix_module', 0);
// get info about this module
// Get info about this module.
$media = reporting_get_agentmodule_data_average($id_module, 30758400);
// Get average over the year
// Get average over the year.
$media *= 1.3;
$error = '';
$result = true;
// If the value of media is 0 or something went wrong, don't delete
// If the value of media is 0 or something went wrong, don't delete.
if (!empty($media)) {
$where = [
'datos' => '>'.$media,
@ -759,9 +769,9 @@ if (isset($_GET['fix_module'])) {
$update_agent = (bool) get_parameter('update_agent');
// Update AGENT
// Update AGENT.
if ($update_agent) {
// if modified some agent paramenter
// If modified some agent paramenter.
$mssg_warning = 0;
$id_agente = (int) get_parameter_post('id_agente');
$nombre_agente = str_replace('`', '&lsquo;', (string) get_parameter_post('agente', ''));
@ -770,14 +780,14 @@ if ($update_agent) {
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0);
// safe_output only validate ip
// Safe_output only validate ip.
$direccion_agente = trim(io_safe_output($direccion_agente));
if (!validate_address($direccion_agente)) {
$mssg_warning = 1;
}
// safe-input before validate ip
// Safe-input before validate ip.
$direccion_agente = io_safe_input($direccion_agente);
$address_list = (string) get_parameter_post('address_list', '');
@ -789,7 +799,7 @@ if ($update_agent) {
// If we selected another IP in the drop down list to be 'primary':
// a) field is not the same as selectbox
// b) field has not changed from current IP
// c) selectbox is not the current IP
// c) selectbox is not the current IP.
if (!empty($address_list)) {
$direccion_agente = $address_list;
}
@ -799,7 +809,7 @@ if ($update_agent) {
$intervalo = (int) get_parameter_post('intervalo', SECONDS_5MINUTES);
$comentarios = str_replace('`', '&lsquo;', (string) get_parameter_post('comentarios', ''));
$modo = (int) get_parameter_post('modo', 0);
// Mode: Learning, Normal or Autodisabled
// Mode: Learning, Normal or Autodisabled.
$id_os = (int) get_parameter_post('id_os');
$disabled = (bool) get_parameter_post('disabled');
$server_name = (string) get_parameter_post('server_name', '');
@ -837,7 +847,7 @@ if ($update_agent) {
);
if ($old_value === false) {
// Create custom field if not exist
// Create custom field if not exist.
$update_custom = db_process_sql_insert(
'tagent_custom_data',
[
@ -866,10 +876,10 @@ if ($update_agent) {
ui_print_warning_message(__('The ip or dns name entered cannot be resolved'));
}
// Verify if there is another agent with the same name but different ID
// Verify if there is another agent with the same name but different ID.
if ($alias == '') {
ui_print_error_message(__('No agent alias specified'));
// If there is an agent with the same name, but a different ID
// If there is an agent with the same name, but a different ID.
}
if ($unique_ip && $direccion_agente != '') {
@ -882,7 +892,7 @@ if ($update_agent) {
} else if ($exists_ip) {
ui_print_error_message(__('Duplicate main IP address'));
} else {
// If different IP is specified than previous, add the IP
// If different IP is specified than previous, add the IP.
if ($direccion_agente != ''
&& $direccion_agente != agents_get_address($id_agente)
) {
@ -890,7 +900,7 @@ if ($update_agent) {
}
$action_delete_ip = (bool) get_parameter('delete_ip', false);
// If IP is set for deletion, delete first
// If IP is set for deletion, delete first.
if ($action_delete_ip) {
$delete_ip = get_parameter_post('address_list');
@ -939,11 +949,11 @@ if ($update_agent) {
__('There was a problem updating the agent')
);
} else {
// Update the agent from the metaconsole cache
// Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php');
enterprise_hook('agent_update_from_cache', [$id_agente, $values, $server_name]);
// Update the configuration files
// Update the configuration files.
if ($old_values['intervalo'] != $intervalo) {
enterprise_hook(
'config_agents_update_config_token',
@ -1057,9 +1067,9 @@ if ($update_agent) {
}
// Read agent data
// This should be at the end of all operation checks, to read the changes - $id_agente doesn't have to be retrieved
// This should be at the end of all operation checks, to read the changes - $id_agente doesn't have to be retrieved.
if ($id_agente) {
// This has been done in the beginning of the page, but if an agent was created, this id might change
// This has been done in the beginning of the page, but if an agent was created, this id might change.
$id_grupo = agents_get_agent_group($id_agente);
if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && !check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) {
db_pandora_audit('ACL Violation', 'Trying to admin an agent without access');
@ -1069,13 +1079,13 @@ if ($id_agente) {
$agent = db_get_row('tagente', 'id_agente', $id_agente);
if (empty($agent)) {
// Close out the page
// Close out the page.
ui_print_error_message(__('There was a problem loading the agent'));
return;
}
$intervalo = $agent['intervalo'];
// Define interval in seconds
// Define interval in seconds.
$nombre_agente = $agent['nombre'];
if (empty($alias)) {
$alias = $agent['alias'];
@ -1111,11 +1121,11 @@ $create_module = (bool) get_parameter('create_module');
$delete_module = (bool) get_parameter('delete_module');
$enable_module = (int) get_parameter('enable_module');
$disable_module = (int) get_parameter('disable_module');
// It is the id_agent_module to duplicate
// It is the id_agent_module to duplicate.
$duplicate_module = (int) get_parameter('duplicate_module');
$edit_module = (bool) get_parameter('edit_module');
// GET DATA for MODULE UPDATE OR MODULE INSERT
// GET DATA for MODULE UPDATE OR MODULE INSERT.
if ($update_module || $create_module) {
$id_grupo = agents_get_agent_group($id_agente);
$all_groups = agents_get_all_groups_agent($id_agente, $id_grupo);
@ -1138,7 +1148,7 @@ if ($update_module || $create_module) {
// Don't read as (float) because it lost it's decimals when put into MySQL
// where are very big and PHP uses scientific notation, p.e:
// 1.23E-10 is 0.000000000123
// 1.23E-10 is 0.000000000123.
$post_process = (string) get_parameter('post_process', 0.0);
if (get_parameter('prediction_module')) {
$prediction_module = 1;
@ -1160,7 +1170,7 @@ if ($update_module || $create_module) {
$tcp_send = (string) get_parameter('tcp_send');
$tcp_rcv = (string) get_parameter('tcp_rcv');
$tcp_port = (int) get_parameter('tcp_port');
// Correction in order to not insert 0 as port
// Correction in order to not insert 0 as port.
$is_port_empty = get_parameter('tcp_port', '');
if ($is_port_empty === '') {
$tcp_port = null;
@ -1186,7 +1196,7 @@ if ($update_module || $create_module) {
}
if ($id_module_type == 25) {
// web analysis, from MODULE_WUX
// web analysis, from MODULE_WUX.
$custom_string_1 = base64_encode((string) get_parameter('custom_string_1', $custom_string_1_default));
$custom_integer_1 = (int) get_parameter('custom_integer_1', $custom_integer_1_default);
} else {
@ -1198,7 +1208,7 @@ if ($update_module || $create_module) {
$custom_string_3 = (string) get_parameter('custom_string_3', $custom_string_3_default);
$custom_integer_2 = (int) get_parameter('custom_integer_2', 0);
// Get macros
// Get macros.
$macros = (string) get_parameter('macros');
if (!empty($macros)) {
@ -1225,7 +1235,7 @@ if ($update_module || $create_module) {
if (preg_match('/^module_name\s*(.*)/', $line, $match)) {
$new_configuration_data .= 'module_name '.io_safe_output($name)."\n";
}
// We delete from conf all the module macros starting with _field
// We delete from conf all the module macros starting with _field.
else if (!preg_match('/^module_macro_field.*/', $line, $match)) {
$new_configuration_data .= "$line\n";
}
@ -1269,16 +1279,16 @@ if ($update_module || $create_module) {
$snmp_community = (string) get_parameter('snmp_community');
$snmp_oid = (string) get_parameter('snmp_oid');
// Change double quotes by single
// Change double quotes by single.
$snmp_oid = preg_replace('/&quot;/', '&#039;', $snmp_oid);
if (empty($snmp_oid)) {
// The user did not set any OID manually but did a SNMP walk
// The user did not set any OID manually but did a SNMP walk.
$snmp_oid = (string) get_parameter('select_snmp_oid');
}
if ($id_module_type >= 15 && $id_module_type <= 18) {
// New support for snmp v3
// New support for snmp v3.
$tcp_send = (string) get_parameter('snmp_version');
$plugin_user = (string) get_parameter('snmp3_auth_user');
$plugin_pass = io_input_password((string) get_parameter('snmp3_auth_pass'));
@ -1300,7 +1310,11 @@ if ($update_module || $create_module) {
$parent_module_id = (int) get_parameter('parent_module_id');
$ip_target = (string) get_parameter('ip_target');
if ($ip_target == '') {
// No autofill if the module is a webserver module.
if ($ip_target == ''
&& $id_module_type < MODULE_WEBSERVER_CHECK_LATENCY
&& $id_module_type > MODULE_WEBSERVER_RETRIEVE_STRING_DATA
) {
$ip_target = 'auto';
}
@ -1410,7 +1424,7 @@ if ($update_module || $create_module) {
$module_macro_values = (array) get_parameter('module_macro_values', []);
$module_macros = modules_get_module_macros_json($module_macro_names, $module_macro_values);
// Make changes in the conf file if necessary
// Make changes in the conf file if necessary.
enterprise_include_once('include/functions_config_agents.php');
$module_in_policy = enterprise_hook('policies_is_module_in_policy', [$id_agent_module]);
@ -1431,7 +1445,7 @@ if ($update_module || $create_module) {
}
}
// MODULE UPDATE
// MODULE UPDATE.
if ($update_module) {
$id_agent_module = (int) get_parameter('id_agent_module');
@ -1517,7 +1531,7 @@ if ($update_module) {
}
}
// In local modules, the interval is updated by agent
// In local modules, the interval is updated by agent.
$module_kind = (int) get_parameter('moduletype');
if ($module_kind == MODULE_DATA) {
unset($values['module_interval']);
@ -1586,7 +1600,7 @@ if ($update_module) {
);
}
// Update the module interval
// Update the module interval.
cron_update_module_interval($id_agent_module, $cron_interval);
ui_print_success_message(__('Module successfully updated'));
@ -1606,7 +1620,7 @@ if ($update_module) {
}
// MODULE INSERT
// =================
// =================.
if ($create_module) {
if (isset($_POST['combo_snmp_oid'])) {
$combo_snmp_oid = get_parameter_post('combo_snmp_oid');
@ -1619,7 +1633,7 @@ if ($create_module) {
$id_module = (int) get_parameter('id_module');
// Commented because can't create prediction modules
/*
if ($id_module == 5) {
If ($id_module == 5) {
$prediction_module = 1;
}
*/
@ -1630,6 +1644,10 @@ if ($create_module) {
$description = ' ';
}
break;
default:
// Default.
break;
}
$values = [
@ -1755,7 +1773,7 @@ if ($create_module) {
enterprise_hook('modules_create_synthetic_operations', [$id_agent_module, $serialize_ops]);
}
// Update the module interval
// Update the module interval.
cron_update_module_interval($id_agent_module, $cron_interval);
ui_print_success_message(__('Module added successfully'));
@ -1776,7 +1794,7 @@ if ($create_module) {
}
// MODULE DELETION
// =================
// =================.
if ($delete_module) {
// DELETE agent module !
$id_borrar_modulo = (int) get_parameter_get('delete_module', 0);
@ -1812,7 +1830,7 @@ if ($delete_module) {
enterprise_include_once('include/functions_config_agents.php');
enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_borrar_modulo), modules_get_agentmodule_name($id_borrar_modulo)]);
// Init transaction
// Init transaction.
$error = 0;
// First delete from tagente_modulo -> if not successful, increment
@ -1831,7 +1849,7 @@ if ($delete_module) {
if ($result === false) {
$error++;
} else {
// Set flag to update module status count
// Set flag to update module status count.
db_process_sql(
'UPDATE tagente
SET update_module_count = 1, update_alert_count = 1
@ -1873,7 +1891,7 @@ if ($delete_module) {
}
// Trick to detect if we are deleting a synthetic module (avg or arithmetic)
// If result is empty then module doesn't have this type of submodules
// If result is empty then module doesn't have this type of submodules.
$ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_borrar_modulo]);
$result_ops_synthetic = json_decode($ops_json);
if (!empty($result_ops_synthetic)) {
@ -1881,18 +1899,17 @@ if ($delete_module) {
if ($result === false) {
$error++;
}
} //end if
else {
} else {
$result_components = enterprise_hook('modules_get_synthetic_components', [$id_borrar_modulo]);
$count_components = 1;
if (!empty($result_components)) {
// Get number of components pending to delete to know when it's needed to update orders
// Get number of components pending to delete to know when it's needed to update orders.
$num_components = count($result_components);
$last_target_module = 0;
foreach ($result_components as $id_target_module) {
// Detects change of component or last component to update orders
// Detects change of component or last component to update orders.
if (($count_components == $num_components)
or ($last_target_module != $id_target_module)
|| ($last_target_module != $id_target_module)
) {
$update_orders = true;
} else {
@ -1911,7 +1928,7 @@ if ($delete_module) {
}
}
// Check for errors
// Check for errors.
if ($error != 0) {
ui_print_error_message(__('There was a problem deleting the module'));
} else {
@ -1928,8 +1945,7 @@ if ($delete_module) {
}
}
// MODULE DUPLICATION
// ==================
// MODULE DUPLICATION.
if (!empty($duplicate_module)) {
// DUPLICATE agent module !
$id_duplicate_module = $duplicate_module;
@ -1975,8 +1991,7 @@ if (!empty($duplicate_module)) {
}
}
// MODULE ENABLE/DISABLE
// =====================
// MODULE ENABLE/DISABLE.
if ($enable_module) {
$result = modules_change_disabled($enable_module, 0);
$modulo_nombre = db_get_row_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$enable_module.'');
@ -2015,8 +2030,7 @@ if ($disable_module) {
);
}
// UPDATE GIS
// ==========
// UPDATE GIS.
$updateGIS = get_parameter('update_gis', 0);
if ($updateGIS) {
$updateGisData = get_parameter('update_gis_data');
@ -2105,8 +2119,10 @@ switch ($tab) {
case 'alert':
/*
Because $id_agente is set, it will show only agent alerts */
// This var is for not display create button on alert list
* Because $id_agente is set, it will show only agent alerts
* This var is for not display create button on alert list
*/
$dont_display_alert_create_bttn = true;
include 'godmode/alerts/alert_list.php';
break;
@ -2155,7 +2171,7 @@ switch ($tab) {
default:
if (enterprise_hook('switch_agent_tab', [$tab])) {
// This will make sure that blank pages will have at least some
// debug info in them - do not translate debug
// debug info in them - do not translate debug.
ui_print_error_message(__('Invalid tab specified'));
}
break;

View File

@ -354,6 +354,12 @@ define('MODULE_PREDICTION_CLUSTER', 5);
define('MODULE_PREDICTION_CLUSTER_AA', 6);
define('MODULE_PREDICTION_CLUSTER_AP', 7);
// Type of Webserver Modules.
define('MODULE_WEBSERVER_CHECK_LATENCY', 30);
define('MODULE_WEBSERVER_CHECK_SERVER_RESPONSE', 31);
define('MODULE_WEBSERVER_RETRIEVE_NUMERIC_DATA', 32);
define('MODULE_WEBSERVER_RETRIEVE_STRING_DATA', 33);
// SNMP CONSTANTS.
define('SNMP_DIR_MIBS', 'attachment/mibs');