From 87f3dc06a406e007cbe5fcb2c2c6a7301f6a96e4 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 25 Feb 2008 18:08:52 +0000 Subject: [PATCH] 2008-02-25 Sancho Lerena * pandoradb_data.sql, pandoradb.sql: Modified, added and altered SQL structure. This is a final aproximation to 1.4 version. Probably more changes are coming in the next future before to close 1.4 database definition. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@726 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++ pandora_console/pandoradb.sql | 71 +++++++++++++++++++++--------- pandora_console/pandoradb_data.sql | 37 ++++++++++++---- 3 files changed, 85 insertions(+), 30 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 42ce4ea06d..26d7785e04 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2008-02-25 Sancho Lerena + + * pandoradb_data.sql, pandoradb.sql: Modified, added and altered + SQL structure. This is a final aproximation to 1.4 version. Probably + more changes are coming in the next future before to close 1.4 database + definition. + 2008-02-21 Sancho Lerena * Added new structures for predictive module, plugin server, and other diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 88797498a8..8c258400f0 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -49,6 +49,13 @@ CREATE TABLE `tagente` ( PRIMARY KEY (`id_agente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/* Data source field explanation (Pandora FMS 1.4.x) + +1 - Classic module data from tagente_modulo +2 - New data coming from plugin modules +3 - New data coming from predictive engine +. +*/ CREATE TABLE `tagente_datos` ( `id_agente_datos` bigint(10) unsigned NOT NULL auto_increment, @@ -57,20 +64,24 @@ CREATE TABLE `tagente_datos` ( `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `id_agente` mediumint(8) unsigned NOT NULL default '0', `utimestamp` int(10) unsigned default '0', + `data_source` tinyint(3) unsigned default `1`, PRIMARY KEY (`id_agente_datos`), - KEY `data_index2` (`id_agente`,`id_agente_modulo`) + KEY `data_index2` (`id_agente`,`id_agente_modulo`), + KEY `data_index3` (`data_source`,`id_agente_modulo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tagent_data_image` ( `id` bigint(20) unsigned NOT NULL auto_increment, - `id_agente_modulo` mediumint(8) unsigned NOT NULL default '0', + `id_agent_module` mediumint(8) unsigned NOT NULL default '0', + `id_agent` mediumint(8) unsigned NOT NULL default '0', `blob` mediumblob NOT NULL, `filename` varchar(255) default '', `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `id_agente` mediumint(8) unsigned NOT NULL default '0', `utimestamp` int(10) unsigned default '0', + `data_source` tinyint(3) unsigned default `1`, PRIMARY KEY (`id`), - KEY `img_idx2` (`id_agente`,`id_agente_modulo`) + KEY `img_idx1` (`id_agent`,`id_agent_module`), + KEY `img_idx2` (`data_source`,`id_agent_module`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tagente_datos_inc` ( @@ -79,8 +90,10 @@ CREATE TABLE `tagente_datos_inc` ( `datos` double(18,2) default NULL, `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `utimestamp` int(10) unsigned default '0', + `data_source` tinyint(3) unsigned default `1`, PRIMARY KEY (`id_adi`), - KEY `data_inc_index_1` (`id_agente_modulo`) + KEY `data_inc_index_1` (`id_agente_modulo`), + KEY `data_inc_index3` (`data_source`,`id_agente_modulo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -91,9 +104,10 @@ CREATE TABLE `tagente_datos_string` ( `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `id_agente` bigint(4) unsigned NOT NULL default '0', `utimestamp` int(10) unsigned NOT NULL default 0, + `data_source` tinyint(3) unsigned default `1`, PRIMARY KEY (`id_tagente_datos_string`), - KEY `data_string_index_1` (`id_agente_modulo`), - KEY `data_string_index_2` (`id_agente`) + KEY `data_string_index_1` (`id_agente`,`id_agente_modulo`), + KEY `data_string_index_3` (`data_source`,`id_agente_modulo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -110,10 +124,11 @@ CREATE TABLE `tagente_estado` ( `current_interval` int(10) unsigned NOT NULL default '0', `running_by` int(10) unsigned NULL default 0, `last_execution_try` bigint(20) NOT NULL default '0', - `id_agent_plugin` int(20) NOT NULL default '0', + `data_source` tinyint(3) unsigned default `1`, PRIMARY KEY (`id_agente_estado`), KEY `status_index_1` (`id_agente_modulo`), - KEY `status_index_2` (`id_agente_modulo`,`estado`) + KEY `status_index_2` (`id_agente_modulo`,`estado`), + KEY `status_index_3` (`id_agente_modulo`,`data_source`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -137,7 +152,6 @@ CREATE TABLE `tagente_modulo` ( `id_modulo` int(11) unsigned NULL default 0, `disabled` tinyint(3) unsigned default '0', `export` tinyint(3) unsigned default '0', - `predictive_id_module_source` bigint(100) unsigned default 0, PRIMARY KEY (`id_agente_modulo`, `id_agente`), KEY `tam_agente` (`id_agente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -220,15 +234,16 @@ CREATE TABLE `tnotification_component` ( `id` int(11) unsigned NOT NULL auto_increment, `id_notification` int(11) NOT NULL default '0', `id_agente_modulo` int(11) NOT NULL default '0', + `data_source` tinyint(3) unsigned default `1`, `dis_max` double(18,2) default NULL, `dis_min` double(18,2) default NULL, `alert_text` varchar(255) default '', `time_threshold` int(11) NOT NULL default '0', `last_fired` datetime NOT NULL default '0000-00-00 00:00:00', `max_alerts` int(4) NOT NULL default '1', + `min_alerts` int(4) NOT NULL default '0', `times_fired` int(11) NOT NULL default '0', `module_type` int(11) NOT NULL default '0', - `min_alerts` int(4) NOT NULL default '0', `internal_counter` int(4) default '0', `disabled` int(4) default '0', `time_from` TIME default '00:00:00', @@ -276,7 +291,7 @@ CREATE TABLE `tevento` ( `utimestamp` bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (`id_evento`), KEY `indice_1` (`id_agente`,`id_evento`), - KEY `indice_2` (`timestamp`,`id_evento`) + KEY `indice_2` (`utimestamp`,`id_evento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -625,18 +640,23 @@ CREATE TABLE `tlayout_data` ( ) ENGINE = InnoDB DEFAULT CHARSET=utf8; CREATE TABLE tplugin ( - `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(200) NOT NULL, - `description` mediumtext default "", - `max_timeout` int(4) UNSIGNED NOT NULL default 0, - `execute`varchar(250) NOT NULL, - PRIMARY KEY('id') + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(200) NOT NULL, + `description` mediumtext default "", + `max_timeout` int(4) UNSIGNED NOT NULL default 0, + `execute`varchar(250) NOT NULL, + `net_dst_opt` varchar(50) default '', + `net_port_opt` varchar(50) default '', + `user_opt` varchar(50) default '', + `pass_opt` varchar(50) default '', + PRIMARY KEY('id') ) ENGINE = InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tagent_plugin` ( `id` int(10) unsigned NOT NULL auto_increment, `id_agent` int(11) NOT NULL default '0', `id_plugin` int(11) NOT NULL default '0', + `id_module_type` int(11) NOT NULL default '0', `net_dst` varchar(250) default '', `net_port` varchar(250) default '', `access_user` varchar(250) default '', @@ -646,12 +666,21 @@ CREATE TABLE `tagent_plugin` ( `field3` varchar(250) default '', `field4` varchar(250) default '', `field5` varchar(250) default '' - `id_module_group` int(4) unsigned default '0', `flag` tinyint(3) unsigned default '1', `disabled` tinyint(3) unsigned default '0', `export` tinyint(3) unsigned default '0', - PRIMARY KEY (`id_agente_modulo`, `id_agente`), - KEY `tam_agente` (`id_agente`) + PRIMARY KEY (`id`), + KEY `ag_plugin_idx1` (`id_agent`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `tagent_predictive` ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_agent` int(11) NOT NULL default '0', + `id_module_group` int(4) unsigned default '0', + `flag` tinyint(3) unsigned default '1', + `disabled` tinyint(3) unsigned default '0', + `export` tinyint(3) unsigned default '0', + PRIMARY KEY (`id`), + KEY `ag_pred_idx1` (`id_agent`,`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 9e6ebbf08e..5c51ff2496 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -60,12 +60,11 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `tlanguage` DISABLE KEYS */; LOCK TABLES `tlanguage` WRITE; --- INSERT INTO `tlanguage` VALUES ('bb','Bable'),('ca','Català'),('de','Deutch'),('en','English'),('es_es','Español'),('es_gl','Gallego'),('es_la','Español-Latinoamérica'),('eu','Euskera'),('fr','Français'),('pt_br','Portuguese-Brazil'); INSERT INTO `tlanguage` VALUES ('en','English'); -INSERT INTO `tlanguage` VALUES ('es_es','Español'); +/*INSERT INTO `tlanguage` VALUES ('es_es','Español'); INSERT INTO `tlanguage` VALUES ('de','Deutch'); INSERT INTO `tlanguage` VALUES ('fr','Français'); -INSERT INTO `tlanguage` VALUES ('pt_br','Português-Brasil'); +INSERT INTO `tlanguage` VALUES ('pt_br','Português-Brasil'); */ UNLOCK TABLES; /*!40000 ALTER TABLE `tlanguage` ENABLE KEYS */; @@ -77,7 +76,7 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `tlink` DISABLE KEYS */; LOCK TABLES `tlink` WRITE; -INSERT INTO `tlink` VALUES (0000000001,'GeekTools','www.geektools.com'),(0000000002,'CentralOPS','http://www.centralops.net/'),(0000000003,'Pandora Project','http://pandora.sourceforge.net'),(0000000004,'Babel Project','http://babel.sourceforge.net'),(0000000005,'Google','http://www.google.com'); +INSERT INTO `tlink` VALUES (0000000001,'GeekTools','www.geektools.com'),(0000000002,'CentralOPS','http://www.centralops.net/'),(0000000003,'Pandora Project','http://pandora.sourceforge.net'),(0000000004,'Babel Project','http://babel.sourceforge.net'),(0000000005,'Google','http://www.google.com'),(0000000006,'ArticaST','http://www.artica.es'); UNLOCK TABLES; /*!40000 ALTER TABLE `tlink` ENABLE KEYS */; @@ -150,7 +149,6 @@ INSERT INTO `tnetwork_component_group` VALUES (10,'Network Management',0); INSERT INTO `tnetwork_component_group` VALUES (11,'Microsoft Windows MIB',12); INSERT INTO `tnetwork_component_group` VALUES (12,'Operating Systems',0); - -- -- Dumping data for table `torigen` -- @@ -162,19 +160,40 @@ INSERT INTO `torigen` VALUES ('Operating System event'),('IDS events'),('Firewal -- Dumping data for table `ttipo_modulo` -- -INSERT INTO `ttipo_modulo` VALUES (1,'generic_data',0,'Generic module to adquire numeric data','mod_data.png'),(2,'generic_proc',1,'Generic module to adquire boolean data','mod_proc.png'),(3,'generic_data_string',0,'Generic module to adquire alphanumeric data','mod_string.png'),(4,'generic_data_inc',0,'Generic module to adquire numeric incremental data','mod_data_inc.png'),(6,'remote_icmp_proc',3,'Remote ICMP network agent, boolean data','mod_icmp_proc.png'),(7,'remote_icmp',2,'Remote ICMP network agent (latency)','mod_icmp_data.png'),(8,'remote_tcp',2,'Remote TCP network agent, numeric data','mod_tcp_data.png'),(9,'remote_tcp_proc',3,'Remote TCP network agent, boolean data','mod_tcp_proc.png'),(10,'remote_tcp_string',2,'Remote TCP network agent, alphanumeric data','mod_tcp_string.png'),(11,'remote_tcp_inc',2,'Remote TCP network agent, incremental data','mod_tcp_inc.png'),(15,'remote_snmp',2,'Remote SNMP network agent, numeric data','mod_snmp_data.png'),(16,'remote_snmp_inc',2,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'),(17,'remote_snmp_string',2,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'),(18,'remote_snmp_proc',1,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'), (100,'keep_alive',-1,'KeepAlive','mod_keepalive.png'), (19, 'image_jpg',4,'Image JPG data', 'mod_image_jpg.png'), (20, 'image_png',4,'Image PNG data', 'mod_image_png.png'), (21, 'async_proc', 5, 'Asyncronous proc data', 'mod_async_proc.png'), (22, 'async_data', 5, 'Asyncronous numeric data', 'mod_async_data.png'), (23, 'async_string', 5, 'Asyncronous string data', 'mod_async_string.png'), (24, 'predictive', 5, 'Predictive Estimation Data', 'mod_predictive.png'); +INSERT INTO `ttipo_modulo` VALUES +(1,'generic_data',0,'Generic module to adquire numeric data','mod_data.png'), +(2,'generic_proc',1,'Generic module to adquire boolean data','mod_proc.png'), +(3,'generic_data_string',0,'Generic module to adquire alphanumeric data','mod_string.png'), +(4,'generic_data_inc',0,'Generic module to adquire numeric incremental data','mod_data_inc.png'), +(6,'remote_icmp_proc',3,'Remote ICMP network agent, boolean data','mod_icmp_proc.png'), +(7,'remote_icmp',2,'Remote ICMP network agent (latency)','mod_icmp_data.png'), +(8,'remote_tcp',2,'Remote TCP network agent, numeric data','mod_tcp_data.png'), +(9,'remote_tcp_proc',3,'Remote TCP network agent, boolean data','mod_tcp_proc.png'), +(10,'remote_tcp_string',2,'Remote TCP network agent, alphanumeric data','mod_tcp_string.png'), +(11,'remote_tcp_inc',2,'Remote TCP network agent, incremental data','mod_tcp_inc.png'), +(15,'remote_snmp',2,'Remote SNMP network agent, numeric data','mod_snmp_data.png'), +(16,'remote_snmp_inc',2,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'), +(17,'remote_snmp_string',2,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'), +(18,'remote_snmp_proc',3,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'), +(19,'image_jpg',9,'Image JPG data', 'mod_image_jpg.png'), +(20,'image_png',9,'Image PNG data', 'mod_image_png.png'), +(21,'async_proc', 5, 'Asyncronous proc data', 'mod_async_proc.png'), +(22,'async_data', 4, 'Asyncronous numeric data', 'mod_async_data.png'), +(23,'async_string', 4, 'Asyncronous string data', 'mod_async_string.png'), +(24,'predictive', 6, 'Predictive Estimation Data', 'mod_predictive.png'), +(100,'keep_alive',-1,'KeepAlive','mod_keepalive.png'); -- -- Dumping data for table `tusuario` -- -INSERT INTO `tusuario` VALUES ('admin','Default Admin','1da7ee7d45b96d0e1f45ee4ee23da560','Admin Pandora','2007-03-27 18:59:39','admin_pandora@nowhere.net','555-555-555',1),('demo','Demo user','fe01ce2a7fbac8fafaed7c982a04e229','Please don\\'t change anything in this user, so other users can connect with it.\r\n\r\nThanks.','2007-03-20 13:00:05','demo@nowhere.net','+4555435435',0); +INSERT INTO `tusuario` VALUES ('admin','Default Admin','1da7ee7d45b96d0e1f45ee4ee23da560','Admin Pandora','2007-03-27 18:59:39','admin_pandora@nowhere.net','555-555-555',1); -- -- Dumping data for table `tusuario_perfil` -- -INSERT INTO `tusuario_perfil` VALUES (1,'demo',1,1,'admin'),(2,'admin',5,1,'admin'); +INSERT INTO `tusuario_perfil` VALUES (1,'admin',5,1,'admin'); -- -- Dumping data for table `tperfil` @@ -182,7 +201,7 @@ INSERT INTO `tusuario_perfil` VALUES (1,'demo',1,1,'admin'),(2,'admin',5,1,'admi INSERT INTO `tperfil` VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0),(4,'Group coordinator',1,1,1,1,1,1,1,0,0,0),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1); -INSERT INTO `tnews` VALUES (1,'admin','Welcome to Pandora FMS 1.3 !','This is our new console, a lot of new features has been added from last version. Please read documentation about it and be free to test any option.\r\n\r\nPandora FMS team.','2007-06-22 13:03:20'); +INSERT INTO `tnews` VALUES (1,'admin','Welcome to Pandora FMS!','This is our new console, a lot of new features has been added from last version. Please read documentation about it and be free to test any option.\r\n\r\nPandora FMS team.','2007-06-22 13:03:20'); INSERT INTO `tnetwork_profile` VALUES (1,'SNMP Basic management','Basic SNMP management (only first interface)'); INSERT INTO `tnetwork_profile` VALUES (2,'Basic Server','Check basic server services and network latency. This checks SSH, FTP and HTTP. Also a ICMP host alive check.');