diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ac20ba61b6..cfcd77e1ca 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2013-02-13 Miguel de Dios + + * extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: fixed a important + bug when try to upgrade a Pandora4 (SVN version or updated version) + to Pandora5 or have user defined groups in the table + "tnetwork_component_group" that throw error when try to upgrade and + stop the upgrading. + 2013-02-13 Sergio Martin * include/graphs/functions_flot.php diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index 0063186a3a..da62cb7306 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -1020,40 +1020,40 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma -- Adding news network_component_groups -- --------------------------------------------------------------------- -INSERT INTO `tnetwork_component_group` VALUES (15,'Databases',0); -INSERT INTO `tnetwork_component_group` VALUES (16,'Windows System',14); -INSERT INTO `tnetwork_component_group` VALUES (17,'Windows Hardware Layer',14); -INSERT INTO `tnetwork_component_group` VALUES (18,'Windows AD ',14); -INSERT INTO `tnetwork_component_group` VALUES (19,'Windows IIS ',14); -INSERT INTO `tnetwork_component_group` VALUES (20,'Windows Exchange',14); -INSERT INTO `tnetwork_component_group` VALUES (21,'Windows LDAP ',14); -INSERT INTO `tnetwork_component_group` VALUES (22,'Windows MSDTC ',14); -INSERT INTO `tnetwork_component_group` VALUES (23,'Catalyst 2900 ',2); -INSERT INTO `tnetwork_component_group` VALUES (24,'Windows Printers',14); -INSERT INTO `tnetwork_component_group` VALUES (25,'Citrix',0); -INSERT INTO `tnetwork_component_group` VALUES (26,'Exchange Services',20); -INSERT INTO `tnetwork_component_group` VALUES (27,'MS SQL Server',15); -INSERT INTO `tnetwork_component_group` VALUES (28,'Oracle',15); -INSERT INTO `tnetwork_component_group` VALUES (29,'Antivirus',0); -INSERT INTO `tnetwork_component_group` VALUES (30,'Norton',29); -INSERT INTO `tnetwork_component_group` VALUES (31,'Panda',29); -INSERT INTO `tnetwork_component_group` VALUES (32,'McAfee',29); -INSERT INTO `tnetwork_component_group` VALUES (33,'Bitdefender',29); -INSERT INTO `tnetwork_component_group` VALUES (34,'Windows DNS',14); -INSERT INTO `tnetwork_component_group` VALUES (35,'DNS Counters',34); -INSERT INTO `tnetwork_component_group` VALUES (36,'AD Counters',18); -INSERT INTO `tnetwork_component_group` VALUES (37,'BullGuard',29); -INSERT INTO `tnetwork_component_group` VALUES (38,'IIS services',19); -INSERT INTO `tnetwork_component_group` VALUES (39,'Exchange TCP Ports',20); -INSERT INTO `tnetwork_component_group` VALUES (40,'AVG',29); -INSERT INTO `tnetwork_component_group` VALUES (41,'Kaspersky',29); -INSERT INTO `tnetwork_component_group` VALUES (42,'MySQL',15); -INSERT INTO `tnetwork_component_group` VALUES (43,'Linux',5); -INSERT INTO `tnetwork_component_group` VALUES (44,'HP-UX',5); -INSERT INTO `tnetwork_component_group` VALUES (45,'Solaris',5); -INSERT INTO `tnetwork_component_group` VALUES (46,'AIX',5); -INSERT INTO `tnetwork_component_group` VALUES (47,'BSD',5); -INSERT INTO `tnetwork_component_group` VALUES (48,'MacOS',0); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 15,'Databases',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 15); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 16,'Windows System',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 16); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 17,'Windows Hardware Layer',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 17); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 18,'Windows AD ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 18); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 19,'Windows IIS ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 19); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 20,'Windows Exchange',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 20); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 21,'Windows LDAP ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 21); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 22,'Windows MSDTC ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 22); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 23,'Catalyst 2900 ',2 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 23); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 24,'Windows Printers',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 24); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 25,'Citrix',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 25); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 26,'Exchange Services',20 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 26); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 27,'MS SQL Server',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 27); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 28,'Oracle',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 28); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 29,'Antivirus',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 29); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 30,'Norton',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 30); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 31,'Panda',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 31); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 32,'McAfee',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 32); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 33,'Bitdefender',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 33); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 34,'Windows DNS',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 34); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 35,'DNS Counters',34 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 35); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 36,'AD Counters',18 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 36); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 37,'BullGuard',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 37); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 38,'IIS services',19 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 38); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 39,'Exchange TCP Ports',20 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 39); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 40,'AVG',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 40); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 41,'Kaspersky',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 41); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 42,'MySQL',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 42); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 43,'Linux',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 43); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 44,'HP-UX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 44); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 45,'Solaris',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 45); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 46,'AIX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 46); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 47,'BSD',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 47); +INSERT INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) SELECT * FROM (SELECT 48,'MacOS',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT `id_sg` FROM `tnetwork_component_group` WHERE `id_sg` = 48); -- --------------------------------------------------------------------- -- Drop tables of compound alerts diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index a0f1c30277..91a834b22a 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -1048,37 +1048,37 @@ INSERT INTO tnetwork_component (name, description, id_group, type, max, min, mod -- Adding news network_component_groups -- --------------------------------------------------------------------- -INSERT INTO tnetwork_component_group VALUES (15,'Databases',0); -INSERT INTO tnetwork_component_group VALUES (16,'Windows System',14); -INSERT INTO tnetwork_component_group VALUES (17,'Windows Hardware Layer',14); -INSERT INTO tnetwork_component_group VALUES (18,'Windows AD ',14); -INSERT INTO tnetwork_component_group VALUES (19,'Windows IIS ',14); -INSERT INTO tnetwork_component_group VALUES (20,'Windows Exchange',14); -INSERT INTO tnetwork_component_group VALUES (21,'Windows LDAP ',14); -INSERT INTO tnetwork_component_group VALUES (22,'Windows MSDTC ',14); -INSERT INTO tnetwork_component_group VALUES (23,'Catalyst 2900 ',2); -INSERT INTO tnetwork_component_group VALUES (24,'Windows Printers',14); -INSERT INTO tnetwork_component_group VALUES (25,'Citrix',0); -INSERT INTO tnetwork_component_group VALUES (26,'Exchange Services',20); -INSERT INTO tnetwork_component_group VALUES (27,'MS SQL Server',15); -INSERT INTO tnetwork_component_group VALUES (28,'Oracle',15); -INSERT INTO tnetwork_component_group VALUES (29,'Antivirus',0); -INSERT INTO tnetwork_component_group VALUES (30,'Norton',29); -INSERT INTO tnetwork_component_group VALUES (31,'Panda',29); -INSERT INTO tnetwork_component_group VALUES (32,'McAfee',29); -INSERT INTO tnetwork_component_group VALUES (33,'Bitdefender',29); -INSERT INTO tnetwork_component_group VALUES (34,'Windows DNS',14); -INSERT INTO tnetwork_component_group VALUES (35,'DNS Counters',34); -INSERT INTO tnetwork_component_group VALUES (36,'AD Counters',18); -INSERT INTO tnetwork_component_group VALUES (37,'BullGuard',29); -INSERT INTO tnetwork_component_group VALUES (38,'IIS services',19); -INSERT INTO tnetwork_component_group VALUES (39,'Exchange TCP Ports',20); -INSERT INTO tnetwork_component_group VALUES (40,'AVG',29); -INSERT INTO tnetwork_component_group VALUES (41,'Kaspersky',29); -INSERT INTO tnetwork_component_group VALUES (42,'MySQL',15); -INSERT INTO tnetwork_component_group VALUES (43,'Linux',5); -INSERT INTO tnetwork_component_group VALUES (44,'HP-UX',5); -INSERT INTO tnetwork_component_group VALUES (45,'Solaris',5); -INSERT INTO tnetwork_component_group VALUES (46,'AIX',5); -INSERT INTO tnetwork_component_group VALUES (47,'BSD',5); -INSERT INTO tnetwork_component_group VALUES (48,'MacOS',0); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 15,'Databases',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 15); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 16,'Windows System',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 16); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 17,'Windows Hardware Layer',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 17); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 18,'Windows AD ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 18); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 19,'Windows IIS ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 19); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 20,'Windows Exchange',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 20); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 21,'Windows LDAP ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 21); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 22,'Windows MSDTC ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 22); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 23,'Catalyst 2900 ',2 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 23); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 24,'Windows Printers',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 24); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 25,'Citrix',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 25); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 26,'Exchange Services',20 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 26); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 27,'MS SQL Server',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 27); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 28,'Oracle',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 28); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 29,'Antivirus',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 29); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 30,'Norton',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 30); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 31,'Panda',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 31); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 32,'McAfee',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 32); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 33,'Bitdefender',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 33); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 34,'Windows DNS',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 34); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 35,'DNS Counters',34 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 35); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 36,'AD Counters',18 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 36); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 37,'BullGuard',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 37); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 38,'IIS services',19 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 38); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 39,'Exchange TCP Ports',20 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 39); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 40,'AVG',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 40); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 41,'Kaspersky',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 41); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 42,'MySQL',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 42); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 43,'Linux',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 43); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 44,'HP-UX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 44); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 45,'Solaris',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 45); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 46,'AIX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 46); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 47,'BSD',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 47); +INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 48,'MacOS',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 48); diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 7014ac17f1..5234aac014 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -1039,38 +1039,37 @@ INSERT INTO "tnetwork_component" ("name", "description", "id_group", "type", "ma -- --------------------------------------------------------------------- -- Adding news network_component_groups -- --------------------------------------------------------------------- - -INSERT INTO "tnetwork_component_group" VALUES (15,'Databases',0); -INSERT INTO "tnetwork_component_group" VALUES (16,'Windows System',14); -INSERT INTO "tnetwork_component_group" VALUES (17,'Windows Hardware Layer',14); -INSERT INTO "tnetwork_component_group" VALUES (18,'Windows AD ',14); -INSERT INTO "tnetwork_component_group" VALUES (19,'Windows IIS ',14); -INSERT INTO "tnetwork_component_group" VALUES (20,'Windows Exchange',14); -INSERT INTO "tnetwork_component_group" VALUES (21,'Windows LDAP ',14); -INSERT INTO "tnetwork_component_group" VALUES (22,'Windows MSDTC ',14); -INSERT INTO "tnetwork_component_group" VALUES (23,'Catalyst 2900 ',2); -INSERT INTO "tnetwork_component_group" VALUES (24,'Windows Printers',14); -INSERT INTO "tnetwork_component_group" VALUES (25,'Citrix',0); -INSERT INTO "tnetwork_component_group" VALUES (26,'Exchange Services',20); -INSERT INTO "tnetwork_component_group" VALUES (27,'MS SQL Server',15); -INSERT INTO "tnetwork_component_group" VALUES (28,'Oracle',15); -INSERT INTO "tnetwork_component_group" VALUES (29,'Antivirus',0); -INSERT INTO "tnetwork_component_group" VALUES (30,'Norton',29); -INSERT INTO "tnetwork_component_group" VALUES (31,'Panda',29); -INSERT INTO "tnetwork_component_group" VALUES (32,'McAfee',29); -INSERT INTO "tnetwork_component_group" VALUES (33,'Bitdefender',29); -INSERT INTO "tnetwork_component_group" VALUES (34,'Windows DNS',14); -INSERT INTO "tnetwork_component_group" VALUES (35,'DNS Counters',34); -INSERT INTO "tnetwork_component_group" VALUES (36,'AD Counters',18); -INSERT INTO "tnetwork_component_group" VALUES (37,'BullGuard',29); -INSERT INTO "tnetwork_component_group" VALUES (38,'IIS services',19); -INSERT INTO "tnetwork_component_group" VALUES (39,'Exchange TCP Ports',20); -INSERT INTO "tnetwork_component_group" VALUES (40,'AVG',29); -INSERT INTO "tnetwork_component_group" VALUES (41,'Kaspersky',29); -INSERT INTO "tnetwork_component_group" VALUES (42,'MySQL',15); -INSERT INTO "tnetwork_component_group" VALUES (43,'Linux',5); -INSERT INTO "tnetwork_component_group" VALUES (44,'HP-UX',5); -INSERT INTO "tnetwork_component_group" VALUES (45,'Solaris',5); -INSERT INTO "tnetwork_component_group" VALUES (46,'AIX',5); -INSERT INTO "tnetwork_component_group" VALUES (47,'BSD',5); -INSERT INTO "tnetwork_component_group" VALUES (48,'MacOS',0); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 15,'Databases',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 15); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 16,'Windows System',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 16); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 17,'Windows Hardware Layer',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 17); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 18,'Windows AD ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 18); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 19,'Windows IIS ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 19); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 20,'Windows Exchange',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 20); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 21,'Windows LDAP ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 21); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 22,'Windows MSDTC ',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 22); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 23,'Catalyst 2900 ',2 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 23); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 24,'Windows Printers',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 24); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 25,'Citrix',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 25); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 26,'Exchange Services',20 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 26); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 27,'MS SQL Server',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 27); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 28,'Oracle',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 28); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 29,'Antivirus',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 29); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 30,'Norton',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 30); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 31,'Panda',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 31); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 32,'McAfee',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 32); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 33,'Bitdefender',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 33); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 34,'Windows DNS',14 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 34); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 35,'DNS Counters',34 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 35); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 36,'AD Counters',18 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 36); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 37,'BullGuard',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 37); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 38,'IIS services',19 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 38); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 39,'Exchange TCP Ports',20 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 39); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 40,'AVG',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 40); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 41,'Kaspersky',29 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 41); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 42,'MySQL',15 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 42); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 43,'Linux',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 43); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 44,'HP-UX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 44); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 45,'Solaris',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 45); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 46,'AIX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 46); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 47,'BSD',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 47); +INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 48,'MacOS',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 48);