2012-10-01 Sergio Martin <sergio.martin@artica.es>

* pandoradb.sql
	pandoradb.postgreSQL.sql
	pandoradb.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Added
	owner and ack timestamp to event table and new last known status
	in tagente_estado table



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7017 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-10-01 14:04:30 +00:00
parent ededdd89cb
commit f25e0f7a92
7 changed files with 52 additions and 14 deletions

View File

@ -1,3 +1,14 @@
2012-10-01 Sergio Martin <sergio.martin@artica.es>
* pandoradb.sql
pandoradb.postgreSQL.sql
pandoradb.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Added
owner and ack timestamp to event table and new last known status
in tagente_estado table
2012-10-01 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/setup/setup.php,

View File

@ -122,6 +122,8 @@ ALTER TABLE `tevento` MODIFY COLUMN `event_type` ENUM('going_unknown','unknown',
ALTER TABLE `tevento` ADD COLUMN `critical_instructions` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tevento` ADD COLUMN `warning_instructions` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tevento` ADD COLUMN `unknown_instructions` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tevento` ADD COLUMN `owner_user` VARCHAR(100) NOT NULL DEFAULT '';
ALTER TABLE `tevento` ADD COLUMN `ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0';
------------------------------------------------------------------------
-- Table `tgrupo`
@ -146,6 +148,8 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `critical_instructions` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tagente_modulo` ADD COLUMN `warning_instructions` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tagente_modulo` ADD COLUMN `unknown_instructions` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tagente_modulo` ADD COLUMN `critical_inverse` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `warning_inverse` tinyint(1) NOT NULL DEFAULT '0';
------------------------------------------------------------------------
-- Table `tnetwork_component`
@ -303,3 +307,7 @@ ALTER TABLE tlayout_data ADD COLUMN `enable_link` tinyint(1) UNSIGNED NOT NULL
ALTER TABLE tnetwork_map ADD `text_filter` VARCHAR(100) NOT NULL DEFAULT "";
ALTER TABLE tnetwork_map ADD `dont_show_subgroups` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
------------------------------------------------------------------------
-- Table `tagente_estado`
------------------------------------------------------------------------
ALTER TABLE `tagente_estado` ADD COLUMN `last_known_status` tinyint(4) NOT NULL DEFAULT 0;

View File

@ -143,6 +143,12 @@ CREATE OR REPLACE TRIGGER tplanned_downtime_modules_inc BEFORE INSERT ON tplanne
-- -----------------------------------------------------
ALTER TABLE tevento ADD (source VARCHAR2(100) default '' NOT NULL);
ALTER TABLE tevento ADD (id_extra VARCHAR2(100) default '' NOT NULL);
ALTER TABLE tevento ADD (critical_instructions VARCHAR2(255) default '');
ALTER TABLE tevento ADD (warning_instructions VARCHAR2(255) default '');
ALTER TABLE tevento ADD (unknown_instructions VARCHAR2(255) default '');
ALTER TABLE tevento MODIFY CONSTRAINT tevento_event_type_cons CHECK (event_type IN ('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'))
ALTER TABLE tevento ADD (owner_user VARCHAR2(100) NOT NULL default '0');
ALTER TABLE tevento ADD (ack_utimestamp NUMBER(19, 0) NOT NULL default 0);
-- -----------------------------------------------------
-- Table `tgrupo`
@ -310,14 +316,6 @@ ALTER TABLE trecon_task MODIFY field1 TEXT NOT NULL;
-- -----------------------------------------------------
ALTER TABLE tlayout_data ADD (enable_link NUMBER(5, 0) NOT NULL default 1);
-- -----------------------------------------------------
-- Table `tevento`
-- -----------------------------------------------------
ALTER TABLE tevento ADD (critical_instructions VARCHAR2(255) default '');
ALTER TABLE tevento ADD (warning_instructions VARCHAR2(255) default '');
ALTER TABLE tevento ADD (unknown_instructions VARCHAR2(255) default '');
ALTER TABLE tevento MODIFY CONSTRAINT tevento_event_type_cons CHECK (event_type IN ('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'))
-- -----------------------------------------------------
-- Table `tagente_modulo`
-- -----------------------------------------------------
@ -336,4 +334,9 @@ ALTER TABLE tnetwork_component ADD (unknown_instructions VARCHAR2(255) default '
-- Table `tnetwork_map`
------------------------------------------------------------------------
ALTER TABLE tnetwork_map ADD (text_filter VARCHAR(100) DEFAULT '');
ALTER TABLE tnetwork_map ADD (dont_show_subgroups NUMBER(10, 0) default 0 NOT NULL);
ALTER TABLE tnetwork_map ADD (dont_show_subgroups NUMBER(10, 0) default 0 NOT NULL);
------------------------------------------------------------------------
-- Table `tagente_estado`
------------------------------------------------------------------------
ALTER TABLE tagente_estado ADD (last_known_status NUMBER(5, 0) default 0 NOT NULL);

View File

@ -138,7 +138,9 @@ ALTER TABLE "tevento" ADD COLUMN "critical_instructions" text default '';
ALTER TABLE "tevento" ADD COLUMN "warning_instructions" text default '';
ALTER TABLE "tevento" ADD COLUMN "unknown_instructions" text default '';
ALTER TYPE type_tevento_event ADD VALUE 'going_unknown' BEFORE 'unknown';
ALTER TABLE "tevento" ADD COLUMN "owner_user" varchar(100) NOT NULL default '0';
ALTER TABLE "tevento" ADD COLUMN "ack_utimestamp" BIGINT NOT NULL default 0;
-- -----------------------------------------------------
-- Table `tgrupo`
-- -----------------------------------------------------
@ -324,4 +326,9 @@ ALTER TABLE "tnetwork_component" ADD COLUMN "unknown_instructions" text default
-- Table `tnetwork_map`
------------------------------------------------------------------------
ALTER TABLE "tnetwork_map" ADD COLUMN "text_filter" VARCHAR(100) DEFAULT '';
ALTER TABLE "tnetwork_map" ADD COLUMN "dont_show_subgroups" INTEGER NOT NULL DEFAULT 0;
ALTER TABLE "tnetwork_map" ADD COLUMN "dont_show_subgroups" INTEGER NOT NULL DEFAULT 0;
------------------------------------------------------------------------
-- Table `tagente_estado`
------------------------------------------------------------------------
ALTER TABLE "tagente_estado" ADD COLUMN "last_known_status" INTEGER default 0;

View File

@ -153,7 +153,8 @@ CREATE TABLE tagente_estado (
running_by NUMBER(10, 0) default 0,
last_execution_try NUMBER(19, 0) default 0 NOT NULL,
status_changes NUMBER(10, 0) default 0,
last_status NUMBER(10, 0) default 0
last_status NUMBER(10, 0) default 0,
last_known_status NUMBER(10, 0) default 0
);
CREATE INDEX tagente_estado_id_agente_idx ON tagente_estado(id_agente);
CREATE INDEX tagente_estado_estado_idx ON tagente_estado(estado);
@ -544,6 +545,8 @@ CREATE TABLE tevento (
critical_instructions VARCHAR2(255) default '',
warning_instructions VARCHAR2(255) default '',
unknown_instructions VARCHAR2(255) default '',
owner_user VARCHAR2(100) default '0' NOT NULL,
ack_utimestamp NUMBER(19, 0) default 0 NOT NULL,
CONSTRAINT tevento_event_type_cons CHECK (event_type IN ('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'))
);
CREATE INDEX tevento_id_1_idx ON tevento(id_agente, id_evento);

View File

@ -146,7 +146,8 @@ CREATE TABLE "tagente_estado" (
"running_by" INTEGER default 0,
"last_execution_try" BIGINT NOT NULL default 0,
"status_changes" INTEGER default 0,
"last_status" INTEGER default 0
"last_status" INTEGER default 0,
"last_known_status" INTEGER default 0
);
CREATE INDEX "tagente_estado_id_agente_modulo_idx" ON "tagente_estado"("id_agente_modulo");
CREATE INDEX "tagente_estado_id_agente_idx" ON "tagente_estado"("id_agente");
@ -444,7 +445,9 @@ CREATE TABLE "tevento" (
"id_extra" text NOT NULL default '',
"critical_instructions" TEXT default '',
"warning_instructions" TEXT default '',
"unknown_instructions" TEXT default ''
"unknown_instructions" TEXT default '',
"owner_user" varchar(100) NOT NULL default '0',
"ack_utimestamp" BIGINT NOT NULL default 0
);
CREATE INDEX "tevento_id_1_idx" ON "tevento"("id_agente", "id_evento");
CREATE INDEX "tevento_id_2_idx" ON "tevento"("utimestamp", "id_evento");

View File

@ -145,6 +145,7 @@ CREATE TABLE `tagente_estado` (
`last_execution_try` bigint(20) NOT NULL default '0',
`status_changes` tinyint(4) default 0,
`last_status` tinyint(4) default 0,
`last_known_status` tinyint(4) default 0,
PRIMARY KEY (`id_agente_estado`),
KEY `status_index_1` (`id_agente_modulo`),
KEY `idx_agente` (`id_agente`),
@ -523,6 +524,8 @@ CREATE TABLE IF NOT EXISTS `tevento` (
`critical_instructions` text NOT NULL default '',
`warning_instructions` text NOT NULL default '',
`unknown_instructions` text NOT NULL default '',
`owner_user` VARCHAR(100) NOT NULL DEFAULT '',
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_evento`),
KEY `indice_1` (`id_agente`,`id_evento`),
KEY `indice_2` (`utimestamp`,`id_evento`),