Fixed a lot of things, like the catastrophic problem with the sequences and the insertion triggers
This commit is contained in:
parent
55d1b04f74
commit
b00c424af4
|
@ -22,11 +22,14 @@
|
|||
|
||||
-- PL/SQL blocks must end with two semicolons because Pandora installer need it
|
||||
|
||||
|
||||
--
|
||||
-- Dumping data for table talert_commands
|
||||
--
|
||||
BEGIN
|
||||
LOCK TABLE talert_commands IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER talert_commands_inc DISABLE';
|
||||
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (1,'eMail','Internal type','This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:
_field1_ as destination email address, and
_field2_ as subject for message. 
_field3_ as text of message.',1,'[\Destination address\",\Subject\",\Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora internal audit system. Fields are static and only _field1_ is used.',1,'[\Description\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\Event text\",\Event type\",\Source\",\Agent name or _agent_\",\Event criticity\",\ID extra\",\Tags separated by commas\",\Comments\",\"\",\"\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
|
@ -38,6 +41,12 @@ INSERT INTO talert_commands (id, name, command, description, internal, fields_de
|
|||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools.  Uses field2 as text message, field1 as destination phone (include international prefix!)',0,'[\Destination number\",\Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)',1,'[\Agent name\",\Module name\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\Integria IMS API path\",\Integria IMS API pass\",\Integria IMS user\",\Ticket title\",\Ticket group ID\",\Ticket priority\",\Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]');
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (12,'Remote agent control','/usr/share/pandora_server/util/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data',0,'[\Command\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('talert_commands', 'id');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER talert_commands_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
@ -132,6 +141,9 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tconfig_os IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tconfig_os_inc DISABLE';
|
||||
|
||||
INSERT INTO tconfig_os VALUES (1,'Linux','Linux: All versions','so_linux.png');
|
||||
INSERT INTO tconfig_os VALUES (2,'Solaris','Sun Solaris','so_solaris.png');
|
||||
INSERT INTO tconfig_os VALUES (3,'AIX','IBM AIX','so_aix.png');
|
||||
|
@ -151,30 +163,23 @@ INSERT INTO tconfig_os VALUES (17, 'Router', 'Generic router', 'so_router.png');
|
|||
INSERT INTO tconfig_os VALUES (18, 'Switch', 'Generic switch', 'so_switch.png');
|
||||
INSERT INTO tconfig_os VALUES (19, 'Satellite', 'Satellite agent', 'satellite.png');
|
||||
INSERT INTO tconfig_os VALUES (20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tconfig_os', 'id_os');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tconfig_os_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
CREATE SEQUENCE tconfig_os_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tconfig_os_inc BEFORE INSERT ON tconfig_os REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tconfig_os_s.nextval INTO :NEW.id_os FROM dual; END;;
|
||||
|
||||
-- PLSQL for update curr val of sequence
|
||||
BEGIN
|
||||
DECLARE key_max NUMBER := 0;
|
||||
key_currval NUMBER := 0;
|
||||
BEGIN
|
||||
SELECT MAX(id_os) INTO key_max FROM tconfig_os;
|
||||
EXECUTE IMMEDIATE 'ALTER SEQUENCE TCONFIG_OS_S INCREMENT BY ' || key_max;
|
||||
SELECT TCONFIG_OS_S.NEXTVAL INTO key_currval FROM dual;
|
||||
EXECUTE IMMEDIATE 'ALTER SEQUENCE TCONFIG_OS_S INCREMENT BY 1';
|
||||
END;
|
||||
END;;
|
||||
|
||||
--
|
||||
-- Dumping data for table tgrupo
|
||||
--
|
||||
BEGIN
|
||||
LOCK TABLE tgrupo IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgrupo_inc DISABLE';
|
||||
|
||||
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (2,'Servers','server_database',0,0,0,'',1,'');
|
||||
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (4,'Firewalls','firewall',0,0,0,'',1,'');
|
||||
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (8,'Databases','database_gear',0,0,0,'',1,'');
|
||||
|
@ -183,6 +188,12 @@ INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_
|
|||
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (11,'Workstations','computer',0,0,0,'',1,'');
|
||||
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (12,'Applications','applications',0,0,0,'',1,'');
|
||||
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (13,'Web','world',0,0,0,'',1,'');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tgrupo', 'id_grupo');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgrupo_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -217,11 +228,20 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tlink IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tlink_inc DISABLE';
|
||||
|
||||
INSERT INTO tlink VALUES (1,'Pandora FMS Manual','http://wiki.pandorafms.com/?title=Pandora');
|
||||
INSERT INTO tlink VALUES (2,'Pandora FMS','http://pandorafms.com');
|
||||
INSERT INTO tlink VALUES (3,'Report a bug','{https://sourceforge.net/tracker/?func=add&group_id=155200&atid=794852}');
|
||||
INSERT INTO tlink VALUES (4,'Suggest new feature','http://sourceforge.net/tracker/?group_id=155200&atid=794855');
|
||||
INSERT INTO tlink VALUES (5,'Module library','http://pandorafms.com/pandora/repository/en');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tlink', 'id_link');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tlink_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -230,6 +250,9 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tmodule_group IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tmodule_group_inc DISABLE';
|
||||
|
||||
INSERT INTO tmodule_group VALUES (1,'General');
|
||||
INSERT INTO tmodule_group VALUES (2,'Networking');
|
||||
INSERT INTO tmodule_group VALUES (3,'Application');
|
||||
|
@ -239,6 +262,12 @@ INSERT INTO tmodule_group VALUES (6,'Performance');
|
|||
INSERT INTO tmodule_group VALUES (7,'Database');
|
||||
INSERT INTO tmodule_group VALUES (8,'Enviromental');
|
||||
INSERT INTO tmodule_group VALUES (9,'Users');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tmodule_group', 'id_mg');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tmodule_group_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -265,6 +294,9 @@ END;;
|
|||
-- Identifiers 30 and 31 are reserved for Enterprise data types
|
||||
BEGIN
|
||||
LOCK TABLE ttipo_modulo IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER ttipo_modulo_inc DISABLE';
|
||||
|
||||
INSERT INTO ttipo_modulo VALUES (1,'generic_data',0,'Generic data','mod_data.png');
|
||||
INSERT INTO ttipo_modulo VALUES (2,'generic_proc',1,'Generic boolean','mod_proc.png');
|
||||
INSERT INTO ttipo_modulo VALUES (3,'generic_data_string',2,'Generic string','mod_string.png');
|
||||
|
@ -285,7 +317,14 @@ INSERT INTO ttipo_modulo VALUES (22,'async_data', 6, 'Asyncronous numeric data',
|
|||
INSERT INTO ttipo_modulo VALUES (23,'async_string', 8, 'Asyncronous string data', 'mod_async_string.png');
|
||||
INSERT INTO ttipo_modulo VALUES (24,'log4x',0,'Log4x','mod_log4x.png');
|
||||
INSERT INTO ttipo_modulo VALUES (100,'keep_alive',-1,'KeepAlive','mod_keepalive.png');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('ttipo_modulo', 'id_tipo');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER ttipo_modulo_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
|
||||
END;;
|
||||
|
||||
-- Categoria field is used to segregate several types
|
||||
|
@ -298,7 +337,7 @@ END;;
|
|||
BEGIN
|
||||
LOCK TABLE tusuario IN EXCLUSIVE MODE;
|
||||
INSERT INTO tusuario (id_user, fullname, firstname, lastname, middlename, password, comments, last_connect, registered, email, phone, is_admin, flash_chart, language, block_size, section) VALUES
|
||||
('admin', 'Pandora', 'Pandora', 'Admin', ' ', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1, -1, 'default', 0, 'Default');
|
||||
('admin', 'Pandora', 'Pandora', 'Admin', '', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1, -1, 'default', 0, 'Default');
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -317,11 +356,20 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tperfil IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tperfil_inc DISABLE';
|
||||
|
||||
INSERT INTO tperfil VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0);
|
||||
INSERT INTO tperfil VALUES (2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0);
|
||||
INSERT INTO tperfil VALUES (3,'Chief Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1);
|
||||
INSERT INTO tperfil VALUES (4,'Group coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1);
|
||||
INSERT INTO tperfil VALUES (5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tperfil', 'id_perfil');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tperfil_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -330,8 +378,17 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tnews IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnews_inc DISABLE';
|
||||
|
||||
INSERT INTO tnews (id_news, author, subject, text, timestamp) VALUES (1,'admin','Welcome to Pandora FMS 4.0','This is the new Pandora FMS Console. A lot of new features have been added since last version. Please read the documentation about it, and feel free to test any option.<br><br>The Pandora FMS Team.',current_timestamp);
|
||||
INSERT INTO tnews (id_news, author, subject, text, timestamp) VALUES (2,'admin','New Pandora FMS Agent Features','Feel free to test our new features for both Windows and Linux agents: Proxy and Broker modes.',current_timestamp);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tnews', 'id_news');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnews_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -340,11 +397,20 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tmodule IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tmodule_inc DISABLE';
|
||||
|
||||
INSERT INTO tmodule VALUES (1,'Agent module');
|
||||
INSERT INTO tmodule VALUES (2,'Network module');
|
||||
INSERT INTO tmodule VALUES (4,'Plugin module');
|
||||
INSERT INTO tmodule VALUES (5,'Prediction module');
|
||||
INSERT INTO tmodule VALUES (6,'WMI module');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tmodule', 'id_module');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tmodule_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -353,6 +419,9 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tnetwork_component IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnetwork_component_inc DISABLE';
|
||||
|
||||
INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, id_module_group, id_modulo, id_plugin, plugin_user, plugin_pass, plugin_parameter, max_timeout, history_data, min_warning, max_warning, str_warning, min_critical, max_critical, str_critical, min_ff_event, custom_string_1, custom_string_2, custom_string_3, custom_integer_1, custom_integer_2, post_process, wizard_level, critical_instructions, warning_instructions, unknown_instructions, tags, disabled_types_event, module_macros) VALUES (1,'OS Total process','Total process in Operating System (UNIX MIB)',13,15,0,0,300,0,'','','public','HOST-RESOURCES-MIB::hrSystemProcesses.0 ',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, id_module_group, id_modulo, id_plugin, plugin_user, plugin_pass, plugin_parameter, max_timeout, history_data, min_warning, max_warning, str_warning, min_critical, max_critical, str_critical, min_ff_event, custom_string_1, custom_string_2, custom_string_3, custom_integer_1, custom_integer_2, post_process, wizard_level, critical_instructions, warning_instructions, unknown_instructions, tags, disabled_types_event, module_macros) VALUES (2,'OS CPU Load (1 min)','CPU Load in Operating System (UNIX MIB)',13,15,0,0,300,0,'','','public','UCD-SNMP-MIB::laLoad.1',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, id_module_group, id_modulo, id_plugin, plugin_user, plugin_pass, plugin_parameter, max_timeout, history_data, min_warning, max_warning, str_warning, min_critical, max_critical, str_critical, min_ff_event, custom_string_1, custom_string_2, custom_string_3, custom_integer_1, custom_integer_2, post_process, wizard_level, critical_instructions, warning_instructions, unknown_instructions, tags, disabled_types_event, module_macros) VALUES (3,'Sysname','Get name of system using SNMP standard MIB',1,17,0,0,900,0,'','','public','.1.3.6.1.2.1.1.1.0',1,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
|
||||
|
@ -962,6 +1031,12 @@ INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, m
|
|||
INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, id_module_group, id_modulo, id_plugin, plugin_user, plugin_pass, plugin_parameter, max_timeout, history_data, min_warning, max_warning, str_warning, min_critical, max_critical, str_critical, min_ff_event, custom_string_1, custom_string_2, custom_string_3, custom_integer_1, custom_integer_2, post_process, wizard_level, critical_instructions, warning_instructions, unknown_instructions, tags, disabled_types_event, module_macros) VALUES (783,'Check Informix Port','',19,9,0,0,300,1526,'','','public','',2,2,0,'','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, id_module_group, id_modulo, id_plugin, plugin_user, plugin_pass, plugin_parameter, max_timeout, history_data, min_warning, max_warning, str_warning, min_critical, max_critical, str_critical, min_ff_event, custom_string_1, custom_string_2, custom_string_3, custom_integer_1, custom_integer_2, post_process, wizard_level, critical_instructions, warning_instructions, unknown_instructions, tags, disabled_types_event, module_macros) VALUES (784,'Check port DB2','',49,9,0,0,300,50000,'','','public','',2,2,0,'','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','','');
|
||||
INSERT INTO tnetwork_component (id_nc, name, description, id_group, type, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, id_module_group, id_modulo, id_plugin, plugin_user, plugin_pass, plugin_parameter, max_timeout, max_retries, history_data, min_warning, max_warning, str_warning, min_critical, max_critical, str_critical, min_ff_event, custom_string_1, custom_string_2, custom_string_3, custom_integer_1, custom_integer_2, post_process, unit, wizard_level, macros, critical_instructions, warning_instructions, unknown_instructions, critical_inverse, warning_inverse, id_category, tags, disabled_types_event, module_macros, min_ff_event_normal, min_ff_event_warning, min_ff_event_critical, each_ff) VALUES (785,'Packet Loss','Measure packet loss in the network, using a flood ping (50 ping in 8 secons) and counting back missing packets. It should be zero on most cases. ',10,1,0,0,300,0,'','','','',2,4,9,'','','',0,0,1,10.00,0.00,'',30.00,0.00,'',0,'','','',0,0,0.00000,'%','nowizard','{\"1\":{\macro\":\"_field1_\",\desc\":\Test time\",\help\":\"\",\value\":\"8\",\hide\":\"\"},\"2\":{\macro\":\"_field2_\",\desc\":\Target IP\",\help\":\"\",\value\":\"\",\hide\":\"\"}}','You should check manually the packet loss of the network with a flood ping on targeted host (ping -c 100 -f xxxx). Aditionally, and due the major packet loss, probably you can see a simple ping failing here. Check your network equipment.','You should check manually the packet loss of the network with a flood ping on targeted host (ping -c 100 -f xxxx)','',0,0,0,'','{\going_unknown\":0}','',0,0,0,0);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tnetwork_component', 'id_nc');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnetwork_component_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -970,24 +1045,27 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tnetwork_component_group IN EXCLUSIVE MODE;
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (1,'General group',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (2,'Cisco MIBs',10);
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnetwork_component_group_inc DISABLE';
|
||||
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (1,'General group',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (2,'Cisco MIBs',10);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (5,'UNIX Systems',12);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (10,'Network Management',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (10,'Network Management',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (11,'Microsoft Windows',12);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (12,'Operating Systems',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (13,'UCD Mibs (Linux, UCD-SNMP)',12);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (12,'Operating Systems',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (13,'UCD Mibs (Linux, UCD-SNMP)',12);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (14,'WMI',12);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (15,'Databases',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (16,'Windows System',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (17,'Windows Hardware Layer',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (18,'Windows AD ',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (19,'Windows IIS ',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (20,'Windows Exchange',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (21,'Windows LDAP ',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (22,'Windows MSDTC ',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (23,'Catalyst 2900 ',2);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (24,'Windows Printers',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (16,'Windows System',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (17,'Windows Hardware Layer',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (18,'Windows AD',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (19,'Windows IIS',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (20,'Windows Exchange',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (21,'Windows LDAP',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (22,'Windows MSDTC',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (23,'Catalyst 2900',2);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (24,'Windows Printers',14);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (25,'Citrix',0);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (26,'Exchange Services',20);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (27,'MS SQL Server',15);
|
||||
|
@ -1012,6 +1090,12 @@ INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (45,'Solaris',
|
|||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (46,'AIX',5);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (47,'BSD',5);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) VALUES (48,'MacOS',0);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tnetwork_component_group', 'id_sg');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnetwork_component_group_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -1020,9 +1104,17 @@ END;;
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE tnetwork_profile IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnetwork_profile_inc DISABLE';
|
||||
|
||||
INSERT INTO tnetwork_profile (id_np, name, description) VALUES (2,'Basic Monitoring','Only ICMP check');
|
||||
INSERT INTO tnetwork_profile (id_np, name, description) VALUES (3,'Basic DMZ Server monitoring','This group of network checks, checks for default services located on DMZ servers...');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tnetwork_profile', 'id_np');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tnetwork_profile_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -1044,14 +1136,32 @@ END;;
|
|||
-- GIS
|
||||
BEGIN
|
||||
LOCK TABLE tgis_map IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_inc DISABLE';
|
||||
|
||||
INSERT INTO tgis_map VALUES (1,'Sample',-3.708187,40.42056,0,16,'',-3.708187,40.42056,0,0,1);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tgis_map', 'id_tgis_map');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE tgis_map_connection IN EXCLUSIVE MODE;
|
||||
INSERT INTO tgis_map_connection VALUES (1,'OpenStreetMap (MapQuest Open)','OSM','{\type\":\OSM\",\url\":\http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png\"}',19,16,-3.708187,40.42056,0,-3.708187,40.42056,0,0);
|
||||
INSERT INTO tgis_map_connection VALUES (2,'OpenStreetMap (Standard)','OSM','{\type\":\OSM\",\url\":\http://tile.openstreetmap.org/${z}/${x}/${y}.png\"}',19,16,-3.708187,40.42056,0,-3.708187,40.42056,0,0);
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_connection_inc DISABLE';
|
||||
|
||||
INSERT INTO tgis_map_connection VALUES (1,'OpenStreetMap (MapQuest Open)','OSM','{"type":"OSM","url":"http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png"}',19,16,-3.708187,40.42056,0,-3.708187,40.42056,0,0);
|
||||
INSERT INTO tgis_map_connection VALUES (2,'OpenStreetMap (Standard)','OSM','{"type":"OSM","url":"http://tile.openstreetmap.org/${z}/${x}/${y}.png"}',19,16,-3.708187,40.42056,0,-3.708187,40.42056,0,0);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tgis_map_connection', 'id_tmap_connection');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_connection_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
@ -1059,54 +1169,81 @@ END;;
|
|||
|
||||
--BEGIN
|
||||
--LOCK TABLE tgis_map_has_tgis_map_connection IN EXCLUSIVE MODE;
|
||||
|
||||
--EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_has_tgis_map_connection_inc DISABLE';
|
||||
|
||||
--INSERT INTO tgis_map_has_tgis_map_connection VALUES (1,1,'2010-03-01 09:46:48',1);
|
||||
|
||||
--EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_has_tgis_map_connection_inc ENABLE';
|
||||
|
||||
--COMMIT;
|
||||
--END;
|
||||
--/
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE tgis_map_layer IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_layer_inc DISABLE';
|
||||
|
||||
INSERT INTO tgis_map_layer VALUES (1,'Group All',1,0,1,0);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tgis_map_layer', 'id_tmap_layer');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tgis_map_layer_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
-- example alert template
|
||||
BEGIN
|
||||
LOCK TABLE talert_commands IN EXCLUSIVE MODE;
|
||||
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (12,'Remote agent control','/usr/share/pandora_server/util/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data',0,'[\Command\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE talert_actions IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER talert_actions_inc DISABLE';
|
||||
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (2,'Restart agent',12,'REFRESH AGENT *','','',0,0);
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold, field1_recovery, field2_recovery, field3_recovery, field4_recovery, field5_recovery, field6_recovery, field7_recovery, field8_recovery, field9_recovery, field10_recovery) VALUES (3,'Pandora FMS Event',3,'_agent_ _module_ generated an event alert (_data_)','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED: _agent_ _module_ generated event alert (_data_)','alert_ceased','pandora','','4','','','','','');
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold, field1_recovery, field2_recovery, field3_recovery, field4_recovery, field5_recovery, field6_recovery, field7_recovery, field8_recovery, field9_recovery, field10_recovery) VALUES (4,'Create a ticket in Integria IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','','');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('talert_actions', 'id');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER talert_actions_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE talert_templates IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER talert_templates_inc DISABLE';
|
||||
|
||||
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day, wizard_level) VALUES (1,'Critical condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0,'basic');
|
||||
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day, wizard_level) VALUES (2,'Manual alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','',' ','max_min','',1,0.00,1.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,0,' ',' ',1,0,0,'basic');
|
||||
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day, wizard_level) VALUES (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','warning','',1,0.00,0.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',3,0,0,'basic');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('talert_templates', 'id');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER talert_templates_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
-- treport_custom_sql Data
|
||||
-- procedure to insert more than 4000 chars into a string
|
||||
CREATE OR REPLACE PROCEDURE treport_custom_sql_insert (IDX IN NUMBER, NAME IN VARCHAR2, SQL_TXT IN VARCHAR2, FLAG IN NUMBER := 0 ) AS g_nclob CLOB; BEGIN IF FLAG = 0 THEN INSERT INTO treport_custom_sql (id, name, sql) VALUES (IDX, NAME, empty_clob()) RETURNING sql INTO g_nclob; DBMS_LOB.write(g_nclob, length (SQL_TXT), 1, SQL_TXT); ELSE SELECT sql INTO g_nclob FROM treport_custom_sql WHERE id = IDX FOR UPDATE; DBMS_LOB.writeappend(g_nclob, length(SQL_TXT), SQL_TXT); END IF; END treport_custom_sql_insert;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE treport_custom_sql IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER treport_custom_sql_inc DISABLE';
|
||||
|
||||
INSERT INTO treport_custom_sql (id, name, sql) VALUES (1, 'Monitoring Report Agent', 'select direccion, nombre, comentarios, (select nombre from tgrupo where tgrupo.id_grupo = tagente.id_grupo) as group from tagente;');
|
||||
INSERT INTO treport_custom_sql (id, name, sql) VALUES (2, 'Monitoring Report Modules', 'select (select tagente.nombre from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_name, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by agent_name;');
|
||||
INSERT INTO treport_custom_sql (id, name, sql) VALUES (3, 'Monitoring Report Alerts', 'select t1.nombre as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;');
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
-- procedure to insert more than 4000 chars into a string
|
||||
CREATE OR REPLACE PROCEDURE treport_custom_sql_insert (IDX IN NUMBER, NAME IN VARCHAR2, SQL_TXT IN VARCHAR2, FLAG IN NUMBER) AS g_nclob CLOB; BEGIN if FLAG = 0 then INSERT INTO treport_custom_sql (id, name, sql) VALUES (IDX, NAME, empty_clob()) RETURNING sql INTO g_nclob; dbms_lob.write(g_nclob, length (SQL_TXT), 1, SQL_TXT); else SELECT sql INTO g_nclob FROM treport_custom_sql WHERE id = IDX FOR UPDATE; dbms_lob.writeappend(g_nclob, length(SQL_TXT), SQL_TXT); end if; END;;
|
||||
|
||||
BEGIN
|
||||
treport_custom_sql_insert(4, 'Group view', 'select t1.nombre, (select count(t3.id_agente) from tagente t3 where t1.id_grupo =',0);
|
||||
|
||||
treport_custom_sql_insert(4, 'Group view',' t3.id_grupo) agents, (SELECT COUNT(t4.id_agente) FROM tagente ',1);
|
||||
|
@ -1166,13 +1303,37 @@ treport_custom_sql_insert(4, 'Group view','tagente_modulo.id_agente_modulo&
|
|||
treport_custom_sql_insert(4, 'Group view','= tagente_modulo.id_agente_modulo AND times_fired > 0) monitor_alert_fired from tgrupo t1 where 0 ',1);
|
||||
|
||||
treport_custom_sql_insert(4, 'Group view','< (select count(t2.id_agente) from tagente t2 where t1.id_grupo = t2.id_grupo)',1);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('treport_custom_sql', 'id');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER treport_custom_sql_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE trecon_script IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER trecon_script_inc DISABLE';
|
||||
|
||||
INSERT INTO trecon_script VALUES (2,'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@artica.es>

Usage: ./ipmi-recon.pl <task_id> <group_id> <create_incident_flag> <custom_field1> <custom_field2> <custom_field3>

* custom_field1 = Network i.e.: 192.168.100.0/24
* custom_field2 = Username
* custom_fiedl3 = Password','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{"1":{"macro":"_field1_","desc":"Network","help":"i.e.: 192.168.100.0/24","value":"","hide":""},"2":{"macro":"_field2_","desc":"Username","help":"","value":"","hide":""},"3":{"macro":"_field3_","desc":"Password","help":"","value":"","hide":"1"}}');
|
||||
INSERT INTO trecon_script VALUES (4,'SNMP L2 Recon','Pandora FMS SNMP Recon Plugin for level 2 network topology discovery.
(c) Artica ST 2014 <info@artica.es>

Usage:

   ./snmp-recon.pl <task_id> <group_id> <create_incident> <custom_field1> <custom_field2> [custom_field3] [custom_field4]

 * custom_field1 = comma separated list of networks (i.e.: 192.168.1.0/24,192.168.2.0/24)
 * custom_field2 = comma separated list of snmp communities to try.
 * custom_field3 = a router in the network. Optional but recommended.
 * custom_field4 = set to -a to add all network interfaces (by default only interfaces that are up are added).

 Additional information:
When the script is called from a recon task the task_id, group_id and create_incident parameters are automatically filled by the Pandora FMS Server.','/usr/share/pandora_server/util/recon_scripts/snmp-recon.pl','{"1":{"macro":"_field1_","desc":"Network","help":"Comma separated list of networks (i.e.: 192.168.1.0/24,192.168.2.0/24)","value":"","hide":""},"2":{"macro":"_field2_","desc":"Community","help":"Comma separated list of snmp communities to try.","value":"","hide":""},"3":{"macro":"_field3_","desc":"Router","help":"A router in the network. Optional but recommended.","value":"","hide":""},"4":{"macro":"_field4_","desc":"Optional parameter","help":"Set to -a to add all network interfaces (by default only interfaces that are up are added).","value":"","hide":""}}');
|
||||
INSERT INTO trecon_script VALUES (5,'WMI Recon Script','This script is used to automatically gather host information via WMI.
Available parameters:

* Network = network to scan (e.g. 192.168.100.0/24).
* WMI auth = comma separated list of WMI authentication tokens in the format username%password (e.g. Administrador%pass).

See the documentation for more information.','/usr/share/pandora_server/util/recon_scripts/wmi-recon.pl','{"1":{"macro":"_field1_","desc":"Network","help":"","value":"","hide":""},"2":{"macro":"_field2_","desc":"WMI auth","help":"","value":"","hide":""}}');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('trecon_script', 'id_recon_script');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER trecon_script_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE tplugin IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tplugin_inc DISABLE';
|
||||
|
||||
INSERT INTO tplugin (id, name, description, max_timeout, execute, plugin_type, macros, parameters) VALUES (1,'IPMI Plugin','Plugin to get IPMI monitors from a IPMI Device.',0,'/usr/share/pandora_server/util/plugin/ipmi-plugin.pl',0,'{1:{macro:"_field1_",desc:Target IP,help:"",value:""},2:{macro:"_field2_",desc:Username,help:"",value:""},3:{macro:"_field3_",desc:Password,help:"",value:""}}','-h _field1_-u _field2_-p _field3_');
|
||||
INSERT INTO tplugin (id, name, description, max_timeout, execute, plugin_type, macros, parameters) VALUES (2,'DNS Plugin','This plugin is used to check if a specific domain return a specific IP address, and to check how time (milisecs) takes the DNS to answer. Use IP address parameter to specify the IP of your domain. Use these custom parameters for the other parameters:

-d domain to check (for example pandorafms.com)
-s DNS Server to check  (for example 8.8.8.8)

Optional parameters:

-t Do a DNS time response check instead DNS resolve test

',15,'/usr/share/pandora_server/util/plugin/dns_plugin.sh',0,'{1:{macro:"_field1_",desc:Target IP,help:"",value:""},2:{macro:"_field2_",desc:Domain to check,help:For example pandorafms.com,value:""},3:{macro:"_field3_",desc:DNS Server to check,help:For example 8.8.8.8,value:""},4:{macro:"_field4_",desc:Optional parameters,help:"",value:""}}','-i _field1_ -d _field2_ -s _field3_ _field4_');
|
||||
INSERT INTO tplugin (id, name, description, max_timeout, execute, plugin_type, macros, parameters) VALUES (3,'UDP port check','Check a remote UDP port (by using NMAP). Use IP address and Port options.',5,'/usr/share/pandora_server/util/plugin/udp_nmap_plugin.sh',0,'{1:{macro:"_field1_",desc:Target IP,help:"",value:""},2:{macro:"_field2_",desc:Port,help:"",value:""}}','-t _field1_-p _field2_');
|
||||
|
@ -1180,23 +1341,74 @@ INSERT INTO tplugin (id, name, description, max_timeout, execute, plugin_type, m
|
|||
INSERT INTO tplugin (id, name, description, max_timeout, execute, plugin_type, macros, parameters) VALUES (6,'MySQL Plugin','Samples:
   ./mysql_plugin.sh -u root -p none -s localhost -q Com_select
   ./mysql_plugin.sh -u root -p none -s localhost -q Com_update
   ./mysql_plugin.sh -u root -p none -s localhost -q Connections
   ./mysql_plugin.sh -u root -p anypass -s 192.168.50.24 -q Innodb_rows_read
',15,'/usr/share/pandora_server/util/plugin/mysql_plugin.sh',0,'{1:{macro:"_field1_",desc:IP address,help:IP address,value:""},2:{macro:"_field2_",desc:Username,help:Username to access to database,value:""},3:{macro:"_field3_",desc:Password,help:Password to access to database,value:""},4:{macro:"_field4_",desc:Query string,help:Query string of global status. For example 'Aborted_connects' or 'Innodb_rows_read'",value:""}}', '-s _field1_ -u _field2_ -p _field3_ -q _field4_');
|
||||
INSERT INTO tplugin (id, name, description, max_timeout, execute, plugin_type, macros, parameters) VALUES (8,'SNMP remote','Plugin that gets remotely, using SNMP, values such as the percentage of disk or memory used, the status of a process or the CPU load',0,'perl /usr/share/pandora_server/util/plugin/snmp_remote.pl',0,'{1:{macro:"_field1_",desc:Target IP,help:"",value:"_address_"},2:{macro:"_field2_",desc:Community,help:"",value:public},3:{macro:"_field3_",desc:Plug-in Parameters,help:Memory use (%)
-m memuse

Disk use (%)
-m diskuse -d [disk name]

Status of a process (0/1)
-m process -p [process_name] 

Average of CPUs Load (%)
-m cpuload,value:""}}', '-H _field1_ -c _field2_ _field3_');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tplugin', 'id');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tplugin_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE tagent_custom_fields IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tagent_custom_fields_inc DISABLE';
|
||||
|
||||
INSERT INTO tagent_custom_fields VALUES (1,'Serial Number',0);
|
||||
INSERT INTO tagent_custom_fields VALUES (2,'Department',0);
|
||||
INSERT INTO tagent_custom_fields VALUES (3,'Additional ID',0);
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tagent_custom_fields', 'id_field');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tagent_custom_fields_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE ttag IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER ttag_inc DISABLE';
|
||||
|
||||
INSERT INTO ttag (id_tag, name, description, url, email) VALUES (1,'network','Network equipment','http://artica.es','');
|
||||
INSERT INTO ttag (id_tag, name, description, url, email) VALUES (2,'critical','Critical modules','','');
|
||||
INSERT INTO ttag (id_tag, name, description, url, email) VALUES (3,'dmz','DMZ Network Zone','','');
|
||||
INSERT INTO ttag (id_tag, name, description, url, email) VALUES (4,'performance','Performance anda capacity modules','','');
|
||||
INSERT INTO ttag (id_tag, name, description, url, email) VALUES (5,'configuration','','','');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('ttag', 'id_tag');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER ttag_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE tevent_response IN EXCLUSIVE MODE;
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tevent_response_inc DISABLE';
|
||||
|
||||
INSERT INTO tevent_response VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'');
|
||||
INSERT INTO tevent_response VALUES (2,'SSH to host','Connect via SSH to the agent','http://192.168.70.164:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User');
|
||||
INSERT INTO tevent_response VALUES (3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'');
|
||||
INSERT INTO tevent_response VALUES (4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. 

Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,'');
|
||||
INSERT INTO tevent_response VALUES (5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'');
|
||||
|
||||
-- Update curr val of sequence
|
||||
update_currval('tevent_response', 'id');
|
||||
|
||||
EXECUTE IMMEDIATE 'ALTER TRIGGER tevent_response_inc ENABLE';
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE tupdate_settings IN EXCLUSIVE MODE;
|
||||
|
||||
INSERT INTO tupdate_settings VALUES ('current_update', '412');
|
||||
INSERT INTO tupdate_settings VALUES ('customer_key', 'PANDORA-FREE');
|
||||
INSERT INTO tupdate_settings VALUES ('updating_binary_path', 'Path where the updated binary files will be stored');
|
||||
|
@ -1212,3 +1424,4 @@ INSERT INTO tupdate_settings VALUES ('proxy_user', '');
|
|||
INSERT INTO tupdate_settings VALUES ('proxy_pass', '');
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
|
|
@ -30,6 +30,9 @@ CREATE OR REPLACE FUNCTION NOW RETURN TIMESTAMP AS t_now TIMESTAMP; BEGIN SELECT
|
|||
-- Procedure for retrieve PK information after an insert statement
|
||||
CREATE OR REPLACE PROCEDURE insert_id (table_name IN VARCHAR2, sql_insert IN VARCHAR2, id OUT NUMBER ) IS v_count NUMBER; BEGIN EXECUTE IMMEDIATE sql_insert; EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM user_sequences WHERE sequence_name = ''' || table_name || '_s''' INTO v_count; IF v_count >= 1 THEN EXECUTE IMMEDIATE 'SELECT ' || table_name || '_s.currval FROM DUAL' INTO id; ELSE id := 0; END IF; EXCEPTION WHEN others THEN RAISE_APPLICATION_ERROR(-20001, 'ERROR on insert_id procedure, please check input parameters or procedure logic.'); END insert_id;;
|
||||
|
||||
-- Procedure for update curr val of sequence
|
||||
CREATE OR REPLACE PROCEDURE update_currval (table_name IN VARCHAR2, column_name IN VARCHAR2 ) IS key_max NUMBER; BEGIN EXECUTE IMMEDIATE 'SELECT MAX(' || column_name || ') FROM ' || table_name INTO key_max; IF (key_max IS NULL) THEN key_max := 1; ELSE key_max := key_max + 1; END IF; EXECUTE IMMEDIATE 'DROP SEQUENCE ' || table_name || '_s'; EXECUTE IMMEDIATE 'CREATE SEQUENCE ' || table_name || '_s INCREMENT BY 1 START WITH ' || key_max; EXECUTE IMMEDIATE 'SELECT ' || table_name || '_s.nextval FROM dual'; END update_currval;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `taddress`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -39,8 +42,8 @@ CREATE TABLE taddress (
|
|||
ip_pack NUMBER(10, 0) DEFAULT 0
|
||||
);
|
||||
CREATE INDEX taddress_ip_idx ON taddress(ip);
|
||||
|
||||
CREATE SEQUENCE taddress_s INCREMENT BY 1 START WITH 1;
|
||||
-- Triggers must end with double semicolons because Pandora installer need it
|
||||
CREATE OR REPLACE TRIGGER taddress_inc BEFORE INSERT ON taddress REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT taddress_s.nextval INTO :NEW.id_a FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -51,6 +54,7 @@ CREATE TABLE taddress_agent (
|
|||
id_a NUMBER(19, 0) DEFAULT 0,
|
||||
id_agent NUMBER(19, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE SEQUENCE taddress_agent_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER taddress_agent_inc BEFORE INSERT ON taddress_agent REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT taddress_agent_s.nextval INTO :NEW.id_ag FROM dual; END;;
|
||||
|
||||
|
@ -74,12 +78,12 @@ CREATE TABLE tagente (
|
|||
id_parent NUMBER(10, 0) DEFAULT 0,
|
||||
custom_id VARCHAR2(255) DEFAULT '',
|
||||
server_name VARCHAR2(100) DEFAULT '',
|
||||
cascade_protection NUMBER(5, 0) DEFAULT 0,
|
||||
cascade_protection NUMBER(5, 0) DEFAULT 0,
|
||||
--number of hours of diference with the server timezone
|
||||
timezone_offset NUMBER(5, 0) DEFAULT 0,
|
||||
--path in the server to the image of the icon representing the agent
|
||||
--path in the server to the image of the icon representing the agent
|
||||
icon_path VARCHAR2(127) DEFAULT '',
|
||||
--set it to one to update the position data (altitude, longitude, latitude) whenetting information from the agent or to 0 to keep the last value and don\'t update it
|
||||
--set it to one to update the position data (altitude, longitude, latitude) whenetting information from the agent or to 0 to keep the last value and don\'t update it
|
||||
update_gis_data NUMBER(5, 0) DEFAULT 1,
|
||||
url_address CLOB DEFAULT '',
|
||||
quiet NUMBER(5, 0) DEFAULT 0,
|
||||
|
@ -97,6 +101,7 @@ CREATE INDEX tagente_nombre_idx ON tagente(nombre);
|
|||
CREATE INDEX tagente_direccion_idx ON tagente(direccion);
|
||||
CREATE INDEX tagente_disabled_idx ON tagente(disabled);
|
||||
CREATE INDEX tagente_id_grupo_idx ON tagente(id_grupo);
|
||||
|
||||
CREATE SEQUENCE tagente_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tagente_inc BEFORE INSERT ON tagente REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tagente_s.nextval INTO :NEW.id_agente FROM dual; END;;
|
||||
|
||||
|
@ -111,6 +116,8 @@ CREATE TABLE tagente_datos (
|
|||
CREATE INDEX tagente_datos_id_agent_mod_idx ON tagente_datos(id_agente_modulo);
|
||||
CREATE INDEX tagente_datos_utimestamp_idx ON tagente_datos(utimestamp);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_datos_inc`
|
||||
-- -----------------------------------------------------
|
||||
|
@ -120,8 +127,8 @@ CREATE TABLE tagente_datos_inc (
|
|||
utimestamp NUMBER(10, 0) DEFAULT 0
|
||||
);
|
||||
CREATE INDEX tagente_datos_inc_id_ag_mo_idx ON tagente_datos_inc(id_agente_modulo);
|
||||
CREATE SEQUENCE tagente_datos_inc_s INCREMENT BY 1 START WITH 1;
|
||||
--CREATE OR REPLACE TRIGGER tagente_datos_inc_inc BEFORE INSERT ON tagente_datos_inc REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tagente_datos_inc_s.nextval INTO :NEW.id_adi FROM dual; END;;
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_datos_string`
|
||||
|
@ -133,6 +140,8 @@ CREATE TABLE tagente_datos_string (
|
|||
);
|
||||
CREATE INDEX tagente_datos_string_utsta_idx ON tagente_datos_string(utimestamp);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_datos_log4x`
|
||||
-- -----------------------------------------------------
|
||||
|
@ -145,6 +154,7 @@ CREATE TABLE tagente_datos_log4x (
|
|||
utimestamp NUMBER(10, 0) DEFAULT 0
|
||||
);
|
||||
CREATE INDEX tagente_datos_log4x_id_a_m_idx ON tagente_datos_log4x(id_agente_modulo);
|
||||
|
||||
CREATE SEQUENCE tagente_datos_log4x_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tagente_datos_log4x_inc BEFORE INSERT ON tagente_datos_log4x REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tagente_datos_log4x_s.nextval INTO :NEW.id_tagente_datos_log4x FROM dual; END;;
|
||||
|
||||
|
@ -176,7 +186,6 @@ CREATE INDEX tagente_estado_running_by_idx ON tagente_estado(running_by);
|
|||
CREATE INDEX tagente_estado_last_ex_try_idx ON tagente_estado(last_execution_try);
|
||||
|
||||
CREATE SEQUENCE tagente_estado_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tagente_estado_inc BEFORE INSERT ON tagente_estado REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tagente_estado_s.nextval INTO :NEW.id_agente_estado FROM dual; END;;
|
||||
|
||||
-- Probably last_execution_try index is not useful and loads more than benefits
|
||||
|
@ -190,6 +199,9 @@ CREATE OR REPLACE TRIGGER tagente_estado_inc BEFORE INSERT ON tagente_estado REF
|
|||
-- 6 - WMI server
|
||||
-- 7 - WEB Server (enteprise)
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE tagente_modulo (
|
||||
id_agente_modulo NUMBER(10, 0) PRIMARY KEY,
|
||||
id_agente NUMBER(10, 0) DEFAULT 0,
|
||||
|
@ -263,11 +275,13 @@ CREATE INDEX tagente_modulo_id_t_mod_idx ON tagente_modulo(id_tipo_modulo);
|
|||
CREATE INDEX tagente_modulo_disabled_idx ON tagente_modulo(disabled);
|
||||
|
||||
CREATE SEQUENCE tagente_modulo_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tagente_modulo_inc BEFORE INSERT ON tagente_modulo REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tagente_modulo_s.nextval INTO :NEW.id_agente_modulo FROM dual; END;;
|
||||
|
||||
-- snmp_oid is also used for WMI query
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagent_access`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE tagent_access (
|
||||
id_agent NUMBER(10, 0) DEFAULT 0,
|
||||
utimestamp NUMBER(19, 0) DEFAULT 0
|
||||
|
@ -275,6 +289,11 @@ CREATE TABLE tagent_access (
|
|||
CREATE INDEX tagent_access_id_agent_idx ON tagent_access(id_agent);
|
||||
CREATE INDEX tagent_access_utimestamp_idx ON tagent_access(utimestamp);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_snmp`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_snmp (
|
||||
id_as NUMBER(10, 0) PRIMARY KEY,
|
||||
id_alert NUMBER(10, 0) DEFAULT 0,
|
||||
|
@ -347,9 +366,11 @@ CREATE TABLE talert_snmp (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE talert_snmp_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER talert_snmp_inc BEFORE INSERT ON talert_snmp REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_snmp_s.nextval INTO :NEW.id_as FROM dual; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_commands`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_commands (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(100) DEFAULT '',
|
||||
|
@ -361,9 +382,11 @@ CREATE TABLE talert_commands (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE talert_commands_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER talert_commands_inc BEFORE INSERT ON talert_commands REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_commands_s.nextval INTO :NEW.id FROM dual; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_actions`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_actions (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
name CLOB DEFAULT '',
|
||||
|
@ -393,12 +416,14 @@ CREATE TABLE talert_actions (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE talert_actions_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER talert_actions_inc BEFORE INSERT ON talert_actions REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_actions_s.nextval INTO :NEW.id FROM dual; END;;
|
||||
|
||||
-- on update trigger
|
||||
CREATE OR REPLACE TRIGGER talert_actions_update AFTER UPDATE OF id ON talert_commands FOR EACH ROW BEGIN UPDATE talert_actions SET id_alert_command = :NEW.id WHERE id_alert_command = :OLD.id; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_templates`
|
||||
-- -----------------------------------------------------
|
||||
-- use to_char(time_from, 'hh24:mi:ss') function to retrieve time_from field info
|
||||
-- use to_char(time_to, 'hh24:mi:ss') function to retrieve time_to field info
|
||||
CREATE TABLE talert_templates (
|
||||
|
@ -454,12 +479,14 @@ CREATE TABLE talert_templates (
|
|||
CREATE INDEX talert_templates_id_al_act_idx ON talert_templates(id_alert_action);
|
||||
|
||||
CREATE SEQUENCE talert_templates_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER talert_templates_inc BEFORE INSERT ON talert_templates REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_templates_s.nextval INTO :NEW.id FROM dual; END;;
|
||||
|
||||
-- on update trigger
|
||||
CREATE OR REPLACE TRIGGER talert_templates_update AFTER UPDATE OF id ON talert_actions FOR EACH ROW BEGIN UPDATE talert_templates SET id_alert_action = :NEW.id WHERE id_alert_action = :OLD.id; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_template_modules`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_template_modules (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
id_agent_module NUMBER(10, 0) REFERENCES tagente_modulo(id_agente_modulo) ON DELETE CASCADE,
|
||||
|
@ -486,6 +513,9 @@ CREATE OR REPLACE TRIGGER talert_template_modules_update AFTER UPDATE OF id_agen
|
|||
-- on update trigger 1
|
||||
CREATE OR REPLACE TRIGGER talert_template_module_update1 AFTER UPDATE OF id ON talert_templates FOR EACH ROW BEGIN UPDATE talert_template_modules SET id_alert_template = :NEW.id WHERE id_alert_template = :OLD.id; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_template_module_actions`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_template_module_actions (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
id_alert_template_module NUMBER(10, 0) REFERENCES talert_template_modules(id) ON DELETE CASCADE,
|
||||
|
@ -495,7 +525,7 @@ CREATE TABLE talert_template_module_actions (
|
|||
module_action_threshold NUMBER(10, 0) DEFAULT 0,
|
||||
last_execution NUMBER(18, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
CREATE SEQUENCE talert_template_modu_actions_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER talert_template_mod_action_inc BEFORE INSERT ON talert_template_module_actions REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_template_modu_actions_s.nextval INTO :NEW.id FROM dual; END;;
|
||||
|
@ -506,6 +536,9 @@ CREATE OR REPLACE TRIGGER talert_template_mod_act_update AFTER UPDATE OF id ON t
|
|||
-- on update trigger 1
|
||||
CREATE OR REPLACE TRIGGER talert_template_mod_ac_update1 AFTER UPDATE OF id ON talert_actions FOR EACH ROW BEGIN UPDATE talert_template_module_actions SET id_alert_action = :NEW.id WHERE id_alert_action = :OLD.id; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_special_days`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_special_days (
|
||||
id NUMBER(10,0) PRIMARY KEY,
|
||||
id_group NUMBER(10, 0) DEFAULT 0,
|
||||
|
@ -547,6 +580,7 @@ CREATE TABLE tconfig (
|
|||
token VARCHAR2(100) DEFAULT '',
|
||||
value CLOB DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tconfig_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tconfig_inc BEFORE INSERT ON tconfig REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tconfig_s.nextval INTO :NEW.id_config FROM dual; END;;
|
||||
|
||||
|
@ -560,6 +594,9 @@ CREATE TABLE tconfig_os (
|
|||
icon_name VARCHAR2(100) DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tconfig_os_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tconfig_os_inc BEFORE INSERT ON tconfig_os REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tconfig_os_s.nextval INTO :NEW.id_os FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tevento`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -594,7 +631,6 @@ CREATE INDEX tevento_id_2_idx ON tevento(utimestamp, id_evento);
|
|||
CREATE INDEX tevento_id_agentmodule_idx ON tevento(id_agentmodule);
|
||||
|
||||
CREATE SEQUENCE tevento_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tevento_inc BEFORE INSERT ON tevento REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tevento_s.nextval INTO :NEW.id_evento FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -620,7 +656,6 @@ CREATE TABLE tgrupo (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tgrupo_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tgrupo_inc BEFORE INSERT ON tgrupo REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgrupo_s.nextval INTO :NEW.id_grupo FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -651,7 +686,6 @@ CREATE INDEX tincidencia_id_agente_mod_idx ON tincidencia(id_agente_modulo);
|
|||
CREATE OR REPLACE TRIGGER tincidencia_actualizacion_ts BEFORE UPDATE ON tincidencia FOR EACH ROW BEGIN select CURRENT_TIMESTAMP into :NEW.actualizacion FROM dual; END;;
|
||||
|
||||
CREATE SEQUENCE tincidencia_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tincidencia_inc BEFORE INSERT ON tincidencia REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tincidencia_s.nextval INTO :NEW.id_incidencia FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -661,6 +695,7 @@ CREATE TABLE tlanguage (
|
|||
id_language VARCHAR2(6) DEFAULT '',
|
||||
name VARCHAR2(100) DEFAULT ''
|
||||
);
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlink`
|
||||
|
@ -672,7 +707,6 @@ CREATE TABLE tlink (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tlink_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tlink_inc BEFORE INSERT ON tlink REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tlink_s.nextval INTO :NEW.id_link FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -689,7 +723,6 @@ CREATE TABLE tmensajes (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tmensajes_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tmensajes_inc BEFORE INSERT ON tmensajes REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tmensajes_s.nextval INTO :NEW.id_mensaje FROM dual; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -701,7 +734,6 @@ CREATE TABLE tmodule_group (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tmodule_group_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tmodule_group_inc BEFORE INSERT ON tmodule_group REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tmodule_group_s.nextval INTO :NEW.id_mg FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
|
@ -715,7 +747,6 @@ CREATE TABLE tmodule_relationship (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tmodule_relationship_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tmodule_relationship_inc BEFORE INSERT ON tmodule_relationship REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tmodule_relationship_s.nextval INTO :NEW.id FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
|
@ -777,16 +808,23 @@ CREATE TABLE tnetwork_component (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tnetwork_component_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tnetwork_component_inc BEFORE INSERT ON tnetwork_component REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetwork_component_s.nextval INTO :NEW.id_nc FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnetwork_component_group`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tnetwork_component_group (
|
||||
id_sg NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(200) DEFAULT '',
|
||||
parent NUMBER(19, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tnetwork_component_group_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tnetwork_component_group_inc BEFORE INSERT ON tnetwork_component_group REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetwork_component_group_s.nextval INTO :NEW.id_sg FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnetwork_profile`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tnetwork_profile (
|
||||
id_np NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(100) DEFAULT '',
|
||||
|
@ -794,15 +832,22 @@ CREATE TABLE tnetwork_profile (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tnetwork_profile_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tnetwork_profile_inc BEFORE INSERT ON tnetwork_profile REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetwork_profile_s.nextval INTO :NEW.id_np FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnetwork_profile_component`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tnetwork_profile_component (
|
||||
id_nc NUMBER(19, 0) DEFAULT 0,
|
||||
id_np NUMBER(19, 0) DEFAULT 0
|
||||
);
|
||||
CREATE INDEX tnetwork_profile_id_np_idx ON tnetwork_profile_component(id_np);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnota`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tnota (
|
||||
id_nota NUMBER(19, 0) PRIMARY KEY,
|
||||
id_incident NUMBER(19, 0),
|
||||
|
@ -812,10 +857,20 @@ CREATE TABLE tnota (
|
|||
);
|
||||
CREATE INDEX tnota_id_incident_idx ON tnota(id_incident);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `torigen`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE torigen (
|
||||
origen VARCHAR2(100) DEFAULT ''
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tperfil`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tperfil (
|
||||
id_perfil NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(200) NOT NULL,
|
||||
|
@ -845,9 +900,11 @@ CREATE TABLE tperfil (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tperfil_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tperfil_inc BEFORE INSERT ON tperfil REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tperfil_s.nextval INTO :NEW.id_perfil FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `trecon_script`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE trecon_script (
|
||||
id_recon_script NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(100) DEFAULT '',
|
||||
|
@ -857,9 +914,11 @@ CREATE TABLE trecon_script (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE trecon_script_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER trecon_script_inc BEFORE INSERT ON trecon_script REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT trecon_script_s.nextval INTO :NEW.id_recon_script FROM dual; END;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `trecon_task`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE trecon_task (
|
||||
id_rt NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(100) DEFAULT '',
|
||||
|
@ -890,9 +949,11 @@ CREATE TABLE trecon_task (
|
|||
CREATE INDEX trecon_task_id_rec_serv_idx ON trecon_task(id_recon_server);
|
||||
|
||||
CREATE SEQUENCE trecon_task_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER trecon_task_inc BEFORE INSERT ON trecon_task REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT trecon_task_s.nextval INTO :NEW.id_rt FROM dual; END trecon_task_inc;;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tserver`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tserver (
|
||||
id_server NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(100) DEFAULT '',
|
||||
|
@ -926,7 +987,6 @@ CREATE INDEX tserver_keepalive_idx ON tserver(keepalive);
|
|||
CREATE INDEX tserver_status_idx ON tserver(status);
|
||||
|
||||
CREATE SEQUENCE tserver_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tserver_inc BEFORE INSERT ON tserver REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tserver_s.nextval INTO :NEW.id_server FROM dual; END tserver_inc;;
|
||||
|
||||
-- server types:
|
||||
|
@ -942,6 +1002,9 @@ CREATE OR REPLACE TRIGGER tserver_inc BEFORE INSERT ON tserver REFERENCING NEW A
|
|||
-- 9 web
|
||||
-- TODO: drop 2.x xxxx_server fields, unused since server_type exists.
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tsesion`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE tsesion (
|
||||
id_sesion NUMBER(19, 0) PRIMARY KEY,
|
||||
id_usuario VARCHAR2(60) DEFAULT '0',
|
||||
|
@ -955,11 +1018,10 @@ CREATE INDEX tsesion_utimestamp_idx ON tsesion(utimestamp);
|
|||
CREATE INDEX tsesion_id_usuario_idx ON tsesion(id_usuario);
|
||||
|
||||
CREATE SEQUENCE tsesion_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tsesion_inc BEFORE INSERT ON tsesion REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tsesion_s.nextval INTO :NEW.id_sesion FROM dual; END tsesion_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table ttipo_modulo
|
||||
-- Table `ttipo_modulo`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE ttipo_modulo (
|
||||
id_tipo NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -968,11 +1030,12 @@ CREATE TABLE ttipo_modulo (
|
|||
descripcion VARCHAR2(100) DEFAULT '',
|
||||
icon VARCHAR2(100) DEFAULT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE ttipo_modulo_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER ttipo_modulo_inc BEFORE INSERT ON ttipo_modulo REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT ttipo_modulo_s.nextval INTO :NEW.id_tipo FROM dual; END ttipo_modulo_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table ttrap
|
||||
-- Table `ttrap`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE ttrap (
|
||||
id_trap NUMBER(19, 0) PRIMARY KEY,
|
||||
|
@ -992,6 +1055,7 @@ CREATE TABLE ttrap (
|
|||
description VARCHAR2(255) DEFAULT '',
|
||||
severity NUMBER(10, 0) DEFAULT 2
|
||||
);
|
||||
|
||||
CREATE SEQUENCE ttrap_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER ttrap_inc BEFORE INSERT ON ttrap REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT ttrap_s.nextval INTO :NEW.id_trap FROM dual; END ttrap_inc;;
|
||||
|
||||
|
@ -1035,6 +1099,8 @@ CREATE TABLE tusuario (
|
|||
CONSTRAINT t_usuario_metaconsole_acc_cons CHECK (metaconsole_access IN ('basic','advanced'))
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tusuario_perfil`
|
||||
-- -----------------------------------------------------
|
||||
|
@ -1047,6 +1113,7 @@ CREATE TABLE tusuario_perfil (
|
|||
id_policy NUMBER(10, 0) DEFAULT 0,
|
||||
tags CLOB DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tusuario_perfil_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tusuario_perfil_inc BEFORE INSERT ON tusuario_perfil REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tusuario_perfil_s.nextval INTO :NEW.id_up FROM dual; END tusuario_perfil_inc;;
|
||||
|
||||
|
@ -1058,11 +1125,12 @@ CREATE TABLE tuser_double_auth (
|
|||
id_user VARCHAR2(60) REFERENCES tusuario(id_user) ON DELETE CASCADE,
|
||||
secret VARCHAR2(20)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tuser_double_auth_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tuser_double_auth_inc BEFORE INSERT ON tuser_double_auth REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tuser_double_auth_s.nextval INTO :NEW.id FROM dual; END tuser_double_auth_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tnews
|
||||
-- Table `tnews`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tnews (
|
||||
id_news NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1075,11 +1143,12 @@ CREATE TABLE tnews (
|
|||
expire NUMBER(5, 0) DEFAULT 0,
|
||||
expire_timestamp TIMESTAMP DEFAULT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tnews_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tnews_inc BEFORE INSERT ON tnews REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnews_s.nextval INTO :NEW.id_news FROM dual; END tnews_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tgraph
|
||||
-- Table `tgraph`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tgraph (
|
||||
id_graph NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1095,11 +1164,12 @@ CREATE TABLE tgraph (
|
|||
id_group NUMBER(19, 0) DEFAULT 0,
|
||||
id_graph_template NUMBER(11, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tgraph_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tgraph_inc BEFORE INSERT ON tgraph REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgraph_s.nextval INTO :NEW.id_graph FROM dual; END tgraph_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tgraph_source
|
||||
-- Table `tgraph_source`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tgraph_source (
|
||||
id_gs NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1107,11 +1177,12 @@ CREATE TABLE tgraph_source (
|
|||
id_agent_module NUMBER(19, 0) DEFAULT 0,
|
||||
weight BINARY_DOUBLE DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tgraph_source_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tgraph_source_inc BEFORE INSERT ON tgraph_source REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgraph_source_s.nextval INTO :NEW.id_gs FROM dual; END tgraph_source_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table treport
|
||||
-- Table `treport`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE treport (
|
||||
id_report NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1130,11 +1201,12 @@ CREATE TABLE treport (
|
|||
metaconsole NUMBER(5, 0) DEFAULT 0,
|
||||
non_interactive NUMBER(5, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE SEQUENCE treport_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER treport_inc BEFORE INSERT ON treport REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT treport_s.nextval INTO :NEW.id_report FROM dual; END treport_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table treport_content
|
||||
-- Table `treport_content`
|
||||
-- -----------------------------------------------------
|
||||
-- use to_char(time_from, 'hh24:mi:ss') function to retrieve time_from field info
|
||||
-- use to_char(time_to, 'hh24:mi:ss') function to retrieve time_to field info
|
||||
|
@ -1180,12 +1252,14 @@ CREATE TABLE treport_content (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE treport_content_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER treport_content_inc BEFORE INSERT ON treport_content REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT treport_content_s.nextval INTO :NEW.id_rc FROM dual; END treport_content_inc;;
|
||||
|
||||
-- on update trigger
|
||||
CREATE OR REPLACE TRIGGER treport_content_update AFTER UPDATE OF id_report ON treport FOR EACH ROW BEGIN UPDATE treport_content SET id_rc = :NEW.id_report WHERE id_rc = :OLD.id_report; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_sla_combined`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE treport_content_sla_combined (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
id_report_content NUMBER(10, 0) REFERENCES treport_content(id_rc) ON DELETE CASCADE,
|
||||
|
@ -1196,14 +1270,17 @@ CREATE TABLE treport_content_sla_combined (
|
|||
server_name CLOB DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE treport_cont_sla_c_s INCREMENT BY 1 START WITH 1;
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
CREATE SEQUENCE treport_cont_sla_c_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER treport_content_sla_comb_inc BEFORE INSERT ON treport_content REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT treport_cont_sla_c_s.nextval INTO :NEW.id_rc FROM dual; END treport_content_sla_comb_inc;;
|
||||
|
||||
-- on update trigger
|
||||
CREATE OR REPLACE TRIGGER treport_cont_sla_comb_update AFTER UPDATE OF id_rc on treport_content FOR EACH ROW BEGIN UPDATE treport_content_sla_combined SET id_report_content = :NEW.id_rc WHERE id_report_content = :OLD.id_rc; END;;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_item`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE treport_content_item (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
id_report_content NUMBER(10, 0) REFERENCES treport_content(id_rc) ON DELETE CASCADE,
|
||||
|
@ -1213,22 +1290,22 @@ CREATE TABLE treport_content_item (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE treport_content_item_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER treport_content_item_inc BEFORE INSERT ON treport_content_item REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT treport_content_item_s.nextval INTO :NEW.id FROM dual; END treport_content_item_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table treport_custom_sql
|
||||
-- Table `treport_custom_sql`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE treport_custom_sql (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(150) DEFAULT '',
|
||||
sql CLOB DEFAULT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE treport_custom_sql_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER treport_custom_sql_inc BEFORE INSERT ON treport_custom_sql REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT treport_custom_sql_s.nextval INTO :NEW.id FROM dual; END treport_custom_sql_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tlayout
|
||||
-- Table `tlayout`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tlayout (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1238,11 +1315,12 @@ CREATE TABLE tlayout (
|
|||
height NUMBER(10, 0) DEFAULT 0,
|
||||
width NUMBER(10, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tlayout_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tlayout_inc BEFORE INSERT ON tlayout REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tlayout_s.nextval INTO :NEW.id FROM dual; END tlayout_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tlayout_data
|
||||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tlayout_data (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1267,11 +1345,12 @@ CREATE TABLE tlayout_data (
|
|||
border_color VARCHAR2(200) DEFAULT '',
|
||||
fill_color VARCHAR2(200) DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tlayout_data_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tlayout_data_inc BEFORE INSERT ON tlayout_data REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tlayout_data_s.nextval INTO :NEW.id FROM dual; END tlayout_data_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tplugin
|
||||
-- Table `tplugin`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tplugin (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1287,22 +1366,24 @@ CREATE TABLE tplugin (
|
|||
plugin_type NUMBER(5, 0) DEFAULT 0,
|
||||
macros CLOB DEFAULT '',
|
||||
parameters CLOB DEFAULT ''
|
||||
);
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tplugin_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tplugin_inc BEFORE INSERT ON tplugin REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tplugin_s.nextval INTO :NEW.id FROM dual; END tplugin_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tmodule
|
||||
-- Table `tmodule`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tmodule (
|
||||
id_module NUMBER(10, 0) PRIMARY KEY,
|
||||
name VARCHAR2(100) DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tmodule_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tmodule_inc BEFORE INSERT ON tmodule REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tmodule_s.nextval INTO :NEW.id_module FROM dual; END tmodule_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tserver_export
|
||||
-- Table `tserver_export`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tserver_export (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1321,9 +1402,13 @@ CREATE TABLE tserver_export (
|
|||
timezone_offset NUMBER(5, 0) DEFAULT 0,
|
||||
CONSTRAINT tserver_export_conn_mode_cons CHECK (connect_mode IN ('tentacle', 'ssh', 'local'))
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tserver_export_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tserver_export_inc BEFORE INSERT ON tserver_export REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tserver_export_s.nextval INTO :NEW.id FROM dual; END tserver_export_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tserver_export_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
-- id_export_server is real pandora fms export server process that manages this server
|
||||
-- id is the destination server to export
|
||||
CREATE TABLE tserver_export_data (
|
||||
|
@ -1337,7 +1422,6 @@ CREATE TABLE tserver_export_data (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tserver_export_data_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tserver_export_data_inc BEFORE INSERT ON tserver_export_data REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tserver_export_data_s.nextval INTO :NEW.id FROM dual; END tserver_export_data_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
|
@ -1370,6 +1454,7 @@ CREATE TABLE tplanned_downtime (
|
|||
type_periodicity VARCHAR2(100) DEFAULT 'weekly',
|
||||
id_user VARCHAR2(100) DEFAULT '0'
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tplanned_downtime_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tplanned_downtime_inc BEFORE INSERT ON tplanned_downtime REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tplanned_downtime_s.nextval INTO :NEW.id FROM dual; END tplanned_downtime_inc;;
|
||||
|
||||
|
@ -1382,6 +1467,7 @@ CREATE TABLE tplanned_downtime_agents (
|
|||
id_downtime NUMBER(19, 0) DEFAULT 0 REFERENCES tplanned_downtime(id) ON DELETE CASCADE,
|
||||
all_modules NUMBER(5, 0) DEFAULT 1
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tplanned_downtime_agents_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tplanned_downtime_agents_inc BEFORE INSERT ON tplanned_downtime_agents REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tplanned_downtime_agents_s.nextval INTO :NEW.id FROM dual; END tplanned_downtime_agents_inc;;
|
||||
|
||||
|
@ -1394,13 +1480,14 @@ CREATE TABLE tplanned_downtime_modules (
|
|||
id_agent_module NUMBER(10, 0) REFERENCES tagente_modulo(id_agente_modulo) ON DELETE CASCADE,
|
||||
id_downtime NUMBER(19, 0) DEFAULT 0 REFERENCES tplanned_downtime(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE SEQUENCE tplanned_downtime_modules_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tplanned_downtime_modules_inc BEFORE INSERT ON tplanned_downtime_modules REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tplanned_downtime_modules_s.nextval INTO :NEW.id FROM dual; END tplanned_downtime_modules_inc;;
|
||||
|
||||
--IS extension Tables
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_data_history
|
||||
-- Table `tgis_data_history`
|
||||
-- -----------------------------------------------------
|
||||
--Table to store historicalIS information of the agents
|
||||
CREATE TABLE tgis_data_history (
|
||||
|
@ -1426,11 +1513,10 @@ CREATE INDEX tgis_data_history_start_t_idx ON tgis_data_history(start_timestamp)
|
|||
CREATE INDEX tgis_data_history_end_t_idx ON tgis_data_history(end_timestamp);
|
||||
|
||||
CREATE SEQUENCE tgis_data_history_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tgis_data_history_inc BEFORE INSERT ON tgis_data_history REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgis_data_history_s.nextval INTO :NEW.id_tgis_data FROM dual; END tgis_data_history_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_data_status
|
||||
-- Table `tgis_data_status`
|
||||
-- -----------------------------------------------------
|
||||
--Table to store lastIS information of the agents
|
||||
--ON UPDATE NO ACTION is implicit on Oracle DBMS for tagente_id_agente field
|
||||
|
@ -1461,8 +1547,10 @@ CREATE TABLE tgis_data_status (
|
|||
);
|
||||
CREATE INDEX tgis_data_status_start_t_idx ON tgis_data_status(start_timestamp);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_map
|
||||
-- Table `tgis_map`
|
||||
-- -----------------------------------------------------
|
||||
--Table containing information about ais map
|
||||
CREATE TABLE tgis_map (
|
||||
|
@ -1494,11 +1582,10 @@ CREATE TABLE tgis_map (
|
|||
CREATE INDEX tgis_map_tagente_map_name_idx ON tgis_map(map_name);
|
||||
|
||||
CREATE SEQUENCE tgis_map_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tgis_map_inc BEFORE INSERT ON tgis_map REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgis_map_s.nextval INTO :NEW.id_tgis_map FROM dual; END tgis_map_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_map_connection
|
||||
-- Table `tgis_map_connection`
|
||||
-- -----------------------------------------------------
|
||||
--Table to store the map connection information
|
||||
CREATE TABLE tgis_map_connection (
|
||||
|
@ -1531,11 +1618,10 @@ CREATE TABLE tgis_map_connection (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tgis_map_connection_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tgis_map_connection_inc BEFORE INSERT ON tgis_map_connection REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgis_map_connection_s.nextval INTO :NEW.id_tmap_connection FROM dual; END tgis_map_connection_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_map_has_tgis_map_connection
|
||||
-- Table `tgis_map_has_tgis_map_connection`
|
||||
-- -----------------------------------------------------
|
||||
|
||||
-- This table is commented because table name length is more 30 chars. TODO: Change it's name
|
||||
|
@ -1559,7 +1645,7 @@ CREATE OR REPLACE TRIGGER tgis_map_connection_inc BEFORE INSERT ON tgis_map_conn
|
|||
--CREATE OR REPLACE TRIGGER tgis_map_has_tgis_map_connection_ts BEFORE UPDATE ON tgis_map_has_tgis_map_connection FOR EACH ROW BEGIN select CURRENT_TIMESTAMP into :NEW.modification_time from dual; END;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_map_layer
|
||||
-- Table `tgis_map_layer`
|
||||
-- -----------------------------------------------------
|
||||
--Table containing information about the map layers
|
||||
CREATE TABLE tgis_map_layer (
|
||||
|
@ -1578,11 +1664,10 @@ CREATE TABLE tgis_map_layer (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tgis_map_layer_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tgis_map_layer_inc BEFORE INSERT ON tgis_map_layer REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tgis_map_layer_s.nextval INTO :NEW.id_tmap_layer FROM dual; END tgis_map_layer_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tgis_map_layer_has_tagente
|
||||
-- Table `tgis_map_layer_has_tagente`
|
||||
-- -----------------------------------------------------
|
||||
--Table to define wich agents are shown in a layer
|
||||
CREATE TABLE tgis_map_layer_has_tagente (
|
||||
|
@ -1593,8 +1678,10 @@ CREATE TABLE tgis_map_layer_has_tagente (
|
|||
CREATE INDEX tgis_map_layer_has_tagente_idx ON tgis_map_layer_has_tagente(tgis_map_layer_id_tmap_layer);
|
||||
CREATE INDEX tgis_map_layer_has_tagent1_idx ON tgis_map_layer_has_tagente(tagente_id_agente);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tgroup_stat
|
||||
-- Table `tgroup_stat`
|
||||
-- ---------------------------------------------------------------------
|
||||
--Table to storelobal system stats perroup
|
||||
CREATE TABLE tgroup_stat (
|
||||
|
@ -1612,8 +1699,10 @@ CREATE TABLE tgroup_stat (
|
|||
utimestamp NUMBER(10, 0) DEFAULT 0
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table tnetwork_map
|
||||
-- Table `tnetwork_map`
|
||||
------------------------------------------------------------------------
|
||||
CREATE TABLE tnetwork_map (
|
||||
id_networkmap NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1650,11 +1739,10 @@ CREATE TABLE tnetwork_map (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tnetwork_map_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tnetwork_map_inc BEFORE INSERT ON tnetwork_map REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetwork_map_s.nextval INTO :NEW.id_networkmap FROM dual; END tnetwork_map_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tsnmp_filter
|
||||
-- Table `tsnmp_filter`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tsnmp_filter (
|
||||
id_snmp_filter NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1663,11 +1751,10 @@ CREATE TABLE tsnmp_filter (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tsnmp_filter_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tsnmp_filter_inc BEFORE INSERT ON tsnmp_filter REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tsnmp_filter_s.nextval INTO :NEW.id_snmp_filter FROM dual; END tsnmp_filter_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tagent_custom_fields
|
||||
-- Table `tagent_custom_fields`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tagent_custom_fields (
|
||||
id_field NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1676,11 +1763,10 @@ CREATE TABLE tagent_custom_fields (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE tagent_custom_fields_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER tagent_custom_fields_inc BEFORE INSERT ON tagent_custom_fields REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tagent_custom_fields_s.nextval INTO :NEW.id_field FROM dual; END tagent_custom_fields_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tagent_custom_data
|
||||
-- Table `tagent_custom_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tagent_custom_data (
|
||||
id_field NUMBER(10, 0) REFERENCES tagent_custom_fields(id_field) ON DELETE CASCADE,
|
||||
|
@ -1689,6 +1775,8 @@ CREATE TABLE tagent_custom_data (
|
|||
PRIMARY KEY (id_field, id_agent)
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- on update trigger
|
||||
CREATE OR REPLACE TRIGGER tagent_custom_data_update AFTER UPDATE OF id_field on tagent_custom_fields FOR EACH ROW BEGIN UPDATE tagent_custom_data SET id_field = :NEW.id_field WHERE id_field = :OLD.id_field; END;;
|
||||
|
||||
|
@ -1696,7 +1784,7 @@ CREATE OR REPLACE TRIGGER tagent_custom_data_update AFTER UPDATE OF id_field on
|
|||
CREATE OR REPLACE TRIGGER tagent_custom_data_update1 AFTER UPDATE OF id_agente on tagente FOR EACH ROW BEGIN UPDATE tagent_custom_data SET id_agent = :NEW.id_agente WHERE id_agent = :OLD.id_agente; END;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table ttag
|
||||
-- Table `ttag`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE ttag (
|
||||
id_tag NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1708,38 +1796,36 @@ CREATE TABLE ttag (
|
|||
);
|
||||
|
||||
CREATE SEQUENCE ttag_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
CREATE OR REPLACE TRIGGER ttag_inc BEFORE INSERT ON ttag REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT ttag_s.nextval INTO :NEW.id_tag FROM dual; END ttag_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table ttag_module
|
||||
-- Table `ttag_module`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE ttag_module (
|
||||
id_tag NUMBER(10, 0),
|
||||
id_agente_modulo NUMBER(10, 0) DEFAULT 0,
|
||||
id_policy_module NUMBER(10, 0) DEFAULT 0,
|
||||
PRIMARY KEY (id_tag, id_agente_modulo)
|
||||
);
|
||||
|
||||
CREATE INDEX ttag_module_id_ag_modulo_idx ON ttag_module(id_agente_modulo);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table ttag_policy_module
|
||||
-- ---------------------------------------------------------------------
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `ttag_policy_module`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE ttag_policy_module (
|
||||
id_tag NUMBER(10, 0),
|
||||
id_policy_module NUMBER(10, 0) DEFAULT 0,
|
||||
PRIMARY KEY (id_tag, id_policy_module)
|
||||
);
|
||||
|
||||
);
|
||||
CREATE INDEX ttag_poli_mod_id_pol_mo_idx ON ttag_policy_module(id_policy_module);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tnetflow_filter
|
||||
-- -----------------------------------------------------
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetflow_filter`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE tnetflow_filter (
|
||||
id_sg NUMBER(10, 0) PRIMARY KEY,
|
||||
id_name VARCHAR2(600),
|
||||
|
@ -1758,9 +1844,8 @@ CREATE SEQUENCE tnetflow_filter_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER tnetflow_filter_inc BEFORE INSERT ON tnetflow_filter REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetflow_filter_s.nextval INTO :NEW.id_sg FROM dual; END tnetflow_filter_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tnetflow_report
|
||||
-- Table `tnetflow_report`
|
||||
-- -----------------------------------------------------
|
||||
|
||||
CREATE TABLE tnetflow_report (
|
||||
id_report NUMBER(10, 0) PRIMARY KEY,
|
||||
id_name VARCHAR2(100),
|
||||
|
@ -1773,9 +1858,8 @@ CREATE SEQUENCE tnetflow_report_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER tnetflow_report_inc BEFORE INSERT ON tnetflow_report REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetflow_report_s.nextval INTO :NEW.id_report FROM dual; END tnetflow_report_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table tnetflow_report_content
|
||||
-- Table `tnetflow_report_content`
|
||||
-- -----------------------------------------------------
|
||||
|
||||
CREATE TABLE tnetflow_report_content (
|
||||
id_rc NUMBER(10, 0) PRIMARY KEY,
|
||||
id_report NUMBER(10, 0) REFERENCES tnetflow_report(id_report) ON DELETE CASCADE,
|
||||
|
@ -1850,7 +1934,7 @@ CREATE SEQUENCE tevent_response_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER tevent_response_inc BEFORE INSERT ON tevent_response REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tevent_response_s.nextval INTO :NEW.id FROM dual; END tevent_response_inc;;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tcategory
|
||||
-- Table `tcategory`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tcategory (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1868,6 +1952,8 @@ CREATE TABLE tupdate_settings (
|
|||
value VARCHAR2(255) DEFAULT ''
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tupdate_package`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1916,9 +2002,8 @@ CREATE SEQUENCE tupdate_journal_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER tupdate_journal_inc BEFORE INSERT ON tupdate_journal REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tupdate_journal_s.nextval INTO :NEW.id FROM dual; END;;
|
||||
CREATE OR REPLACE TRIGGER tupdate_journal_update AFTER UPDATE OF id on tupdate FOR EACH ROW BEGIN UPDATE tupdate_journal SET id = :NEW.id WHERE id = :OLD.id; END;;
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table talert_snmp_action
|
||||
-- Table `talert_snmp_action`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE talert_snmp_action (
|
||||
id NUMBER(10, 0) PRIMARY KEY,
|
||||
|
@ -1936,11 +2021,15 @@ CREATE TABLE talert_snmp_action (
|
|||
al_field10 CLOB DEFAULT ''
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tsessions_php
|
||||
-- Table `tsessions_php`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tsessions_php (
|
||||
id_session VARCHAR2(52) PRIMARY KEY,
|
||||
last_active NUMBER(20, 0),
|
||||
data CLOB DEFAULT ''
|
||||
);
|
||||
|
||||
-- This sequence will not work with the 'insert_id' procedure
|
||||
|
|
Loading…
Reference in New Issue