From 3056c6741acc5bf52b785afe12b0aef0b78e59d1 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 28 Oct 2019 12:20:55 +0100 Subject: [PATCH] changes bbdd mr34 --- pandora_console/extras/mr/34.sql | 28 +++++++++++++++ .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 35 +++++++++++++++++-- pandora_console/pandoradb.sql | 31 ++++++++++++++++ pandora_console/pandoradb_data.sql | 4 +-- 4 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 pandora_console/extras/mr/34.sql diff --git a/pandora_console/extras/mr/34.sql b/pandora_console/extras/mr/34.sql new file mode 100644 index 0000000000..1e28c01b69 --- /dev/null +++ b/pandora_console/extras/mr/34.sql @@ -0,0 +1,28 @@ +START TRANSACTION; + +CREATE TABLE `tremote_command` ( + `id` SERIAL, + `name` varchar(150) NOT NULL, + `timeout` int(10) unsigned NOT NULL default 30, + `retries` int(10) unsigned NOT NULL default 3, + `preconditions` text, + `script` text, + `postconditions` text, + `utimestamp` int(20) unsigned NOT NULL default 0, + `id_group` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tremote_command_target` ( + `rcmd_id` SERIAL, + `id_agente` int(10) unsigned NOT NULL, + `utimestamp` int(20) unsigned NOT NULL default 0, + `stdout` text, + `stderr` text, + `errorlevel` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`rcmd_id`), + FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 6476e79e2b..1cf541d6e5 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1247,13 +1247,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 32); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 34); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '739'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '741'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; @@ -2293,3 +2293,34 @@ CREATE TABLE `tdeployment_hosts` ( FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`) ON UPDATE CASCADE ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tremote_command` +-- ---------------------------------------------------------------------- +CREATE TABLE `tremote_command` ( + `id` SERIAL, + `name` varchar(150) NOT NULL, + `timeout` int(10) unsigned NOT NULL default 30, + `retries` int(10) unsigned NOT NULL default 3, + `preconditions` text, + `script` text, + `postconditions` text, + `utimestamp` int(20) unsigned NOT NULL default 0, + `id_group` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tremote_command_target` +-- ---------------------------------------------------------------------- +CREATE TABLE `tremote_command_target` ( + `rcmd_id` SERIAL, + `id_agente` int(10) unsigned NOT NULL, + `utimestamp` int(20) unsigned NOT NULL default 0, + `stdout` text, + `stderr` text, + `errorlevel` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`rcmd_id`), + FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 3786c4dad3..59ee15dd62 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3657,3 +3657,34 @@ CREATE TABLE `tdeployment_hosts` ( FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`) ON UPDATE CASCADE ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tremote_command` +-- ---------------------------------------------------------------------- +CREATE TABLE `tremote_command` ( + `id` SERIAL, + `name` varchar(150) NOT NULL, + `timeout` int(10) unsigned NOT NULL default 30, + `retries` int(10) unsigned NOT NULL default 3, + `preconditions` text, + `script` text, + `postconditions` text, + `utimestamp` int(20) unsigned NOT NULL default 0, + `id_group` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tremote_command_target` +-- ---------------------------------------------------------------------- +CREATE TABLE `tremote_command_target` ( + `rcmd_id` SERIAL, + `id_agente` int(10) unsigned NOT NULL, + `utimestamp` int(20) unsigned NOT NULL default 0, + `stdout` text, + `stderr` text, + `errorlevel` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`rcmd_id`), + FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 686f4aa487..0a1be20b03 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_header', ''), ('custom_report_front_footer', ''), -('MR', 32), +('MR', 34), ('identification_reminder', 1), ('identification_reminder_timestamp', 0), -('current_package_enterprise', '739'), +('current_package_enterprise', '741'), ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'), ('custom_docs_logo', 'default_docs.png'), ('custom_support_logo', 'default_support.png'),