From 0f6f7b6563bea35ae41442531274b5cd3391bc96 Mon Sep 17 00:00:00 2001 From: "edu.corral" Date: Fri, 21 Oct 2022 13:22:14 +0200 Subject: [PATCH] ent 7914 status scaling based on time --- pandora_console/extras/mr/58.sql | 5 +++++ .../extras/pandoradb_migrate_5.1_to_6.0.mysql.sql | 4 ++++ pandora_console/pandoradb.sql | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/pandora_console/extras/mr/58.sql b/pandora_console/extras/mr/58.sql index 3a481f56d8..73f014ae5a 100644 --- a/pandora_console/extras/mr/58.sql +++ b/pandora_console/extras/mr/58.sql @@ -12,4 +12,9 @@ ALTER TABLE `tnetwork_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFA ALTER TABLE `tlocal_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0; ALTER TABLE `tpolicy_modules` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `tagente_modulo` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `tnetwork_component` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `tlocal_component` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `tpolicy_modules` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; + COMMIT; 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 458bcaed97..80ffd395b0 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 @@ -175,6 +175,7 @@ ALTER TABLE tagente_modulo ADD COLUMN `prediction_threshold` int(4) default 0; ALTER TABLE tagente_modulo ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE tagente_modulo ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE tagente_modulo ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE tagente_modulo ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; -- --------------------------------------------------------------------- -- Table `tagente_estado` @@ -199,6 +200,7 @@ ALTER TABLE tevent_filter ADD COLUMN `id_agent` int(25) DEFAULT 0; ALTER TABLE `tnetwork_component` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE `tnetwork_component` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE `tnetwork_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `tnetwork_component` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; -- --------------------------------------------------------------------- -- Table `tevent_filter` @@ -206,6 +208,7 @@ ALTER TABLE `tnetwork_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFA ALTER TABLE `tlocal_component` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE `tlocal_component` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE `local_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `local_component` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; -- --------------------------------------------------------------------- -- Table `tevent_filter` @@ -213,3 +216,4 @@ ALTER TABLE `local_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT ALTER TABLE `tpolicy_modules` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE `tpolicy_modules` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; ALTER TABLE `tpolicy_modules` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0; +ALTER TABLE `tpolicy_modules` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index b0ef33913c..fbcf268dd2 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -272,6 +272,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `percentage_critical` TINYINT UNSIGNED DEFAULT 0, `percentage_warning` TINYINT UNSIGNED DEFAULT 0, `warning_time` INT UNSIGNED DEFAULT 0, + `warning_count` INT UNSIGNED DEFAULT 0, PRIMARY KEY (`id_agente_modulo`), KEY `main_idx` (`id_agente_modulo`,`id_agente`), KEY `tam_agente` (`id_agente`), @@ -1003,6 +1004,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `percentage_critical` TINYINT UNSIGNED DEFAULT 0, `percentage_warning` TINYINT UNSIGNED DEFAULT 0, `warning_time` INT UNSIGNED DEFAULT 0, + `warning_count` INT UNSIGNED DEFAULT 0, PRIMARY KEY (`id_nc`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -2422,6 +2424,7 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( `percentage_critical` TINYINT UNSIGNED DEFAULT 0, `percentage_warning` TINYINT UNSIGNED DEFAULT 0, `warning_time` INT UNSIGNED DEFAULT 0, + `warning_count` INT UNSIGNED DEFAULT 0, PRIMARY KEY (`id`), FOREIGN KEY (`id_network_component_group`) REFERENCES tnetwork_component_group(`id_sg`) ON DELETE CASCADE ON UPDATE CASCADE @@ -2505,6 +2508,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `percentage_warning` TINYINT UNSIGNED DEFAULT 0, `percentage_critical` TINYINT UNSIGNED DEFAULT 0, `warning_time` INT UNSIGNED DEFAULT 0, + `warning_count` INT UNSIGNED DEFAULT 0, PRIMARY KEY (`id`), KEY `main_idx` (`id_policy`), UNIQUE (`id_policy`, `name`)