diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index a5784f65d9..2adcedae80 100644 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -163,3 +163,9 @@ DROP TABLE `tgis_map_has_tgis_map_connection`; ALTER TABLE `tmodule_relationship` --ADD COLUMN `id_rt` int(10) unsigned NOT NULL DEFAULT 0, ADD FOREIGN KEY (`id_rt`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE; + +-- --------------------------------------------------------------------- +-- Table `tevent_filter` +-- --------------------------------------------------------------------- +ALTER TABLE tevent_filter ADD COLUMN `id_agent_module` int(25) DEFAULT 0; +ALTER TABLE tevent_filter ADD COLUMN `id_agent` int(25) DEFAULT 0; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index 6c76e9dfa3..a8174cdf7c 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -117,4 +117,10 @@ WHERE id_recon_script = 2 AND name = 'IPMI Recon'; UPDATE tnetwork_component SET snmp_oid ='SELECT DNSHostName FROM Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname'; UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207; -UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219; \ No newline at end of file +UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219; + +-- --------------------------------------------------------------------- +-- Table `tevent_filter` +-- --------------------------------------------------------------------- +ALTER TABLE tevent_filter ADD COLUMN id_agent_module int(25) DEFAULT 0; +ALTER TABLE tevent_filter ADD COLUMN id_agent int(25) DEFAULT 0; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 5a0bc7de3a..4ab683b2bc 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -114,4 +114,10 @@ WHERE "id_recon_script" = 2 AND "name" = 'IPMI Recon'; UPDATE tnetwork_component SET snmp_oid ='SELECT DNSHostName FROM Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname'; UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207; -UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219; \ No newline at end of file +UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219; + +-- --------------------------------------------------------------------- +-- Table `tnetwork_component` +-- --------------------------------------------------------------------- +ALTER TABLE tevent_filter ADD COLUMN id_agent_module int(25) DEFAULT 0; +ALTER TABLE tevent_filter ADD COLUMN id_agent int(25) DEFAULT 0; \ No newline at end of file diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index ac95959135..68b13c5dce 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -52,6 +52,8 @@ if ($id) { $status = $filter['status']; $search = $filter['search']; $text_agent = $filter['text_agent']; + $id_agent = $filter['id_agent']; + $id_agent_module = $filter['id_agent_module']; $pagination = $filter['pagination']; $event_view_hr = $filter['event_view_hr']; $id_user_ack = $filter['id_user_ack']; @@ -66,6 +68,19 @@ if ($id) { $tag_without_base64 = base64_encode($tag_without_json_clean) ; $filter_only_alert = $filter['filter_only_alert']; + + if ($id_agent_module != 0) { + $text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); + if ($text_module == false) { + $text_module = ''; + } + } + if ($id_agent != 0) { + $text_agent = db_get_value('nombre', 'tagente', 'id_agente', $id_agent); + if ($text_agent == false) { + $text_agent = ''; + } + } } else { $id_group = ''; @@ -96,6 +111,8 @@ if($update || $create) { $status = get_parameter('status', ''); $search = get_parameter('search', ''); $text_agent = get_parameter('text_agent', ''); + $id_agent_module = get_parameter('module_search_hidden', ''); + $id_agent = get_parameter('id_agent', ''); $pagination = get_parameter('pagination', ''); $event_view_hr = get_parameter('event_view_hr', ''); $id_user_ack = get_parameter('id_user_ack', ''); @@ -118,6 +135,8 @@ if($update || $create) { 'status' => $status, 'search' => $search, 'text_agent' => $text_agent, + 'id_agent_module' => $id_agent_module, + 'id_agent' => $id_agent, 'pagination' => $pagination, 'event_view_hr' => $event_view_hr, 'id_user_ack' => $id_user_ack, @@ -220,17 +239,19 @@ $table->data[6][1] = html_print_input_text( $table->data[7][0] = '' . __('Agent search') . ''; $params = array(); -$params['return'] = true; $params['show_helptip'] = true; $params['input_name'] = 'text_agent'; $params['value'] = $text_agent; -$params['selectbox_group'] = 'id_group'; +$params['return'] = true; if (defined('METACONSOLE')) { $params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax'; } - -ui_print_agent_autocomplete_input($params); +else { + $params['print_hidden_input_idagent'] = true; + $params['hidden_input_idagent_name'] = 'id_agent'; + $params['hidden_input_idagent_value'] = $id_agent; +} $table->data[7][1] = ui_print_agent_autocomplete_input($params); @@ -345,6 +366,13 @@ $table->data[19][1] = html_print_select( '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true); +if (!$meta) { + echo $id_agent_module; + $table->data[20][0] = '' . __('Module search') . ''; + $table->data[20][1] .= html_print_autocomplete_modules('module_search', + $text_module, false, $id_agent_module, true, '', array(), true); +} + echo '