diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 27c85fe39a..5112d584c7 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -121,7 +121,7 @@ CREATE TABLE IF NOT EXISTS `tagente_datos_inc` ( -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tagente_datos_string` ( `id_agente_modulo` INT UNSIGNED NOT NULL DEFAULT 0, - `datos` mediumtext NOT NULL, + `datos` mediumTEXT, `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0, KEY `data_string_index_1` (`id_agente_modulo`, `utimestamp`), KEY `idx_utimestamp` USING BTREE (`utimestamp`) @@ -134,9 +134,9 @@ CREATE TABLE IF NOT EXISTS `tagente_datos_log4x` ( `id_tagente_datos_log4x` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `id_agente_modulo` INT UNSIGNED NOT NULL DEFAULT 0, - `severity` TEXT NOT NULL, - `message` TEXT NOT NULL, - `stacktrace` TEXT NOT NULL, + `severity` TEXT, + `message` TEXT, + `stacktrace` TEXT, `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id_tagente_datos_log4x`), @@ -149,7 +149,7 @@ CREATE TABLE IF NOT EXISTS `tagente_datos_log4x` ( CREATE TABLE IF NOT EXISTS `tagente_estado` ( `id_agente_estado` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_agente_modulo` INT NOT NULL DEFAULT 0, - `datos` mediumtext NOT NULL, + `datos` mediumTEXT, `timestamp` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', `estado` INT NOT NULL DEFAULT 0, `known_status` TINYINT DEFAULT 0, @@ -193,9 +193,9 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `id_agente_modulo` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_agente` INT UNSIGNED NOT NULL DEFAULT 0, `id_tipo_modulo` SMALLINT NOT NULL DEFAULT 0, - `descripcion` TEXT NOT NULL, - `extended_info` TEXT NOT NULL, - `nombre` TEXT NOT NULL, + `descripcion` TEXT, + `extended_info` TEXT, + `nombre` TEXT, `unit` TEXT, `id_policy_module` INT UNSIGNED NOT NULL DEFAULT 0, `max` BIGINT DEFAULT 0, @@ -241,15 +241,15 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `custom_integer_2` INT DEFAULT 0, `wizard_level` ENUM('basic','advanced','nowizard') DEFAULT 'nowizard', `macros` TEXT, - `critical_instructions` TEXT NOT NULL, - `warning_instructions` TEXT NOT NULL, - `unknown_instructions` TEXT NOT NULL, + `critical_instructions` TEXT, + `warning_instructions` TEXT, + `unknown_instructions` TEXT, `quiet` TINYINT NOT NULL DEFAULT 0, `critical_inverse` TINYINT UNSIGNED DEFAULT 0, `warning_inverse` TINYINT UNSIGNED DEFAULT 0, `id_category` INT DEFAULT 0, - `disabled_types_event` TEXT NOT NULL, - `module_macros` TEXT NOT NULL, + `disabled_types_event` TEXT, + `module_macros` TEXT, `min_ff_event_normal` INT UNSIGNED DEFAULT 0, `min_ff_event_warning` INT UNSIGNED DEFAULT 0, `min_ff_event_critical` INT UNSIGNED DEFAULT 0, @@ -296,26 +296,26 @@ CREATE TABLE IF NOT EXISTS `tagent_access` ( CREATE TABLE IF NOT EXISTS `talert_snmp` ( `id_as` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_alert` INT UNSIGNED NOT NULL DEFAULT 0, - `al_field1` TEXT NOT NULL, - `al_field2` TEXT NOT NULL, - `al_field3` TEXT NOT NULL, - `al_field4` TEXT NOT NULL, - `al_field5` TEXT NOT NULL, - `al_field6` TEXT NOT NULL, - `al_field7` TEXT NOT NULL, - `al_field8` TEXT NOT NULL, - `al_field9` TEXT NOT NULL, - `al_field10` TEXT NOT NULL, - `al_field11` TEXT NOT NULL, - `al_field12` TEXT NOT NULL, - `al_field13` TEXT NOT NULL, - `al_field14` TEXT NOT NULL, - `al_field15` TEXT NOT NULL, - `al_field16` TEXT NOT NULL, - `al_field17` TEXT NOT NULL, - `al_field18` TEXT NOT NULL, - `al_field19` TEXT NOT NULL, - `al_field20` TEXT NOT NULL, + `al_field1` TEXT, + `al_field2` TEXT, + `al_field3` TEXT, + `al_field4` TEXT, + `al_field5` TEXT, + `al_field6` TEXT, + `al_field7` TEXT, + `al_field8` TEXT, + `al_field9` TEXT, + `al_field10` TEXT, + `al_field11` TEXT, + `al_field12` TEXT, + `al_field13` TEXT, + `al_field14` TEXT, + `al_field15` TEXT, + `al_field16` TEXT, + `al_field17` TEXT, + `al_field18` TEXT, + `al_field19` TEXT, + `al_field20` TEXT, `description` VARCHAR(255) DEFAULT '', `alert_type` INT UNSIGNED NOT NULL DEFAULT 0, `agent` VARCHAR(100) DEFAULT '', @@ -400,48 +400,48 @@ CREATE TABLE IF NOT EXISTS `talert_actions` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` TEXT, `id_alert_command` INT UNSIGNED NULL DEFAULT 0, - `field1` TEXT NOT NULL, - `field2` TEXT NOT NULL, - `field3` TEXT NOT NULL, - `field4` TEXT NOT NULL, - `field5` TEXT NOT NULL, - `field6` TEXT NOT NULL, - `field7` TEXT NOT NULL, - `field8` TEXT NOT NULL, - `field9` TEXT NOT NULL, - `field10` TEXT NOT NULL, - `field11` TEXT NOT NULL, - `field12` TEXT NOT NULL, - `field13` TEXT NOT NULL, - `field14` TEXT NOT NULL, - `field15` TEXT NOT NULL, - `field16` TEXT NOT NULL, - `field17` TEXT NOT NULL, - `field18` TEXT NOT NULL, - `field19` TEXT NOT NULL, - `field20` TEXT NOT NULL, + `field1` TEXT, + `field2` TEXT, + `field3` TEXT, + `field4` TEXT, + `field5` TEXT, + `field6` TEXT, + `field7` TEXT, + `field8` TEXT, + `field9` TEXT, + `field10` TEXT, + `field11` TEXT, + `field12` TEXT, + `field13` TEXT, + `field14` TEXT, + `field15` TEXT, + `field16` TEXT, + `field17` TEXT, + `field18` TEXT, + `field19` TEXT, + `field20` TEXT, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, `action_threshold` INT NOT NULL DEFAULT 0, - `field1_recovery` TEXT NOT NULL, - `field2_recovery` TEXT NOT NULL, - `field3_recovery` TEXT NOT NULL, - `field4_recovery` TEXT NOT NULL, - `field5_recovery` TEXT NOT NULL, - `field6_recovery` TEXT NOT NULL, - `field7_recovery` TEXT NOT NULL, - `field8_recovery` TEXT NOT NULL, - `field9_recovery` TEXT NOT NULL, - `field10_recovery` TEXT NOT NULL, - `field11_recovery` TEXT NOT NULL, - `field12_recovery` TEXT NOT NULL, - `field13_recovery` TEXT NOT NULL, - `field14_recovery` TEXT NOT NULL, - `field15_recovery` TEXT NOT NULL, - `field16_recovery` TEXT NOT NULL, - `field17_recovery` TEXT NOT NULL, - `field18_recovery` TEXT NOT NULL, - `field19_recovery` TEXT NOT NULL, - `field20_recovery` TEXT NOT NULL, + `field1_recovery` TEXT, + `field2_recovery` TEXT, + `field3_recovery` TEXT, + `field4_recovery` TEXT, + `field5_recovery` TEXT, + `field6_recovery` TEXT, + `field7_recovery` TEXT, + `field8_recovery` TEXT, + `field9_recovery` TEXT, + `field10_recovery` TEXT, + `field11_recovery` TEXT, + `field12_recovery` TEXT, + `field13_recovery` TEXT, + `field14_recovery` TEXT, + `field15_recovery` TEXT, + `field16_recovery` TEXT, + `field17_recovery` TEXT, + `field18_recovery` TEXT, + `field19_recovery` TEXT, + `field20_recovery` TEXT, `previous_name` TEXT, `create_wu_integria` TINYINT DEFAULT NULL, PRIMARY KEY (`id`), @@ -457,26 +457,26 @@ CREATE TABLE IF NOT EXISTS `talert_templates` ( `name` TEXT, `description` mediumtext, `id_alert_action` INT UNSIGNED NULL, - `field1` TEXT NOT NULL, - `field2` TEXT NOT NULL, - `field3` TEXT NOT NULL, - `field4` TEXT NOT NULL, - `field5` TEXT NOT NULL, - `field6` TEXT NOT NULL, - `field7` TEXT NOT NULL, - `field8` TEXT NOT NULL, - `field9` TEXT NOT NULL, - `field10` TEXT NOT NULL, - `field11` TEXT NOT NULL, - `field12` TEXT NOT NULL, - `field13` TEXT NOT NULL, - `field14` TEXT NOT NULL, - `field15` TEXT NOT NULL, - `field16` TEXT NOT NULL, - `field17` TEXT NOT NULL, - `field18` TEXT NOT NULL, - `field19` TEXT NOT NULL, - `field20` TEXT NOT NULL, + `field1` TEXT, + `field2` TEXT, + `field3` TEXT, + `field4` TEXT, + `field5` TEXT, + `field6` TEXT, + `field7` TEXT, + `field8` TEXT, + `field9` TEXT, + `field10` TEXT, + `field11` TEXT, + `field12` TEXT, + `field13` TEXT, + `field14` TEXT, + `field15` TEXT, + `field16` TEXT, + `field17` TEXT, + `field18` TEXT, + `field19` TEXT, + `field20` TEXT, `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal'), `value` VARCHAR(255) DEFAULT '', `matches_value` TINYINT DEFAULT 0, @@ -495,26 +495,26 @@ CREATE TABLE IF NOT EXISTS `talert_templates` ( `saturday` TINYINT DEFAULT 1, `sunday` TINYINT DEFAULT 1, `recovery_notify` TINYINT DEFAULT 0, - `field1_recovery` TEXT NOT NULL, - `field2_recovery` TEXT NOT NULL, - `field3_recovery` TEXT NOT NULL, - `field4_recovery` TEXT NOT NULL, - `field5_recovery` TEXT NOT NULL, - `field6_recovery` TEXT NOT NULL, - `field7_recovery` TEXT NOT NULL, - `field8_recovery` TEXT NOT NULL, - `field9_recovery` TEXT NOT NULL, - `field10_recovery` TEXT NOT NULL, - `field11_recovery` TEXT NOT NULL, - `field12_recovery` TEXT NOT NULL, - `field13_recovery` TEXT NOT NULL, - `field14_recovery` TEXT NOT NULL, - `field15_recovery` TEXT NOT NULL, - `field16_recovery` TEXT NOT NULL, - `field17_recovery` TEXT NOT NULL, - `field18_recovery` TEXT NOT NULL, - `field19_recovery` TEXT NOT NULL, - `field20_recovery` TEXT NOT NULL, + `field1_recovery` TEXT, + `field2_recovery` TEXT, + `field3_recovery` TEXT, + `field4_recovery` TEXT, + `field5_recovery` TEXT, + `field6_recovery` TEXT, + `field7_recovery` TEXT, + `field8_recovery` TEXT, + `field9_recovery` TEXT, + `field10_recovery` TEXT, + `field11_recovery` TEXT, + `field12_recovery` TEXT, + `field13_recovery` TEXT, + `field14_recovery` TEXT, + `field15_recovery` TEXT, + `field16_recovery` TEXT, + `field17_recovery` TEXT, + `field18_recovery` TEXT, + `field19_recovery` TEXT, + `field20_recovery` TEXT, `priority` TINYINT DEFAULT 0, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, `special_day` TINYINT DEFAULT 0, @@ -606,7 +606,7 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_alert_template_module` INT UNSIGNED NOT NULL, `alert_mode` TINYINT NOT NULL, - `data` mediumtext NOT NULL, + `data` mediumTEXT, `extra_macros` TEXT, `utimestamp` BIGINT NOT NULL DEFAULT 0, PRIMARY KEY (`id`) @@ -631,7 +631,7 @@ CREATE TABLE IF NOT EXISTS `tattachment` ( CREATE TABLE IF NOT EXISTS `tconfig` ( `id_config` INT UNSIGNED NOT NULL AUTO_INCREMENT, `token` VARCHAR(100) NOT NULL DEFAULT '', - `value` TEXT NOT NULL, + `value` TEXT, PRIMARY KEY (`id_config`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -656,7 +656,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer` ( `parent` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, `disabled` TINYINT UNSIGNED NOT NULL DEFAULT 0, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, - `description` TEXT NOT NULL, + `description` TEXT, PRIMARY KEY (`id_container`), KEY `parent_index` (`parent`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -695,22 +695,22 @@ CREATE TABLE IF NOT EXISTS `tevento` ( `id_grupo` MEDIUMINT NOT NULL DEFAULT 0, `estado` TINYINT UNSIGNED NOT NULL DEFAULT 0, `timestamp` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', - `evento` TEXT NOT NULL, + `evento` TEXT, `utimestamp` BIGINT NOT NULL DEFAULT 0, `event_type` ENUM('going_unknown','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change', 'ncm') DEFAULT 'unknown', `id_agentmodule` INT NOT NULL DEFAULT 0, `id_alert_am` INT NOT NULL DEFAULT 0, `criticity` INT UNSIGNED NOT NULL DEFAULT 0, - `user_comment` TEXT NOT NULL, - `tags` TEXT NOT NULL, - `source` TINYTEXT NOT NULL, - `id_extra` TINYTEXT NOT NULL, - `critical_instructions` TEXT NOT NULL, - `warning_instructions` TEXT NOT NULL, - `unknown_instructions` TEXT NOT NULL, + `user_comment` TEXT, + `tags` TEXT, + `source` TINYTEXT, + `id_extra` TINYTEXT, + `critical_instructions` TEXT, + `warning_instructions` TEXT, + `unknown_instructions` TEXT, `owner_user` VARCHAR(100) NOT NULL DEFAULT '', `ack_utimestamp` BIGINT NOT NULL DEFAULT 0, - `custom_data` TEXT NOT NULL, + `custom_data` TEXT, `data` TINYTEXT, `module_status` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id_evento`), @@ -779,8 +779,8 @@ CREATE TABLE IF NOT EXISTS `tincidencia` ( `id_incidencia` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `inicio` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', `cierre` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', - `titulo` TEXT NOT NULL, - `descripcion` TEXT NOT NULL, + `titulo` TEXT, + `descripcion` TEXT, `id_usuario` VARCHAR(60) NOT NULL DEFAULT '', `origen` VARCHAR(100) NOT NULL DEFAULT '', `estado` INT NOT NULL DEFAULT 0, @@ -834,7 +834,7 @@ CREATE TABLE IF NOT EXISTS `trecon_task` ( `id_rt` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NOT NULL DEFAULT '', `description` VARCHAR(250) NOT NULL DEFAULT '', - `subnet` TEXT NOT NULL, + `subnet` TEXT, `id_network_profile` TEXT, `review_mode` TINYINT UNSIGNED NOT NULL DEFAULT 1, `id_group` INT UNSIGNED NOT NULL DEFAULT 1, @@ -846,7 +846,7 @@ CREATE TABLE IF NOT EXISTS `trecon_task` ( `recon_ports` VARCHAR(250) NOT NULL DEFAULT '', `snmp_community` VARCHAR(64) NOT NULL DEFAULT 'public', `id_recon_script` INT, - `field1` TEXT NOT NULL, + `field1` TEXT, `field2` VARCHAR(250) NOT NULL DEFAULT '', `field3` VARCHAR(250) NOT NULL DEFAULT '', `field4` VARCHAR(250) NOT NULL DEFAULT '', @@ -929,16 +929,16 @@ CREATE TABLE IF NOT EXISTS `tmodule_relationship` ( -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `id_nc` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TEXT NOT NULL, - `description` TEXT NOT NULL, + `name` TEXT, + `description` TEXT, `id_group` INT NOT NULL DEFAULT 1, `type` SMALLINT NOT NULL DEFAULT 6, `max` BIGINT NOT NULL DEFAULT 0, `min` BIGINT NOT NULL DEFAULT 0, `module_interval` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, `tcp_port` INT UNSIGNED NOT NULL DEFAULT 0, - `tcp_send` TEXT NOT NULL, - `tcp_rcv` TEXT NOT NULL, + `tcp_send` TEXT, + `tcp_rcv` TEXT, `snmp_community` VARCHAR(255) NOT NULL DEFAULT 'NULL', `snmp_oid` VARCHAR(400) NOT NULL, `id_module_group` TINYINT UNSIGNED NOT NULL DEFAULT 0, @@ -966,15 +966,15 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `unit` TEXT, `wizard_level` ENUM('basic','advanced','nowizard') DEFAULT 'nowizard', `macros` TEXT, - `critical_instructions` TEXT NOT NULL, - `warning_instructions` TEXT NOT NULL, - `unknown_instructions` TEXT NOT NULL, + `critical_instructions` TEXT, + `warning_instructions` TEXT, + `unknown_instructions` TEXT, `critical_inverse` TINYINT UNSIGNED DEFAULT 0, `warning_inverse` TINYINT UNSIGNED DEFAULT 0, `id_category` INT DEFAULT 0, - `tags` TEXT NOT NULL, - `disabled_types_event` TEXT NOT NULL, - `module_macros` TEXT NOT NULL, + `tags` TEXT, + `disabled_types_event` TEXT, + `module_macros` TEXT, `min_ff_event_normal` INT UNSIGNED DEFAULT 0, `min_ff_event_warning` INT UNSIGNED DEFAULT 0, `min_ff_event_critical` INT UNSIGNED DEFAULT 0, @@ -986,18 +986,18 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `dynamic_next` BIGINT NOT NULL DEFAULT 0, `dynamic_two_tailed` TINYINT UNSIGNED DEFAULT 0, `module_type` TINYINT UNSIGNED NOT NULL DEFAULT 1, - `protocol` TINYTEXT NOT NULL, - `manufacturer_id` VARCHAR(200) NOT NULL, + `protocol` TINYTEXT, + `manufacturer_id` VARCHAR(200), `execution_type` TINYINT UNSIGNED NOT NULL DEFAULT 1, `scan_type` TINYINT UNSIGNED NOT NULL DEFAULT 1, - `value` TEXT NOT NULL, - `value_operations` TEXT NOT NULL, + `value` TEXT, + `value_operations` TEXT, `module_enabled` TINYINT UNSIGNED DEFAULT 0, - `name_oid` VARCHAR(255) NOT NULL, - `query_class` VARCHAR(200) NOT NULL, - `query_key_field` VARCHAR(200) NOT NULL, - `scan_filters` TEXT NOT NULL, - `query_filters` TEXT NOT NULL, + `name_oid` VARCHAR(255) DEFAULT '', + `query_class` VARCHAR(200) DEFAULT '', + `query_key_field` VARCHAR(200) DEFAULT '', + `scan_filters` TEXT, + `query_filters` TEXT, `enabled` TINYINT UNSIGNED DEFAULT 1, `percentage_critical` TINYINT UNSIGNED DEFAULT 0, `percentage_warning` TINYINT UNSIGNED DEFAULT 0, @@ -1063,7 +1063,7 @@ CREATE TABLE IF NOT EXISTS `tnota` ( `id_incident` BIGINT UNSIGNED NOT NULL, `id_usuario` VARCHAR(100) NOT NULL DEFAULT '0', `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `nota` mediumtext NOT NULL, + `nota` mediumTEXT, PRIMARY KEY (`id_nota`), KEY `id_incident` (`id_incident`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -1080,7 +1080,7 @@ CREATE TABLE IF NOT EXISTS `torigen` ( -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tperfil` ( `id_perfil` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TEXT NOT NULL, + `name` TEXT, `agent_view` TINYINT NOT NULL DEFAULT 0, `agent_edit` TINYINT NOT NULL DEFAULT 0, `alert_edit` TINYINT NOT NULL DEFAULT 0, @@ -1177,7 +1177,7 @@ CREATE TABLE IF NOT EXISTS `tsesion` ( `id_usuario` VARCHAR(60) NOT NULL DEFAULT '0', `ip_origen` VARCHAR(100) NOT NULL DEFAULT '', `accion` VARCHAR(100) NOT NULL DEFAULT '', - `descripcion` TEXT NOT NULL, + `descripcion` TEXT, `fecha` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', `utimestamp` BIGINT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id_sesion`), @@ -1202,7 +1202,7 @@ CREATE TABLE IF NOT EXISTS `ttipo_modulo` ( CREATE TABLE IF NOT EXISTS `ttrap` ( `id_trap` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `source` VARCHAR(50) NOT NULL DEFAULT '', - `oid` TEXT NOT NULL, + `oid` TEXT, `oid_custom` TEXT, `type` INT NOT NULL DEFAULT 0, `type_custom` VARCHAR(100) DEFAULT '', @@ -1230,8 +1230,8 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `id_group_filter` INT NOT NULL DEFAULT 0, `id_name` VARCHAR(600) NOT NULL, `id_group` INT NOT NULL DEFAULT 0, - `event_type` TEXT NOT NULL, - `severity` TEXT NOT NULL, + `event_type` TEXT, + `severity` TEXT, `status` INT NOT NULL DEFAULT -1, `search` TEXT, `text_agent` TEXT, @@ -1241,14 +1241,14 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `event_view_hr` INT NOT NULL DEFAULT 8, `id_user_ack` TEXT, `group_rep` INT NOT NULL DEFAULT 0, - `tag_with` TEXT NOT NULL, - `tag_without` TEXT NOT NULL, + `tag_with` TEXT, + `tag_without` TEXT, `filter_only_alert` INT NOT NULL DEFAULT -1, `date_from` date DEFAULT NULL, `date_to` date DEFAULT NULL, - `source` TINYTEXT NOT NULL, - `id_extra` TINYTEXT NOT NULL, - `user_comment` TEXT NOT NULL, + `source` TINYTEXT, + `id_extra` TINYTEXT, + `user_comment` TEXT, `id_source_event` INT NULL DEFAULT 0, `server_id` INT NOT NULL DEFAULT 0, `time_from` TIME NULL, @@ -1279,8 +1279,8 @@ CREATE TABLE IF NOT EXISTS `tusuario` ( `disabled` INT NOT NULL DEFAULT 0, `shortcut` TINYINT DEFAULT 0, `shortcut_data` TEXT, - `section` TEXT NOT NULL, - `data_section` TEXT NOT NULL, + `section` TEXT, + `data_section` TEXT, `force_change_pass` TINYINT UNSIGNED NOT NULL DEFAULT 0, `last_pass_change` DATETIME, `last_failed_login` DATETIME, @@ -1295,7 +1295,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` ( `id_filter` INT UNSIGNED NULL DEFAULT NULL, `session_time` INT signed NOT NULL DEFAULT 0, `default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0, - `autorefresh_white_list` TEXT NOT NULL , + `autorefresh_white_list` TEXT , `time_autorefresh` INT UNSIGNED NOT NULL DEFAULT 30, `default_custom_view` INT UNSIGNED NULL DEFAULT 0, `ehorus_user_level_user` VARCHAR(60), @@ -1318,7 +1318,7 @@ CREATE TABLE IF NOT EXISTS `tusuario_perfil` ( `no_hierarchy` TINYINT NOT NULL DEFAULT 0, `assigned_by` VARCHAR(100) NOT NULL DEFAULT '', `id_policy` INT UNSIGNED NOT NULL DEFAULT 0, - `tags` TEXT NOT NULL, + `tags` TEXT, PRIMARY KEY (`id_up`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -1366,7 +1366,7 @@ CREATE TABLE IF NOT EXISTS `tnotification_source` ( CREATE TABLE IF NOT EXISTS `tmensajes` ( `id_mensaje` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_usuario_origen` VARCHAR(60) NOT NULL DEFAULT '', - `mensaje` TEXT NOT NULL, + `mensaje` TEXT, `timestamp` BIGINT UNSIGNED NOT NULL DEFAULT 0, `subject` VARCHAR(255) NOT NULL DEFAULT '', `estado` INT UNSIGNED NOT NULL DEFAULT 0, @@ -1461,7 +1461,7 @@ CREATE TABLE IF NOT EXISTS `tnews` ( `id_news` INT UNSIGNED NOT NULL AUTO_INCREMENT, `author` VARCHAR(255) NOT NULL DEFAULT '', `subject` VARCHAR(255) NOT NULL DEFAULT '', - `text` TEXT NOT NULL, + `text` TEXT, `timestamp` DATETIME, `id_group` INT NOT NULL DEFAULT 0, `modal` TINYINT DEFAULT 0, @@ -1477,7 +1477,7 @@ CREATE TABLE IF NOT EXISTS `tgraph` ( `id_graph` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_user` VARCHAR(100) NOT NULL DEFAULT '', `name` VARCHAR(150) NOT NULL DEFAULT '', - `description` TEXT NOT NULL, + `description` TEXT, `period` INT NOT NULL DEFAULT 0, `width` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `height` SMALLINT UNSIGNED NOT NULL DEFAULT 0, @@ -1515,7 +1515,7 @@ CREATE TABLE IF NOT EXISTS `treport` ( `id_report` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_user` VARCHAR(100) NOT NULL DEFAULT '', `name` VARCHAR(150) NOT NULL DEFAULT '', - `description` TEXT NOT NULL, + `description` TEXT, `private` TINYINT UNSIGNED NOT NULL DEFAULT 0, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT NULL, `custom_logo` VARCHAR(200) DEFAULT NULL, @@ -1572,7 +1572,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `order_uptodown` INT NOT NULL DEFAULT 0, `show_graph` INT NOT NULL DEFAULT 0, `group_by_agent` INT NOT NULL DEFAULT 0, - `style` TEXT NOT NULL, + `style` TEXT, `id_group` INT unsigned NOT NULL DEFAULT 0, `id_module_group` INT unsigned NOT NULL DEFAULT 0, `server_name` TEXT, @@ -1790,7 +1790,7 @@ CREATE TABLE IF NOT EXISTS `tserver_export_data` ( CREATE TABLE IF NOT EXISTS `tplanned_downtime` ( `id` MEDIUMINT NOT NULL AUTO_INCREMENT, `name` VARCHAR( 100 ) NOT NULL, - `description` TEXT NOT NULL, + `description` TEXT, `date_from` BIGINT NOT NULL DEFAULT 0, `date_to` BIGINT NOT NULL DEFAULT 0, `executed` TINYINT UNSIGNED NOT NULL DEFAULT 0, @@ -2085,7 +2085,7 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields` ( `name` VARCHAR(45) NOT NULL DEFAULT '', `display_on_front` TINYINT NOT NULL DEFAULT 0, `is_password_type` TINYINT NOT NULL DEFAULT 0, - `combo_values` TEXT NOT NULL , + `combo_values` TEXT , PRIMARY KEY (`id_field`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2108,9 +2108,9 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_data` ( -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `ttag` ( `id_tag` INT unsigned NOT NULL AUTO_INCREMENT, - `name` TEXT NOT NULL , - `description` TEXT NOT NULL, - `url` mediumtext NOT NULL, + `name` TEXT , + `description` TEXT, + `url` mediumTEXT, `email` TEXT NULL, `phone` TEXT NULL, `previous_name` TEXT NULL, @@ -2145,13 +2145,13 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` ( `id_sg` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_name` VARCHAR(600) NOT NULL DEFAULT '0', `id_group` INT, - `ip_dst` TEXT NOT NULL, - `ip_src` TEXT NOT NULL, - `dst_port` TEXT NOT NULL, - `src_port` TEXT NOT NULL, - `router_ip` TEXT NOT NULL, - `advanced_filter` TEXT NOT NULL, - `filter_args` TEXT NOT NULL, + `ip_dst` TEXT, + `ip_src` TEXT, + `dst_port` TEXT, + `src_port` TEXT, + `router_ip` TEXT, + `advanced_filter` TEXT, + `filter_args` TEXT, `aggregate` VARCHAR(60), PRIMARY KEY (`id_sg`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2162,9 +2162,9 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` ( CREATE TABLE IF NOT EXISTS `tnetflow_report` ( `id_report` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_name` VARCHAR(150) NOT NULL DEFAULT '', - `description` TEXT NOT NULL, + `description` TEXT, `id_group` INT, - `server_name` TEXT NOT NULL, + `server_name` TEXT, PRIMARY KEY(`id_report`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2175,7 +2175,7 @@ CREATE TABLE IF NOT EXISTS `tnetflow_report_content` ( `id_rc` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_report` INT UNSIGNED NOT NULL DEFAULT 0, `id_filter` INT UNSIGNED NOT NULL DEFAULT 0, - `description` TEXT NOT NULL, + `description` TEXT, `date` BIGINT NOT NULL DEFAULT 0, `period` INT NOT NULL DEFAULT 0, `max` INT NOT NULL DEFAULT 0, @@ -2206,8 +2206,8 @@ CREATE TABLE IF NOT EXISTS `tpassword_history` ( CREATE TABLE IF NOT EXISTS `tevent_response` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(600) NOT NULL DEFAULT '', - `description` TEXT NOT NULL, - `target` TEXT NOT NULL, + `description` TEXT, + `target` TEXT, `type` VARCHAR(60) NOT NULL, `id_group` MEDIUMINT NOT NULL DEFAULT 0, `modal_width` INT NOT NULL DEFAULT 0, @@ -2281,26 +2281,26 @@ CREATE TABLE IF NOT EXISTS `talert_snmp_action` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_alert_snmp` INT UNSIGNED NOT NULL DEFAULT 0, `alert_type` INT UNSIGNED NOT NULL DEFAULT 0, - `al_field1` TEXT NOT NULL, - `al_field2` TEXT NOT NULL, - `al_field3` TEXT NOT NULL, - `al_field4` TEXT NOT NULL, - `al_field5` TEXT NOT NULL, - `al_field6` TEXT NOT NULL, - `al_field7` TEXT NOT NULL, - `al_field8` TEXT NOT NULL, - `al_field9` TEXT NOT NULL, - `al_field10` TEXT NOT NULL, - `al_field11` TEXT NOT NULL, - `al_field12` TEXT NOT NULL, - `al_field13` TEXT NOT NULL, - `al_field14` TEXT NOT NULL, - `al_field15` TEXT NOT NULL, - `al_field16` TEXT NOT NULL, - `al_field17` TEXT NOT NULL, - `al_field18` TEXT NOT NULL, - `al_field19` TEXT NOT NULL, - `al_field20` TEXT NOT NULL, + `al_field1` TEXT, + `al_field2` TEXT, + `al_field3` TEXT, + `al_field4` TEXT, + `al_field5` TEXT, + `al_field6` TEXT, + `al_field7` TEXT, + `al_field8` TEXT, + `al_field9` TEXT, + `al_field10` TEXT, + `al_field11` TEXT, + `al_field12` TEXT, + `al_field13` TEXT, + `al_field14` TEXT, + `al_field15` TEXT, + `al_field16` TEXT, + `al_field17` TEXT, + `al_field18` TEXT, + `al_field19` TEXT, + `al_field20` TEXT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2384,8 +2384,8 @@ CREATE TABLE IF NOT EXISTS `trel_item` ( -- physical agents on Windows / Unix physical agents CREATE TABLE IF NOT EXISTS `tlocal_component` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TEXT NOT NULL, - `data` mediumtext NOT NULL, + `name` TEXT, + `data` mediumTEXT, `description` VARCHAR(1024) DEFAULT NULL, `id_os` INT UNSIGNED DEFAULT 0, `os_version` VARCHAR(100) DEFAULT '', @@ -2407,14 +2407,14 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( `unit` TEXT, `wizard_level` ENUM('basic','advanced','nowizard') DEFAULT 'nowizard', `macros` TEXT, - `critical_instructions` TEXT NOT NULL , - `warning_instructions` TEXT NOT NULL , - `unknown_instructions` TEXT NOT NULL , + `critical_instructions` TEXT , + `warning_instructions` TEXT , + `unknown_instructions` TEXT , `critical_inverse` TINYINT UNSIGNED DEFAULT 0, `warning_inverse` TINYINT UNSIGNED DEFAULT 0, `id_category` INT DEFAULT 0, - `tags` TEXT NOT NULL , - `disabled_types_event` TEXT NOT NULL , + `tags` TEXT , + `disabled_types_event` TEXT , `min_ff_event_normal` INT UNSIGNED DEFAULT 0, `min_ff_event_warning` INT UNSIGNED DEFAULT 0, `min_ff_event_critical` INT UNSIGNED DEFAULT 0, @@ -2442,7 +2442,7 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_policy` INT UNSIGNED NOT NULL DEFAULT 0, - `configuration_data` mediumtext NOT NULL, + `configuration_data` mediumTEXT, `id_tipo_modulo` SMALLINT NOT NULL DEFAULT 0, `description` VARCHAR(1024) NOT NULL DEFAULT '', `name` VARCHAR(200) NOT NULL DEFAULT '', @@ -2484,9 +2484,9 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `custom_integer_1` INT DEFAULT 0, `custom_integer_2` INT DEFAULT 0, `pending_delete` TINYINT DEFAULT 0, - `critical_instructions` TEXT NOT NULL , - `warning_instructions` TEXT NOT NULL , - `unknown_instructions` TEXT NOT NULL , + `critical_instructions` TEXT , + `warning_instructions` TEXT , + `unknown_instructions` TEXT , `critical_inverse` TINYINT UNSIGNED DEFAULT 0, `warning_inverse` TINYINT UNSIGNED DEFAULT 0, `id_category` INT DEFAULT 0, @@ -2494,8 +2494,8 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `quiet` TINYINT NOT NULL DEFAULT 0, `cron_interval` VARCHAR(100) DEFAULT '', `macros` TEXT, - `disabled_types_event` TEXT NOT NULL , - `module_macros` TEXT NOT NULL , + `disabled_types_event` TEXT , + `module_macros` TEXT , `min_ff_event_normal` INT UNSIGNED DEFAULT 0, `min_ff_event_warning` INT UNSIGNED DEFAULT 0, `min_ff_event_critical` INT UNSIGNED DEFAULT 0, @@ -2524,7 +2524,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( -- 'status' could be 0 (without changes, updated), 1 (needy update only database) or 2 (needy update database and conf files) CREATE TABLE IF NOT EXISTS `tpolicies` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TEXT NOT NULL , + `name` TEXT , `description` VARCHAR(255) NOT NULL DEFAULT '', `id_group` INT UNSIGNED DEFAULT 0, `status` INT UNSIGNED NOT NULL DEFAULT 0, @@ -2540,7 +2540,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_alerts` ( `id_policy` INT UNSIGNED NOT NULL DEFAULT 0, `id_policy_module` INT UNSIGNED DEFAULT 0, `id_alert_template` INT UNSIGNED DEFAULT 0, - `name_extern_module` TEXT NOT NULL , + `name_extern_module` TEXT , `disabled` TINYINT DEFAULT 0, `standby` TINYINT DEFAULT 0, `pending_delete` TINYINT DEFAULT 0, @@ -2619,8 +2619,8 @@ CREATE TABLE IF NOT EXISTS `twidget` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `class_name` VARCHAR(60) NOT NULL DEFAULT '', `unique_name` VARCHAR(60) NOT NULL DEFAULT '', - `description` TEXT NOT NULL , - `options` TEXT NOT NULL , + `description` TEXT , + `options` TEXT , `page` VARCHAR(120) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2630,8 +2630,8 @@ CREATE TABLE IF NOT EXISTS `twidget` ( -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `twidget_dashboard` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `position` TEXT NOT NULL , - `options` LONGtext NOT NULL , + `position` TEXT , + `options` LONGTEXT , `order` INT NOT NULL DEFAULT 0, `id_dashboard` INT UNSIGNED NOT NULL DEFAULT 0, `id_widget` INT UNSIGNED NOT NULL DEFAULT 0, @@ -2689,17 +2689,17 @@ CREATE TABLE IF NOT EXISTS `tagent_module_inventory` ( CREATE TABLE IF NOT EXISTS `tinventory_alert`( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_module_inventory` INT NOT NULL, - `actions` TEXT NOT NULL , + `actions` TEXT , `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, `condition` ENUM('WHITE_LIST', 'BLACK_LIST', 'MATCH') NOT NULL DEFAULT 'WHITE_LIST', - `value` TEXT NOT NULL , - `name` TINYTEXT NOT NULL , - `description` TEXT NOT NULL , + `value` TEXT , + `name` TINYTEXT , + `description` TEXT , `time_threshold` INT NOT NULL DEFAULT 0, - `last_fired` TEXT NOT NULL , + `last_fired` TEXT , `disable_event` TINYINT UNSIGNED DEFAULT 0, `enabled` TINYINT UNSIGNED DEFAULT 1, - `alert_groups` TEXT NOT NULL , + `alert_groups` TEXT , PRIMARY KEY (`id`), FOREIGN KEY (`id_module_inventory`) REFERENCES tmodule_inventory(`id_module_inventory`) ON DELETE CASCADE ON UPDATE CASCADE @@ -2769,11 +2769,11 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_setup` ( `meta_dbname` TEXT, `auth_token` TEXT, `id_group` INT UNSIGNED NOT NULL DEFAULT 0, - `api_password` TEXT NOT NULL, + `api_password` TEXT, `disabled` TINYINT UNSIGNED NOT NULL DEFAULT 0, `unified` TINYINT UNSIGNED NOT NULL DEFAULT 0, `last_event_replication` BIGINT DEFAULT 0, - `server_uid` TEXT NOT NULL , + `server_uid` TEXT , PRIMARY KEY (`id`) ) ENGINE=InnoDB COMMENT = 'Table to store metaconsole sources' @@ -2800,7 +2800,7 @@ DEFAULT CHARSET=UTF8MB4; CREATE TABLE IF NOT EXISTS `tservice` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NOT NULL DEFAULT '', - `description` TEXT NOT NULL , + `description` TEXT , `id_group` INT UNSIGNED NOT NULL DEFAULT 0, `critical` DOUBLE NOT NULL DEFAULT 0, `warning` DOUBLE NOT NULL DEFAULT 0, @@ -2840,7 +2840,7 @@ CREATE TABLE IF NOT EXISTS `tservice_element` ( `weight_warning` DOUBLE NOT NULL DEFAULT 0, `weight_critical` DOUBLE NOT NULL DEFAULT 0, `weight_unknown` DOUBLE NOT NULL DEFAULT 0, - `description` TEXT NOT NULL , + `description` TEXT , `id_agente_modulo` INT UNSIGNED NOT NULL DEFAULT 0, `id_agent` INT UNSIGNED NOT NULL DEFAULT 0, `id_service_child` INT UNSIGNED NOT NULL DEFAULT 0, @@ -2927,9 +2927,9 @@ CREATE TABLE IF NOT EXISTS `tsesion_extended` ( -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `tskin` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TEXT NOT NULL , - `relative_path` TEXT NOT NULL , - `description` TEXT NOT NULL , + `name` TEXT , + `relative_path` TEXT , + `description` TEXT , `disabled` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2999,16 +2999,16 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( `description` mediumtext, `order` INT UNSIGNED DEFAULT 0, `mode` ENUM('PASS','DROP'), - `field1` TEXT NOT NULL , - `field2` TEXT NOT NULL , - `field3` TEXT NOT NULL , - `field4` TEXT NOT NULL , - `field5` TEXT NOT NULL , - `field6` TEXT NOT NULL , - `field7` TEXT NOT NULL , - `field8` TEXT NOT NULL , - `field9` TEXT NOT NULL , - `field10` TEXT NOT NULL , + `field1` TEXT , + `field2` TEXT , + `field3` TEXT , + `field4` TEXT , + `field5` TEXT , + `field6` TEXT , + `field7` TEXT , + `field8` TEXT , + `field9` TEXT , + `field10` TEXT , `time_threshold` INT NOT NULL DEFAULT 86400, `max_alerts` INT UNSIGNED NOT NULL DEFAULT 1, `min_alerts` INT UNSIGNED NOT NULL DEFAULT 0, @@ -3022,8 +3022,8 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( `saturday` TINYINT DEFAULT 1, `sunday` TINYINT DEFAULT 1, `recovery_notify` TINYINT DEFAULT 0, - `field2_recovery` TEXT NOT NULL , - `field3_recovery` TEXT NOT NULL, + `field2_recovery` TEXT , + `field3_recovery` TEXT, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, `internal_counter` INT DEFAULT 0, `last_fired` BIGINT NOT NULL DEFAULT 0, @@ -3135,7 +3135,7 @@ CREATE TABLE IF NOT EXISTS `treport_template` ( `id_report` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_user` VARCHAR(100) NOT NULL DEFAULT '', `name` VARCHAR(150) NOT NULL DEFAULT '', - `description` TEXT NOT NULL, + `description` TEXT, `private` TINYINT UNSIGNED NOT NULL DEFAULT 0, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT NULL, `custom_logo` VARCHAR(200) DEFAULT NULL, @@ -3187,7 +3187,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` ( `order_uptodown` INT NOT NULL DEFAULT 0, `show_graph` INT NOT NULL DEFAULT 0, `group_by_agent` INT NOT NULL DEFAULT 0, - `style` TEXT NOT NULL, + `style` TEXT, `id_group` INT unsigned NOT NULL DEFAULT 0, `id_module_group` INT unsigned NOT NULL DEFAULT 0, `server_name` TEXT, @@ -3266,9 +3266,9 @@ CREATE TABLE IF NOT EXISTS `treport_content_item_temp` ( -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `tgraph_template` ( `id_graph_template` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `id_user` TEXT NOT NULL, - `name` TEXT NOT NULL, - `description` TEXT NOT NULL, + `id_user` TEXT, + `name` TEXT, + `description` TEXT, `period` INT NOT NULL DEFAULT 0, `width` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `height` SMALLINT UNSIGNED NOT NULL DEFAULT 0, @@ -3305,7 +3305,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( `group_name` VARCHAR(100) NOT NULL DEFAULT '', `estado` TINYINT UNSIGNED NOT NULL DEFAULT 0, `timestamp` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', - `evento` TEXT NOT NULL, + `evento` TEXT, `utimestamp` BIGINT NOT NULL DEFAULT 0, `event_type` ENUM('going_unknown','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change') DEFAULT 'unknown', `id_agentmodule` INT NOT NULL DEFAULT 0, @@ -3313,17 +3313,17 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( `id_alert_am` INT NOT NULL DEFAULT 0, `alert_template_name` TEXT, `criticity` INT UNSIGNED NOT NULL DEFAULT 0, - `user_comment` TEXT NOT NULL, - `tags` TEXT NOT NULL, - `source` TINYTEXT NOT NULL, - `id_extra` TINYTEXT NOT NULL, - `critical_instructions` TEXT NOT NULL , - `warning_instructions` TEXT NOT NULL , - `unknown_instructions` TEXT NOT NULL , + `user_comment` TEXT, + `tags` TEXT, + `source` TINYTEXT, + `id_extra` TINYTEXT, + `critical_instructions` TEXT , + `warning_instructions` TEXT , + `unknown_instructions` TEXT , `owner_user` VARCHAR(100) NOT NULL DEFAULT '', `ack_utimestamp` BIGINT NOT NULL DEFAULT 0, `server_id` INT NOT NULL, - `custom_data` TEXT NOT NULL , + `custom_data` TEXT , `data` TINYTEXT , `module_status` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id_evento`), @@ -3357,7 +3357,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` ( `group_name` VARCHAR(100) NOT NULL DEFAULT '', `estado` TINYINT UNSIGNED NOT NULL DEFAULT 0, `timestamp` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', - `evento` TEXT NOT NULL, + `evento` TEXT, `utimestamp` BIGINT NOT NULL DEFAULT 0, `event_type` ENUM('going_unknown','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change') DEFAULT 'unknown', `id_agentmodule` INT NOT NULL DEFAULT 0, @@ -3365,17 +3365,17 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` ( `id_alert_am` INT NOT NULL DEFAULT 0, `alert_template_name` TEXT, `criticity` INT UNSIGNED NOT NULL DEFAULT 0, - `user_comment` TEXT NOT NULL, - `tags` TEXT NOT NULL, - `source` TINYTEXT NOT NULL, - `id_extra` TINYTEXT NOT NULL, - `critical_instructions` TEXT NOT NULL , - `warning_instructions` TEXT NOT NULL , - `unknown_instructions` TEXT NOT NULL , + `user_comment` TEXT, + `tags` TEXT, + `source` TINYTEXT, + `id_extra` TINYTEXT, + `critical_instructions` TEXT , + `warning_instructions` TEXT , + `unknown_instructions` TEXT , `owner_user` VARCHAR(100) NOT NULL DEFAULT '', `ack_utimestamp` BIGINT NOT NULL DEFAULT 0, `server_id` INT NOT NULL, - `custom_data` TEXT NOT NULL , + `custom_data` TEXT , `data` DOUBLE DEFAULT NULL, `module_status` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id_evento`), @@ -3399,8 +3399,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` ( CREATE TABLE IF NOT EXISTS `textension_translate_string` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `lang` VARCHAR(10) NOT NULL , - `string` TEXT NOT NULL , - `translation` TEXT NOT NULL , + `string` TEXT , + `translation` TEXT , PRIMARY KEY (`id`), KEY `lang_index` (`lang`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -3411,7 +3411,7 @@ CREATE TABLE IF NOT EXISTS `textension_translate_string` ( CREATE TABLE IF NOT EXISTS `tagent_module_log` ( `id_agent_module_log` INT NOT NULL AUTO_INCREMENT, `id_agent` INT UNSIGNED NOT NULL, - `source` TEXT NOT NULL, + `source` TEXT, `timestamp` DATETIME DEFAULT '1970-01-01 00:00:00', `utimestamp` BIGINT DEFAULT 0, PRIMARY KEY (`id_agent_module_log`) @@ -3422,7 +3422,7 @@ CREATE TABLE IF NOT EXISTS `tagent_module_log` ( -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tevent_custom_field` ( `id_group` MEDIUMINT UNSIGNED NOT NULL, - `value` TEXT NOT NULL, + `value` TEXT, PRIMARY KEY (`id_group`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -3528,9 +3528,9 @@ CREATE TABLE IF NOT EXISTS `treset_pass` ( CREATE TABLE IF NOT EXISTS `tcluster`( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TINYTEXT NOT NULL , + `name` TINYTEXT , `cluster_type` ENUM('AA','AP') NOT NULL DEFAULT 'AA', - `description` TEXT NOT NULL , + `description` TEXT , `group` INT UNSIGNED NOT NULL DEFAULT 0, `id_agent` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`) @@ -3542,7 +3542,7 @@ CREATE TABLE IF NOT EXISTS `tcluster`( CREATE TABLE IF NOT EXISTS `tcluster_item`( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` TINYTEXT NOT NULL , + `name` TINYTEXT , `item_type` ENUM('AA','AP') NOT NULL DEFAULT 'AA', `critical_limit` INT UNSIGNED NOT NULL DEFAULT 0, `warning_limit` INT UNSIGNED NOT NULL DEFAULT 0, @@ -3731,7 +3731,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `image` VARCHAR(200) DEFAULT '', `type` TINYINT UNSIGNED NOT NULL DEFAULT 0, `period` INT UNSIGNED NOT NULL DEFAULT 3600, - `module_name` TEXT NOT NULL, + `module_name` TEXT, `agent_name` VARCHAR(600) NOT NULL DEFAULT '', `id_layout_linked` INT unsigned NOT NULL DEFAULT 0, `parent_item` INT UNSIGNED NOT NULL DEFAULT 0, @@ -3766,9 +3766,9 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `title` TEXT NOT NULL, - `regexp` TEXT NOT NULL, - `fields` TEXT NOT NULL, + `title` TEXT, + `regexp` TEXT, + `fields` TEXT, `average` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -3810,7 +3810,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_matrix` ( CREATE TABLE IF NOT EXISTS `tuser_task` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `function_name` VARCHAR(80) NOT NULL DEFAULT '', - `parameters` TEXT NOT NULL , + `parameters` TEXT , `name` VARCHAR(60) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -3822,7 +3822,7 @@ CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_usuario` VARCHAR(60) NOT NULL DEFAULT '0', `id_user_task` INT UNSIGNED NOT NULL DEFAULT 0, - `args` TEXT NOT NULL, + `args` TEXT, `scheduled` ENUM('no','hourly','daily','weekly','monthly','yearly','custom') DEFAULT 'no', `last_run` INT UNSIGNED DEFAULT 0, `custom_data` INT NULL DEFAULT 0, @@ -3839,7 +3839,7 @@ CREATE TABLE IF NOT EXISTS `tvisual_console_elements_cache` ( `vc_id` INT UNSIGNED NOT NULL, `vc_item_id` INT UNSIGNED NOT NULL, `user_id` VARCHAR(60) DEFAULT NULL, - `data` TEXT NOT NULL, + `data` TEXT, `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `expiration` INT UNSIGNED NOT NULL COMMENT 'Seconds to expire', PRIMARY KEY(`id`), @@ -3966,7 +3966,7 @@ CREATE TABLE IF NOT EXISTS `tipam_network` ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `network` VARCHAR(100) NOT NULL DEFAULT '', `name_network` VARCHAR(255) DEFAULT '', - `description` TEXT NOT NULL, + `description` TEXT, `location` INT UNSIGNED NULL, `id_recon_task` INT UNSIGNED NOT NULL, `scan_interval` TINYINT DEFAULT 1, @@ -3995,9 +3995,9 @@ CREATE TABLE IF NOT EXISTS `tipam_ip` ( `ip_dec` INT UNSIGNED NOT NULL, `id_os` INT UNSIGNED NOT NULL, `forced_os` TINYINT NOT NULL DEFAULT 0, - `hostname` TINYTEXT NOT NULL, + `hostname` TINYTEXT, `forced_hostname` TINYINT NOT NULL DEFAULT 0, - `comments` TEXT NOT NULL, + `comments` TEXT, `alive` TINYINT NOT NULL DEFAULT 0, `managed` TINYINT NOT NULL DEFAULT 0, `reserved` TINYINT NOT NULL DEFAULT 0, diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index bcad5b2b80..c63d30d144 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1614,20 +1614,20 @@ VALUES SET @template_name = 'Network Management'; SET @template_description = 'Basic network monitoring template'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Network Management')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Cisco MIBS'; SET @template_description = 'Cisco devices monitoring template (SNMP)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Cisco MIBS' OR g.name = 'Catalyst 2900')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); INSERT INTO tnetwork_profile_pen (pen, id_np) SELECT * FROM (SELECT p.pen pen, np.id_np id_np FROM tnetwork_profile np, tpen p WHERE np.name = @template_name AND (p.pen = 9)) AS tmp WHERE NOT EXISTS (SELECT pp.id_np FROM tnetwork_profile p, tnetwork_profile_pen pp WHERE p.id_np = pp.id_np AND p.name = @template_name); SET @template_name = 'Linux System'; SET @template_description = 'Linux system monitoring template (SNMP)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); SET @module_group = 'Linux'; @@ -1637,79 +1637,79 @@ INSERT INTO tnetwork_profile_pen (pen, id_np) SELECT * FROM (SELECT p.pen pen, n SET @template_name = 'Windows System'; SET @template_description = 'Windows system monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Microsoft Windows' OR g.name = 'Windows System')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows Hardware'; SET @template_description = 'Windows hardware monitoring templae (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows Hardware Layer')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows Active Directory'; SET @template_description = 'Active directory monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows AD' OR g.name = 'AD Counters')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows IIS'; SET @template_description = 'IIS monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows IIS' OR g.name = 'IIS services')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows Exchange'; SET @template_description = 'Exchange monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows Exchange' OR g.name = 'Exchange Services' OR g.name = 'Exchange TCP Ports')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows LDAP'; SET @template_description = 'LDAP monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows LDAP')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows MDSTC'; SET @template_description = 'MDSTC monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows MSDTC')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows Printers'; SET @template_description = 'Windows printers monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows Printers')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows DNS'; SET @template_description = 'Windows DNS monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Windows DNS' OR g.name = 'DNS Counters')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows MS SQL Server'; SET @template_description = 'MS SQL Server monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'MS SQL Server')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Oracle'; SET @template_description = 'Oracle monitoring template'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Oracle')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'MySQL'; SET @template_description = 'MySQL monitoring template'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'MySQL')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); SET @template_name = 'Windows Antivirus'; SET @template_description = 'Windows antivirus monitoring template (WMI)'; -INSERT INTO tnetwork_profile (id_np, name, description) SELECT * FROM (SELECT '' id_np, @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); +INSERT INTO tnetwork_profile (name, description) SELECT * FROM (SELECT @template_name name, @template_description description) AS tmp WHERE NOT EXISTS (SELECT id_np FROM tnetwork_profile WHERE name = @template_name); INSERT INTO tnetwork_profile_component (id_nc, id_np) SELECT * FROM (SELECT c.id_nc id_nc, p.id_np id_np FROM tnetwork_profile p, tnetwork_component c, tnetwork_component_group g WHERE g.id_sg = c.id_group AND p.name = @template_name AND (g.name = 'Norton' OR g.name = 'Panda' OR g.name = 'McAfee' OR g.name = 'Bitdefender' OR g.name = 'BullGuard' OR g.name = 'AVG' OR g.name = 'Kaspersky')) AS tmp WHERE NOT EXISTS (SELECT pc.id_np FROM tnetwork_profile p, tnetwork_profile_component pc WHERE p.id_np = pc.id_np AND p.name = @template_name); -- ------------------------------------------------------------------------