Solved issues with DB
This commit is contained in:
parent
35644a367f
commit
3c0ea8b08a
|
@ -1,11 +1,5 @@
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
||||||
ALTER TABLE `talert_templates` ADD COLUMN `previous_name` text;
|
|
||||||
ALTER TABLE `talert_actions` ADD COLUMN `previous_name` text;
|
|
||||||
ALTER TABLE `talert_commands` ADD COLUMN `previous_name` text;
|
|
||||||
ALTER TABLE `ttag` ADD COLUMN `previous_name` text default '';
|
|
||||||
ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text default '';
|
|
||||||
|
|
||||||
UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event';
|
UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event';
|
||||||
|
|
||||||
ALTER TABLE `tservice_element` ADD COLUMN `rules` text;
|
ALTER TABLE `tservice_element` ADD COLUMN `rules` text;
|
||||||
|
@ -13,6 +7,7 @@ ALTER TABLE `tservice` ADD COLUMN `unknown_as_critical` tinyint(1) NOT NULL defa
|
||||||
ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT '';
|
ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT '';
|
||||||
|
|
||||||
UPDATE `tservice` SET `auto_calculate`=0;
|
UPDATE `tservice` SET `auto_calculate`=0;
|
||||||
|
|
||||||
UPDATE `tservice` SET `cps`= `cps` - 1 WHERE `cps` > 0;
|
UPDATE `tservice` SET `cps`= `cps` - 1 WHERE `cps` > 0;
|
||||||
UPDATE `tagente` SET `cps`= `cps` - 1 WHERE `cps` > 0;
|
UPDATE `tagente` SET `cps`= `cps` - 1 WHERE `cps` > 0;
|
||||||
UPDATE `tagente_modulo` SET `cps`= `cps` - 1 WHERE `cps` > 0;
|
UPDATE `tagente_modulo` SET `cps`= `cps` - 1 WHERE `cps` > 0;
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
ALTER TABLE `talert_templates` ADD COLUMN `previous_name` text;
|
ALTER TABLE `talert_templates` ADD COLUMN `previous_name` text;
|
||||||
ALTER TABLE `talert_actions` ADD COLUMN `previous_name` text;
|
ALTER TABLE `talert_actions` ADD COLUMN `previous_name` text;
|
||||||
ALTER TABLE `talert_commands` ADD COLUMN `previous_name` text;
|
ALTER TABLE `talert_commands` ADD COLUMN `previous_name` text;
|
||||||
ALTER TABLE `ttag` ADD COLUMN `previous_name` text default '';
|
ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL;
|
||||||
ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text default '';
|
ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text NULL;
|
||||||
|
|
||||||
|
COMMIT;
|
|
@ -1343,7 +1343,7 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `ttag`
|
-- Table `ttag`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE `ttag` ADD COLUMN `previous_name` text default '';
|
ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL;
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tconfig`
|
-- Table `tconfig`
|
||||||
|
@ -1389,9 +1389,9 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_content', '');
|
||||||
-- Table `tconfig_os`
|
-- Table `tconfig_os`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
|
|
||||||
ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text default '';
|
ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text NULL;
|
||||||
|
|
||||||
INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png');
|
INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png', '');
|
||||||
|
|
||||||
UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster');
|
UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster');
|
||||||
|
|
||||||
|
|
|
@ -374,7 +374,6 @@ CREATE TABLE IF NOT EXISTS `talert_snmp` (
|
||||||
CREATE TABLE IF NOT EXISTS `talert_commands` (
|
CREATE TABLE IF NOT EXISTS `talert_commands` (
|
||||||
`id` int(10) unsigned NOT NULL auto_increment,
|
`id` int(10) unsigned NOT NULL auto_increment,
|
||||||
`name` varchar(100) NOT NULL default '',
|
`name` varchar(100) NOT NULL default '',
|
||||||
`previous_name` text,
|
|
||||||
`command` text,
|
`command` text,
|
||||||
`id_group` mediumint(8) unsigned NULL default 0,
|
`id_group` mediumint(8) unsigned NULL default 0,
|
||||||
`description` text,
|
`description` text,
|
||||||
|
@ -382,6 +381,7 @@ CREATE TABLE IF NOT EXISTS `talert_commands` (
|
||||||
`fields_descriptions` TEXT,
|
`fields_descriptions` TEXT,
|
||||||
`fields_values` TEXT,
|
`fields_values` TEXT,
|
||||||
`fields_hidden` TEXT,
|
`fields_hidden` TEXT,
|
||||||
|
`previous_name` text,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
@ -391,7 +391,6 @@ CREATE TABLE IF NOT EXISTS `talert_commands` (
|
||||||
CREATE TABLE IF NOT EXISTS `talert_actions` (
|
CREATE TABLE IF NOT EXISTS `talert_actions` (
|
||||||
`id` int(10) unsigned NOT NULL auto_increment,
|
`id` int(10) unsigned NOT NULL auto_increment,
|
||||||
`name` text,
|
`name` text,
|
||||||
`previous_name` text,
|
|
||||||
`id_alert_command` int(10) unsigned NULL default 0,
|
`id_alert_command` int(10) unsigned NULL default 0,
|
||||||
`field1` text NOT NULL,
|
`field1` text NOT NULL,
|
||||||
`field2` text NOT NULL,
|
`field2` text NOT NULL,
|
||||||
|
@ -425,6 +424,7 @@ CREATE TABLE IF NOT EXISTS `talert_actions` (
|
||||||
`field13_recovery` text NOT NULL,
|
`field13_recovery` text NOT NULL,
|
||||||
`field14_recovery` text NOT NULL,
|
`field14_recovery` text NOT NULL,
|
||||||
`field15_recovery` text NOT NULL,
|
`field15_recovery` text NOT NULL,
|
||||||
|
`previous_name` text,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
FOREIGN KEY (`id_alert_command`) REFERENCES talert_commands(`id`)
|
FOREIGN KEY (`id_alert_command`) REFERENCES talert_commands(`id`)
|
||||||
ON DELETE CASCADE ON UPDATE CASCADE
|
ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
@ -436,7 +436,6 @@ CREATE TABLE IF NOT EXISTS `talert_actions` (
|
||||||
CREATE TABLE IF NOT EXISTS `talert_templates` (
|
CREATE TABLE IF NOT EXISTS `talert_templates` (
|
||||||
`id` int(10) unsigned NOT NULL auto_increment,
|
`id` int(10) unsigned NOT NULL auto_increment,
|
||||||
`name` text,
|
`name` text,
|
||||||
`previous_name` text,
|
|
||||||
`description` mediumtext,
|
`description` mediumtext,
|
||||||
`id_alert_action` int(10) unsigned NULL,
|
`id_alert_action` int(10) unsigned NULL,
|
||||||
`field1` text NOT NULL,
|
`field1` text NOT NULL,
|
||||||
|
@ -493,6 +492,7 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
|
||||||
`wizard_level` enum('basic','advanced','nowizard') default 'nowizard',
|
`wizard_level` enum('basic','advanced','nowizard') default 'nowizard',
|
||||||
`min_alerts_reset_counter` tinyint(1) default 0,
|
`min_alerts_reset_counter` tinyint(1) default 0,
|
||||||
`disable_event` tinyint(1) default 0,
|
`disable_event` tinyint(1) default 0,
|
||||||
|
`previous_name` text,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `idx_template_action` (`id_alert_action`),
|
KEY `idx_template_action` (`id_alert_action`),
|
||||||
FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`)
|
FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`)
|
||||||
|
@ -586,6 +586,7 @@ CREATE TABLE IF NOT EXISTS `tconfig_os` (
|
||||||
`name` varchar(100) NOT NULL default '',
|
`name` varchar(100) NOT NULL default '',
|
||||||
`description` varchar(250) default '',
|
`description` varchar(250) default '',
|
||||||
`icon_name` varchar(100) default '',
|
`icon_name` varchar(100) default '',
|
||||||
|
`previous_name` text NULL,
|
||||||
PRIMARY KEY (`id_os`)
|
PRIMARY KEY (`id_os`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|
|
@ -150,27 +150,27 @@ UNLOCK TABLES;
|
||||||
--
|
--
|
||||||
|
|
||||||
LOCK TABLES `tconfig_os` WRITE;
|
LOCK TABLES `tconfig_os` WRITE;
|
||||||
INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES
|
INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`, `previous_name`) VALUES
|
||||||
(1,'Linux','Linux: All versions','so_linux.png'),
|
(1,'Linux','Linux: All versions','so_linux.png', ''),
|
||||||
(2,'Solaris','Sun Solaris','so_solaris.png'),
|
(2,'Solaris','Sun Solaris','so_solaris.png', ''),
|
||||||
(3,'AIX','IBM AIX','so_aix.png'),
|
(3,'AIX','IBM AIX','so_aix.png', ''),
|
||||||
(4,'BSD','OpenBSD, FreeBSD and Others','so_bsd.png'),
|
(4,'BSD','OpenBSD, FreeBSD and Others','so_bsd.png', ''),
|
||||||
(5,'HP-UX','HP-UX Unix OS','so_hpux.png'),
|
(5,'HP-UX','HP-UX Unix OS','so_hpux.png', ''),
|
||||||
(7,'Cisco','CISCO IOS','so_cisco.png'),
|
(7,'Cisco','CISCO IOS','so_cisco.png', ''),
|
||||||
(8,'MacOS','MAC OS','so_mac.png'),
|
(8,'MacOS','MAC OS','so_mac.png', ''),
|
||||||
(9,'Windows','Microsoft Windows OS','so_win.png'),
|
(9,'Windows','Microsoft Windows OS','so_win.png', ''),
|
||||||
(10,'Other','Other SO','so_other.png'),
|
(10,'Other','Other SO','so_other.png', ''),
|
||||||
(11,'Network','Network Agent','network.png'),
|
(11,'Network','Network Agent','network.png', ''),
|
||||||
(12,'Web Server','Web Server/Application','network.png'),
|
(12,'Web Server','Web Server/Application','network.png', ''),
|
||||||
(13,'Sensor','Hardware Agent (Sensor)','network.png'),
|
(13,'Sensor','Hardware Agent (Sensor)','network.png', ''),
|
||||||
(14,'Embedded','Embedded device running an agent','embedded.png'),
|
(14,'Embedded','Embedded device running an agent','embedded.png', ''),
|
||||||
(15,'Android','Android agent','android.png'),
|
(15,'Android','Android agent','android.png', ''),
|
||||||
(16, 'VMware', 'VMware Architecture', 'so_vmware.png'),
|
(16, 'VMware', 'VMware Architecture', 'so_vmware.png', ''),
|
||||||
(17, 'Router', 'Generic router', 'so_router.png'),
|
(17, 'Router', 'Generic router', 'so_router.png', ''),
|
||||||
(18, 'Switch', 'Generic switch', 'so_switch.png'),
|
(18, 'Switch', 'Generic switch', 'so_switch.png', ''),
|
||||||
(19, 'Satellite', 'Satellite agent', 'satellite.png'),
|
(19, 'Satellite', 'Satellite agent', 'satellite.png', ''),
|
||||||
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png'),
|
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png', ''),
|
||||||
(100, 'Cluster', 'Cluster agent', 'so_cluster.png');
|
(100, 'Cluster', 'Cluster agent', 'so_cluster.png', '');
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue