diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php index 0c129642ff..9d6fa3f125 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php @@ -31,7 +31,6 @@ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent); check_login (); $ip_target = (string) get_parameter ('ip_target', $ipAgent); -$use_agent = get_parameter ('use_agent'); $snmp_community = (string) get_parameter ('snmp_community', 'public'); $snmp_version = get_parameter('snmp_version', '1'); $snmp3_auth_user = get_parameter('snmp3_auth_user'); @@ -306,13 +305,7 @@ if ($create_modules) { $common_values['tcp_port'] = $tcp_port; } $common_values['snmp_community'] = $snmp_community; - if($use_agent){ - $common_values['ip_target'] = 'auto'; - } - else{ - $common_values['ip_target'] = $ip_target; - } - + $common_values['ip_target'] = $ip_target; $common_values['tcp_send'] = $snmp_version; if ($snmp_version == '3') { @@ -703,22 +696,18 @@ $table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, $table->data[0][2] = '' . __('Port') . ''; $table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true); -$table->data[1][0] = '' . __('Use agent ip') . ''; -$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true); - $snmp_versions['1'] = 'v. 1'; $snmp_versions['2'] = 'v. 2'; $snmp_versions['2c'] = 'v. 2c'; $snmp_versions['3'] = 'v. 3'; -$table->data[2][0] = '' . __('SNMP community') . ''; -$table->data[2][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true); +$table->data[1][0] = '' . __('SNMP community') . ''; +$table->data[1][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true); -$table->data[2][2] = '' . __('SNMP version') . ''; -$table->data[2][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); - -$table->data[2][3] .= ''; +$table->data[1][2] = '' . __('SNMP version') . ''; +$table->data[1][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); +$table->data[1][3] .= ''; html_print_input_hidden('snmpwalk', 1); html_print_table($table); @@ -771,10 +760,9 @@ if (!$fail) { echo ''; echo "
"; echo ''; - + html_print_input_hidden('create_modules', 1); html_print_input_hidden('ip_target', $ip_target); - html_print_input_hidden('use_agent', $use_agent); html_print_input_hidden('tcp_port', $tcp_port); html_print_input_hidden('snmp_community', $snmp_community); html_print_input_hidden('snmp_version', $snmp_version); diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php index 9139f22f42..7b841f8bc9 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -28,7 +28,6 @@ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent); check_login (); $ip_target = (string) get_parameter ('ip_target', $ipAgent); -$use_agent = get_parameter ('use_agent'); $snmp_community = (string) get_parameter ('snmp_community', 'public'); $snmp_version = get_parameter('snmp_version', '1'); $snmp3_auth_user = get_parameter('snmp3_auth_user'); @@ -137,12 +136,7 @@ if ($create_modules) { $values['tcp_port'] = $tcp_port; } $values['snmp_community'] = $snmp_community; - if($use_agent){ - $values['ip_target'] = 'auto'; - } - else{ - $values['ip_target'] = $ip_target; - } + $values['ip_target'] = $ip_target; $values['tcp_send'] = $snmp_version; if ($snmp_version == '3') { @@ -342,21 +336,18 @@ $table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, $table->data[0][2] = '' . __('Port') . ''; $table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true); -$table->data[1][0] = '' . __('Use agent ip') . ''; -$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true); - $snmp_versions['1'] = 'v. 1'; $snmp_versions['2'] = 'v. 2'; $snmp_versions['2c'] = 'v. 2c'; $snmp_versions['3'] = 'v. 3'; -$table->data[2][0] = '' . __('SNMP community') . ''; -$table->data[2][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true); +$table->data[1][0] = '' . __('SNMP community') . ''; +$table->data[1][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true); -$table->data[2][2] = '' . __('SNMP version') . ''; -$table->data[2][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); +$table->data[1][2] = '' . __('SNMP version') . ''; +$table->data[1][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); -$table->data[2][3] .= ''; +$table->data[1][3] .= ''; html_print_input_hidden('snmpwalk', 1); html_print_table($table); @@ -418,7 +409,6 @@ if (!empty($interfaces_list)) { html_print_input_hidden('create_modules', 1); html_print_input_hidden('ip_target', $ip_target); - html_print_input_hidden('use_agent', $use_agent); html_print_input_hidden('tcp_port', $tcp_port); html_print_input_hidden('snmp_community', $snmp_community); html_print_input_hidden('snmp_version', $snmp_version); diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 8d3d1c7e9f..2542bd5242 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -974,9 +974,6 @@ if ($update_module || $create_module) { $parent_module_id = (int) get_parameter('parent_module_id'); $ip_target = (string) get_parameter ('ip_target'); - if($ip_target == ''){ - $ip_target = 'auto'; - } $custom_id = (string) get_parameter ('custom_id'); $history_data = (int) get_parameter('history_data'); $dynamic_interval = (int) get_parameter('dynamic_interval'); diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index f637f8a7c1..b29f56123f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -65,25 +65,7 @@ $extra_title = __('Network server module'); $data = array (); $data[0] = __('Target IP'); -//show agent_for defect; -html_debug_print($ip_target); -if($ip_target == 'auto'){ - $ip_target = agents_get_address ($id_agente); -} -if($page == 'enterprise/godmode/policies/policy_modules'){ - $target_ip_values = array(); - $target_ip_values['auto'] = __('Auto'); - $target_ip_values['force_pri'] = __('Force primary key'); - $target_ip_values['custom'] = __('Custom'); - - $data[1] = html_print_select ($target_ip_values, 'ip_target', '', '', '', '', - true, false, false, '', false, 'width:200px;'); - - //$table->data['edit35'][1] .= html_print_input_text ('custom_ip_target', '', '', 15, 60, true); -} -else{ - $data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true); -} +$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true); // In ICMP modules, port is not configurable if ($id_module_type >= 6 && $id_module_type <= 7) { diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 160a1d1882..d2dbc9a858 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -480,17 +480,9 @@ $table->data['edit3'][2] = __('SMNP community'); $table->data['edit3'][3] = html_print_input_text ('snmp_community', '', '', 10, 15, true); -$target_ip_values = array(); -$target_ip_values['auto'] = __('Auto'); -$target_ip_values['force_pri'] = __('Force primary key'); -$target_ip_values['custom'] = __('Custom'); - $table->data['edit35'][0] = __('Target IP'); -$table->data['edit35'][1] = html_print_select ($target_ip_values, - 'ip_target', '', '', __('No change'), '', true, false, false, '', false, 'width:200px;'); - -$table->data['edit35'][1] .= html_print_input_text ('custom_ip_target', '', '', 15, 60, true); - +$table->data['edit35'][1] = html_print_input_text ('ip_target', '', '', + 15, 60, true); $table->data['edit35'][2] = __('SNMP version'); $table->data['edit35'][3] = html_print_select ($snmp_versions, 'tcp_send', '', '', __('No change'), '', true, false, false, ''); diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 356112a00e..d1493c006b 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -411,19 +411,9 @@ function modules_update_agent_module ($id, $values, return ERR_EXIST; } } - - if(isset ($values['ip_target'])){ - if($values['ip_target'] == 'force_pri'){ - $sql_agent = "SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo=" . $id; - $id_agente = mysql_db_process_sql($sql_agent); - $values['ip_target'] = agents_get_address ($id_agente); - } - elseif($values['ip_target'] == 'custom'){ - $values['ip_target'] = $values['custom_ip_target']; - } - } - unset($values['custom_ip_target']); - + + + $where = array(); $where['id_agente_modulo'] = $id; if ($onlyNoDeletePending) {