2011-03-07 18:05:32 +01:00
-- Pandora FMS - the Flexible Monitoring System
-- ============================================
-- Copyright (c) 2005-2011 Artica Soluciones Tecnológicas, http://www.artica.es
-- Please see http://pandora.sourceforge.net for full contribution list
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation for version 2.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-- PLEASE NO NOT USE MULTILINE COMMENTS
-- Because Pandora Installer don't understand them
-- and fails creating database !!!
-- -----------------------------------------------------------
-- Pandora FMS official tables for 4.0 version --
-- -----------------------------------------------------------
-- Pandora schema creation script
2011-03-24 17:51:49 +01:00
-- Triggers must end with two semicolons because Pandora installer need it
2011-03-07 18:05:32 +01:00
2011-04-19 18:30:53 +02:00
CREATE OR REPLACE FUNCTION UNIX_TIMESTAMP ( oracletime IN DATE DEFAULT SYSDATE ) RETURN INTEGER AS unixtime INTEGER ; BEGIN unixtime : = ( oracletime - to_date ( ' 19700101 ' , ' YYYYMMDD ' ) ) * 86400 ; RETURN unixtime ; END ; ;
CREATE OR REPLACE FUNCTION NOW RETURN TIMESTAMP AS t_now TIMESTAMP ; BEGIN SELECT LOCALTIMESTAMP INTO t_now FROM dual ; RETURN t_now ; END ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE taddress (
id_a NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
ip VARCHAR ( 60 ) default ' ' ,
2011-03-07 18:05:32 +01:00
ip_pack NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX taddress_ip_idx ON taddress ( ip ) ;
CREATE SEQUENCE taddress_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
-- 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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE taddress_agent (
id_ag NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
id_a NUMBER ( 19 , 0 ) default 0 NOT NULL ,
id_agent NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE taddress_agent_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tagente (
id_agente NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
nombre VARCHAR2 ( 600 ) default ' ' ,
2011-03-07 18:05:32 +01:00
direccion VARCHAR2 ( 100 ) default NULL ,
comentarios VARCHAR2 ( 255 ) default ' ' ,
id_grupo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-31 15:46:34 +02:00
ultimo_contacto TIMESTAMP default NULL ,
2011-03-07 18:05:32 +01:00
modo NUMBER ( 5 , 0 ) default 0 NOT NULL ,
intervalo NUMBER ( 10 , 0 ) default 300 NOT NULL ,
id_os NUMBER ( 10 , 0 ) default 0 ,
os_version VARCHAR2 ( 100 ) default ' ' ,
agent_version VARCHAR2 ( 100 ) default ' ' ,
2011-03-31 15:46:34 +02:00
ultimo_contacto_remoto TIMESTAMP default NULL ,
2011-03-07 18:05:32 +01:00
disabled NUMBER ( 5 , 0 ) default 0 NOT NULL ,
id_parent NUMBER ( 10 , 0 ) default 0 ,
custom_id VARCHAR2 ( 255 ) default ' ' ,
server_name VARCHAR2 ( 100 ) default ' ' ,
cascade_protection NUMBER ( 5 , 0 ) default 0 NOT NULL ,
- - number of hours of diference with the server timezone
timezone_offset NUMBER ( 5 , 0 ) DEFAULT 0 NULL ,
- - path in the server to the image of the icon representing the agent
icon_path VARCHAR2 ( 127 ) DEFAULT NULL NULL ,
- - set it to one to update the position data ( altitude , longitude , latitude ) when getting information from the agent or to 0 to keep the last value and don \ ' t update it
2012-01-23 19:36:22 +01:00
update_gis_data NUMBER ( 5 , 0 ) DEFAULT 1 NOT NULL ,
url_address CLOB DEFAULT ' ' NULL
2011-03-07 18:05:32 +01:00
) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tagente_datos (
id_agente_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
datos BINARY_DOUBLE default NULL ,
utimestamp NUMBER ( 10 , 0 ) default 0
) ;
CREATE INDEX tagente_datos_id_agent_mod_idx ON tagente_datos ( id_agente_modulo ) ;
CREATE INDEX tagente_datos_utimestamp_idx ON tagente_datos ( utimestamp ) ;
CREATE TABLE tagente_datos_inc (
id_adi NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_agente_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
datos BINARY_DOUBLE default NULL ,
utimestamp NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tagente_datos_string (
2011-05-16 14:07:30 +02:00
id_agente_modulo NUMBER ( 10 , 0 ) NOT NULL ,
2011-04-11 19:05:20 +02:00
datos CLOB NOT NULL ,
2011-03-07 18:05:32 +01:00
utimestamp NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX tagente_datos_string_utsta_idx ON tagente_datos_string ( utimestamp ) ;
CREATE TABLE tagente_datos_log4x (
id_tagente_datos_log4x NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
id_agente_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
severity CLOB NOT NULL ,
message CLOB NOT NULL ,
stacktrace CLOB NOT NULL ,
2011-03-07 18:05:32 +01:00
utimestamp NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tagente_estado (
id_agente_estado NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_agente_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
datos CLOB default ' ' ,
2011-03-31 15:46:34 +02:00
timestamp TIMESTAMP default NULL ,
2011-03-07 18:05:32 +01:00
estado NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_agente NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-31 15:46:34 +02:00
last_try TIMESTAMP default NULL ,
2011-03-07 18:05:32 +01:00
utimestamp NUMBER ( 19 , 0 ) default 0 NOT NULL ,
current_interval NUMBER ( 10 , 0 ) default 0 NOT NULL ,
running_by NUMBER ( 10 , 0 ) default 0 ,
last_execution_try NUMBER ( 19 , 0 ) default 0 NOT NULL ,
status_changes NUMBER ( 10 , 0 ) default 0 ,
last_status NUMBER ( 10 , 0 ) default 0
) ;
CREATE INDEX tagente_estado_id_agente_idx ON tagente_estado ( id_agente ) ;
CREATE INDEX tagente_estado_estado_idx ON tagente_estado ( estado ) ;
CREATE INDEX tagente_estado_curr_inter_idx ON tagente_estado ( current_interval ) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
-- Probably last_execution_try index is not useful and loads more than benefits
-- id_modulo now uses tmodule
-- ---------------------------
-- 1 - Data server modules (agent related modules)
-- 2 - Network server modules
-- 4 - Plugin server
-- 5 - Predictive server
-- 6 - WMI server
-- 7 - WEB Server (enteprise)
CREATE TABLE tagente_modulo (
id_agente_modulo NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_agente NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_tipo_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
descripcion CLOB default ' ' ,
2011-08-10 18:51:42 +02:00
extended_info CLOB default ' ' ,
2011-04-19 18:30:53 +02:00
nombre CLOB default ' ' ,
2011-05-25 11:57:05 +02:00
unit VARCHAR2 ( 100 ) DEFAULT ' ' ,
2011-03-07 18:05:32 +01:00
id_policy_module NUMBER ( 10 , 0 ) default 0 NOT NULL ,
max NUMBER ( 19 , 0 ) default 0 NOT NULL ,
min NUMBER ( 19 , 0 ) default 0 NOT NULL ,
module_interval NUMBER ( 10 , 0 ) default 0 NOT NULL ,
tcp_port NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
tcp_send CLOB default ' ' ,
tcp_rcv CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
snmp_community VARCHAR2 ( 100 ) default ' ' ,
snmp_oid VARCHAR2 ( 255 ) default ' 0 ' ,
ip_target VARCHAR2 ( 100 ) default ' ' ,
id_module_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
flag NUMBER ( 5 , 0 ) default 1 NOT NULL ,
id_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
disabled NUMBER ( 5 , 0 ) default 0 NOT NULL ,
id_export NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
plugin_user CLOB default ' ' ,
plugin_pass CLOB default ' ' ,
plugin_parameter CLOB ,
2011-03-07 18:05:32 +01:00
id_plugin NUMBER ( 10 , 0 ) default 0 ,
post_process BINARY_DOUBLE default NULL ,
prediction_module NUMBER ( 19 , 0 ) default 0 ,
max_timeout NUMBER ( 10 , 0 ) default 0 ,
custom_id VARCHAR2 ( 255 ) default ' ' ,
history_data NUMBER ( 5 , 0 ) default 1 ,
min_warning BINARY_DOUBLE default 0 ,
max_warning BINARY_DOUBLE default 0 ,
2011-07-07 Ramon Novoa <rnovoa@artica.es>
* include/functions_network_components.php,
include/functions_api.php,
include/functions_ui.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
pandoradb.oracle.sql,
extensions/resource_registration.php,
extensions/plugin_registration.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php,
extras/pandoradb_migrate_v3.2_to_v4.0.sql,
godmode/agentes/module_manager_editor_common.php,
godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/massive/massive_edit_modules.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components.php: Added support for
warning/critical status regexp (works with both numeric and string
data types).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4524 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-07-07 13:12:15 +02:00
str_warning CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
min_critical BINARY_DOUBLE default 0 ,
max_critical BINARY_DOUBLE default 0 ,
2011-07-07 Ramon Novoa <rnovoa@artica.es>
* include/functions_network_components.php,
include/functions_api.php,
include/functions_ui.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
pandoradb.oracle.sql,
extensions/resource_registration.php,
extensions/plugin_registration.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php,
extras/pandoradb_migrate_v3.2_to_v4.0.sql,
godmode/agentes/module_manager_editor_common.php,
godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/massive/massive_edit_modules.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components.php: Added support for
warning/critical status regexp (works with both numeric and string
data types).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4524 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-07-07 13:12:15 +02:00
str_critical CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
min_ff_event INTEGER default 0 ,
delete_pending NUMBER ( 5 , 0 ) default 0 NOT NULL ,
policy_linked NUMBER ( 5 , 0 ) default 0 NOT NULL ,
policy_adopted NUMBER ( 5 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
custom_string_1 CLOB default ' ' ,
custom_string_2 CLOB default ' ' ,
custom_string_3 CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
custom_integer_1 NUMBER ( 10 , 0 ) default 0 ,
custom_integer_2 NUMBER ( 10 , 0 ) default 0
) ;
CREATE INDEX tagente_modulo_id_agente_idx ON tagente_modulo ( id_agente ) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
-- snmp_oid is also used for WMI query
CREATE TABLE tagent_access (
id_agent NUMBER ( 10 , 0 ) default 0 NOT NULL ,
utimestamp NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX tagent_access_id_agent_idx ON tagent_access ( id_agent ) ;
CREATE INDEX tagent_access_utimestamp_idx ON tagent_access ( utimestamp ) ;
CREATE TABLE talert_snmp (
id_as NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_alert NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
al_field1 CLOB default ' ' ,
al_field2 CLOB default ' ' ,
al_field3 CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
description VARCHAR2 ( 255 ) default ' ' ,
alert_type NUMBER ( 5 , 0 ) default 0 NOT NULL ,
agent VARCHAR2 ( 100 ) default ' ' ,
2011-08-17 22:14:56 +02:00
custom_oid CLOB default ' ' ,
2011-04-19 18:30:53 +02:00
oid VARCHAR2 ( 255 ) default ' ' ,
2011-03-07 18:05:32 +01:00
time_threshold NUMBER ( 10 , 0 ) default 0 NOT NULL ,
times_fired NUMBER ( 5 , 0 ) default 0 NOT NULL ,
2011-03-31 15:46:34 +02:00
last_fired TIMESTAMP default NULL ,
2011-03-07 18:05:32 +01:00
max_alerts NUMBER ( 10 , 0 ) default 1 NOT NULL ,
min_alerts NUMBER ( 10 , 0 ) default 1 NOT NULL ,
internal_counter NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2012-02-02 13:00:30 +01:00
priority NUMBER ( 10 , 0 ) default 0 ,
_snmp_f1_ CLOB default ' ' ,
_snmp_f2_ CLOB default ' ' ,
_snmp_f3_ CLOB default ' ' ,
_snmp_f4_ CLOB default ' ' ,
_snmp_f5_ CLOB default ' ' ,
_snmp_f6_ CLOB default ' ' ,
trap_type NUMBER ( 10 , 0 ) DEFAULT - 1 NOT NULL ,
single_value VARCHAR2 ( 255 ) DEFAULT ' '
2011-03-07 18:05:32 +01:00
) ;
CREATE SEQUENCE talert_snmp_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_commands (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
2011-04-11 19:05:20 +02:00
command CLOB default ' ' ,
description CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
internal NUMBER ( 10 , 0 ) default 0
) ;
CREATE SEQUENCE talert_commands_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_actions (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-11 19:05:20 +02:00
name CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
id_alert_command NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_commands ( id ) ON DELETE CASCADE ,
2011-04-19 18:30:53 +02:00
field1 CLOB default ' ' ,
2011-04-11 19:05:20 +02:00
field2 CLOB default ' ' ,
field3 CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
id_group NUMBER ( 19 , 0 ) default 0 NOT NULL ,
action_threshold NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE talert_actions_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
2011-03-24 17:51:49 +01:00
-- 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
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_templates (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-11 19:05:20 +02:00
name CLOB default ' ' ,
description CLOB ,
2011-03-07 18:05:32 +01:00
id_alert_action NUMBER ( 10 , 0 ) REFERENCES talert_actions ( id ) ON DELETE SET NULL ,
2011-04-11 19:05:20 +02:00
field1 CLOB default ' ' ,
field2 CLOB default ' ' ,
field3 CLOB NOT NULL ,
2011-03-07 18:05:32 +01:00
type VARCHAR2 ( 50 ) ,
value VARCHAR2 ( 255 ) default ' ' ,
matches_value NUMBER ( 5 , 0 ) default 0 ,
2011-05-18 12:25:03 +02:00
max_value DOUBLE PRECISION default NULL ,
2011-03-07 18:05:32 +01:00
min_value DOUBLE PRECISION default NULL ,
time_threshold NUMBER ( 10 , 0 ) default 0 NOT NULL ,
max_alerts NUMBER ( 10 , 0 ) default 1 NOT NULL ,
min_alerts NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-24 17:51:49 +01:00
time_from TIMESTAMP default to_date ( ' 00:00:00 ' , ' hh24:mi:ss ' ) ,
time_to TIMESTAMP default to_date ( ' 00:00:00 ' , ' hh24:mi:ss ' ) ,
2011-03-07 18:05:32 +01:00
monday NUMBER ( 5 , 0 ) default 1 ,
tuesday NUMBER ( 5 , 0 ) default 1 ,
wednesday NUMBER ( 5 , 0 ) default 1 ,
thursday NUMBER ( 5 , 0 ) default 1 ,
friday NUMBER ( 5 , 0 ) default 1 ,
saturday NUMBER ( 5 , 0 ) default 1 ,
sunday NUMBER ( 5 , 0 ) default 1 ,
recovery_notify NUMBER ( 5 , 0 ) default 0 ,
2011-04-19 18:30:53 +02:00
field2_recovery CLOB default ' ' ,
2011-04-11 19:05:20 +02:00
field3_recovery CLOB NOT NULL ,
2011-03-07 18:05:32 +01:00
priority NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
special_day NUMBER ( 5 , 0 ) default 0 ,
2011-07-08 11:56:18 +02:00
CONSTRAINT t_alert_templates_type_cons CHECK ( type IN ( ' regex ' , ' max_min ' , ' max ' , ' min ' , ' equal ' , ' not_equal ' , ' warning ' , ' critical ' , ' onchange ' , ' unknown ' , ' always ' ) )
2011-03-07 18:05:32 +01:00
) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_template_modules (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_agent_module NUMBER ( 10 , 0 ) NOT NULL REFERENCES tagente_modulo ( id_agente_modulo ) ON DELETE CASCADE ,
id_alert_template NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_templates ( id ) ON DELETE CASCADE ,
id_policy_alerts NUMBER ( 10 , 0 ) default 0 NOT NULL ,
internal_counter NUMBER ( 10 , 0 ) default 0 ,
last_fired NUMBER ( 19 , 0 ) default 0 NOT NULL ,
last_reference NUMBER ( 19 , 0 ) default 0 NOT NULL ,
times_fired NUMBER ( 10 , 0 ) default 0 NOT NULL ,
disabled NUMBER ( 5 , 0 ) default 0 ,
standby NUMBER ( 5 , 0 ) default 0 ,
priority NUMBER ( 10 , 0 ) default 0 ,
force_execution NUMBER ( 5 , 0 ) default 0
) ;
CREATE UNIQUE INDEX talert_template_modules_idx ON talert_template_modules ( id_agent_module ) ;
CREATE SEQUENCE talert_template_modules_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_template_modules_inc BEFORE INSERT ON talert_template_modules REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_template_modules_s . nextval INTO : NEW . ID FROM dual ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_template_modules_update AFTER UPDATE OF ID_AGENTE_MODULO ON tagente_modulo FOR EACH ROW BEGIN UPDATE talert_template_modules SET ID_AGENT_MODULE = : NEW . ID_AGENTE_MODULO WHERE ID_AGENT_MODULE = : OLD . ID_AGENTE_MODULO ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger 1
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_template_module_actions (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_alert_template_module NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_template_modules ( id ) ON DELETE CASCADE ,
id_alert_action NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_actions ( id ) ON DELETE CASCADE ,
fires_min NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-08-17 13:25:46 +02:00
fires_max NUMBER ( 10 , 0 ) default 0 NOT NULL ,
module_action_threshold NUMBER ( 10 , 0 ) default 0 NOT NULL ,
last_execution NUMBER ( 18 , 0 ) default 0 NOT NULL
2011-03-07 18:05:32 +01:00
) ;
CREATE SEQUENCE talert_template_modu_actions_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_template_mod_act_update AFTER UPDATE OF ID ON talert_template_modules FOR EACH ROW BEGIN UPDATE talert_template_module_actions SET ID_ALERT_TEMPLATE_MODULE = : NEW . ID WHERE ID_ALERT_TEMPLATE_MODULE = : OLD . ID ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger 1
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
2011-03-24 17:51:49 +01:00
-- 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
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_compound (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
name VARCHAR2 ( 255 ) default ' ' ,
2011-04-11 19:05:20 +02:00
description CLOB ,
2011-03-07 18:05:32 +01:00
id_agent NUMBER ( 10 , 0 ) NOT NULL REFERENCES tagente ( id_agente ) ON DELETE CASCADE ,
time_threshold NUMBER ( 10 , 0 ) default 0 NOT NULL ,
max_alerts NUMBER ( 10 , 0 ) default 1 NOT NULL ,
min_alerts NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-24 17:51:49 +01:00
time_from TIMESTAMP default to_date ( ' 00:00:00 ' , ' hh24:mi:ss ' ) ,
time_to TIMESTAMP default to_date ( ' 00:00:00 ' , ' hh24:mi:ss ' ) ,
2011-03-07 18:05:32 +01:00
monday NUMBER ( 5 , 0 ) default 1 ,
tuesday NUMBER ( 5 , 0 ) default 1 ,
wednesday NUMBER ( 5 , 0 ) default 1 ,
thursday NUMBER ( 5 , 0 ) default 1 ,
friday NUMBER ( 5 , 0 ) default 1 ,
saturday NUMBER ( 5 , 0 ) default 1 ,
sunday NUMBER ( 5 , 0 ) default 1 ,
recovery_notify NUMBER ( 5 , 0 ) default 0 ,
2011-04-19 18:30:53 +02:00
field2_recovery VARCHAR2 ( 255 ) default ' ' ,
2011-04-11 19:05:20 +02:00
field3_recovery CLOB NOT NULL ,
2011-03-07 18:05:32 +01:00
internal_counter NUMBER ( 10 , 0 ) default 0 ,
last_fired NUMBER ( 19 , 0 ) default 0 NOT NULL ,
last_reference NUMBER ( 19 , 0 ) default 0 NOT NULL ,
times_fired NUMBER ( 10 , 0 ) default 0 NOT NULL ,
disabled NUMBER ( 5 , 0 ) default 0 ,
priority NUMBER ( 5 , 0 ) default 0
) ;
CREATE SEQUENCE talert_compound_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_inc BEFORE INSERT ON talert_compound REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_compound_s . nextval INTO : NEW . ID FROM dual ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_update AFTER UPDATE OF ID_AGENTE ON tagente FOR EACH ROW BEGIN UPDATE talert_compound SET ID_AGENT = : NEW . ID_AGENTE WHERE ID_AGENT = : OLD . ID_AGENTE ; END ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_compound_elements (
id_alert_compound NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_compound ( id ) ON DELETE CASCADE ,
id_alert_template_module NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_template_modules ( id ) ON DELETE CASCADE ,
operation VARCHAR2 ( 10 ) ,
" order " NUMBER ( 5 , 0 ) default 0 ,
CONSTRAINT talert_compound_elements_cons CHECK ( operation IN ( ' NOP ' , ' AND ' , ' OR ' , ' XOR ' , ' NAND ' , ' NOR ' , ' NXOR ' ) )
) ;
CREATE UNIQUE INDEX talert_compound_elements_idx ON talert_compound_elements ( id_alert_compound ) ;
-- on update trigger
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_elem_update AFTER UPDATE OF ID ON talert_compound FOR EACH ROW BEGIN UPDATE talert_compound_elements SET ID_ALERT_COMPOUND = : NEW . ID WHERE ID_ALERT_COMPOUND = : OLD . ID ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger 1
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_elem_update1 AFTER UPDATE OF ID ON talert_template_modules FOR EACH ROW BEGIN UPDATE talert_compound_elements SET ID_ALERT_TEMPLATE_MODULE = : NEW . ID WHERE ID_ALERT_TEMPLATE_MODULE = : OLD . ID ; END ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE talert_compound_actions (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_alert_compound NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_compound ( id ) ON DELETE CASCADE ,
id_alert_action NUMBER ( 10 , 0 ) NOT NULL REFERENCES talert_actions ( id ) ON DELETE CASCADE ,
fires_min NUMBER ( 10 , 0 ) default 0 ,
fires_max NUMBER ( 10 , 0 ) default 0
) ;
CREATE SEQUENCE talert_compound_actions_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_actions_inc BEFORE INSERT ON talert_compound_actions REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_compound_actions_s . nextval INTO : NEW . ID FROM dual ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_actions_update AFTER UPDATE OF ID ON talert_compound FOR EACH ROW BEGIN UPDATE talert_compound_actions SET ID_ALERT_COMPOUND = : NEW . ID WHERE ID_ALERT_COMPOUND = : OLD . ID ; END ; ;
2011-03-07 18:05:32 +01:00
-- on update trigger 1
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER talert_compound_action_update1 AFTER UPDATE OF ID ON talert_actions FOR EACH ROW BEGIN UPDATE talert_compound_actions SET ID_ALERT_ACTION = : NEW . ID WHERE ID_ALERT_ACTION = : OLD . ID ; END ; ;
2011-03-07 18:05:32 +01:00
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
CREATE TABLE talert_special_days (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
date DATE default ' 0000-00-00 ' NOT NULL ,
same_day VARCHAR2 ( 20 ) default ' sunday ' ,
description CLOB ,
CONSTRAINT talert_special_days_same_day_cons CHECK ( same_day IN ( ' monday ' , ' tuesday ' , ' wednesday ' , ' thursday ' , ' friday ' , ' saturday ' , ' sunday ' ) )
) ;
-- on update trigger
CREATE SEQUENCE talert_special_days_s INCREMENT BY 1 START WITH 1 ;
CREATE OR REPLACE TRIGGER talert_special_days_inc BEFORE INSERT ON talert_special_days REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_special_days_s . nextval INTO : NEW . ID FROM dual ; END talert_special_days_inc ; ;
2011-03-07 18:05:32 +01:00
-- Priority : 0 - Maintance (grey)
-- Priority : 1 - Low (green)
-- Priority : 2 - Normal (blue)
-- Priority : 3 - Warning (yellow)
-- Priority : 4 - Critical (red)
CREATE TABLE tattachment (
id_attachment NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_incidencia NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
id_usuario VARCHAR2 ( 60 ) default ' ' ,
filename VARCHAR2 ( 255 ) default ' ' ,
2011-03-07 18:05:32 +01:00
description VARCHAR2 ( 150 ) default ' ' ,
" size " NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tattachment_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER tattachment_inc BEFORE INSERT ON tattachment REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tattachment_s . nextval INTO : NEW . ID_ATTACHMENT FROM dual ; END ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tconfig (
id_config NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2012-02-10 11:38:41 +01:00
token VARCHAR2 ( 100 ) default ' ' ,
value VARCHAR2 ( 255 ) default ' '
2011-03-07 18:05:32 +01:00
) ;
CREATE SEQUENCE tconfig_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tconfig_os (
id_os NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
2011-03-07 18:05:32 +01:00
description VARCHAR2 ( 250 ) default ' ' ,
icon_name VARCHAR2 ( 100 ) default ' '
) ;
2011-03-24 17:51:49 +01:00
-- use to_char(timestamp, 'hh24:mi:ss') function to retrieve timestamp field info
2011-03-07 18:05:32 +01:00
CREATE TABLE tevento (
id_evento NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
id_agente NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_usuario VARCHAR2 ( 100 ) default ' 0 ' NOT NULL ,
id_grupo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
estado NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-24 17:51:49 +01:00
timestamp TIMESTAMP default NULL ,
2011-04-19 18:30:53 +02:00
evento CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
utimestamp NUMBER ( 19 , 0 ) default 0 NOT NULL ,
event_type VARCHAR2 ( 50 ) default ' unknown ' ,
id_agentmodule NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_alert_am NUMBER ( 10 , 0 ) default 0 NOT NULL ,
criticity NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
user_comment CLOB ,
2011-08-16 18:32:20 +02:00
tags CLOB ,
2012-02-01 12:04:41 +01:00
source VARCHAR2 ( 100 ) default ' ' NOT NULL ,
id_extra VARCHAR2 ( 100 ) default ' ' NOT NULL ,
2011-06-10 14:38:59 +02:00
CONSTRAINT tevento_event_type_cons CHECK ( event_type IN ( ' unknown ' , ' alert_fired ' , ' alert_recovered ' , ' alert_ceased ' , ' alert_manual_validation ' , ' recon_host_detected ' , ' system ' , ' error ' , ' new_agent ' , ' going_up_warning ' , ' going_up_critical ' , ' going_down_warning ' , ' going_down_normal ' , ' going_down_critical ' , ' going_up_normal ' , ' configuration_change ' ) )
2011-03-07 18:05:32 +01:00
) ;
CREATE INDEX tevento_id_1_idx ON tevento ( id_agente , id_evento ) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
-- Criticity: 0 - Maintance (grey)
-- Criticity: 1 - Informational (blue)
-- Criticity: 2 - Normal (green) (status 0)
-- Criticity: 3 - Warning (yellow) (status 2)
-- Criticity: 4 - Critical (red) (status 1)
CREATE TABLE tgrupo (
id_grupo NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
nombre CLOB default ' ' ,
2011-03-07 18:05:32 +01:00
icon VARCHAR2 ( 50 ) default ' world ' ,
parent NUMBER ( 10 , 0 ) default 0 NOT NULL ,
propagate NUMBER ( 5 , 0 ) default 0 ,
disabled NUMBER ( 5 , 0 ) default 0 ,
2011-05-13 13:16:18 +02:00
custom_id VARCHAR2 ( 255 ) default ' ' ,
id_skin NUMBER ( 10 , 0 ) DEFAULT 0 NOT NULL
2011-03-07 18:05:32 +01:00
) ;
CREATE SEQUENCE tgrupo_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tincidencia (
id_incidencia NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
inicio TIMESTAMP default NULL ,
cierre TIMESTAMP default NULL ,
2011-04-19 18:30:53 +02:00
titulo CLOB default ' ' ,
2011-04-11 19:05:20 +02:00
descripcion CLOB NOT NULL ,
2011-04-19 18:30:53 +02:00
id_usuario VARCHAR2 ( 60 ) default ' ' ,
origen VARCHAR2 ( 100 ) default ' ' ,
2011-03-07 18:05:32 +01:00
estado NUMBER ( 10 , 0 ) default 0 NOT NULL ,
prioridad NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_grupo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
actualizacion TIMESTAMP default CURRENT_TIMESTAMP ,
id_creator VARCHAR2 ( 60 ) default NULL ,
id_lastupdate VARCHAR2 ( 60 ) default NULL ,
id_agente_modulo NUMBER ( 19 , 0 ) NOT NULL ,
2012-01-23 18:01:00 +01:00
notify_email NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_agent NUMBER ( 19 , 0 ) default 0 NULL
2011-03-07 18:05:32 +01:00
) ;
CREATE INDEX tincidencia_id_1_idx ON tincidencia ( id_usuario , id_incidencia ) ;
CREATE INDEX tincidencia_id_agente_mod_idx ON tincidencia ( id_agente_modulo ) ;
- - This trigger is for tranlate " on update CURRENT_TIMESTAMP " of MySQL .
2011-03-24 17:51:49 +01:00
CREATE OR REPLACE TRIGGER tincidencia_actualizacion_ts BEFORE UPDATE ON tincidencia FOR EACH ROW BEGIN select CURRENT_TIMESTAMP into : NEW . ACTUALIZACION from dual ; END ; ;
2011-03-07 18:05:32 +01:00
CREATE SEQUENCE tincidencia_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tlanguage (
2011-04-19 18:30:53 +02:00
id_language VARCHAR2 ( 6 ) default ' ' ,
name VARCHAR2 ( 100 ) default ' '
2011-03-07 18:05:32 +01:00
) ;
CREATE TABLE tlink (
id_link NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
link VARCHAR2 ( 255 ) default ' '
2011-03-07 18:05:32 +01:00
) ;
CREATE SEQUENCE tlink_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
CREATE TABLE tmensajes (
id_mensaje NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
id_usuario_origen VARCHAR2 ( 60 ) default ' ' ,
id_usuario_destino VARCHAR2 ( 60 ) default ' ' ,
2011-04-11 19:05:20 +02:00
mensaje CLOB NOT NULL ,
2011-03-07 18:05:32 +01:00
timestamp NUMBER ( 19 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
subject VARCHAR2 ( 255 ) default ' ' ,
2011-03-07 18:05:32 +01:00
estado NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tmensajes_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-07 18:05:32 +01:00
2011-03-18 14:23:12 +01:00
CREATE TABLE tmodule_group (
id_mg NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 150 ) default ' '
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tmodule_group_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tnetwork_component (
id_nc NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
name VARCHAR2 ( 80 ) NOT NULL ,
2011-04-11 19:05:20 +02:00
description VARCHAR2 ( 300 ) default NULL ,
2011-03-18 14:23:12 +01:00
id_group NUMBER ( 10 , 0 ) default 1 NOT NULL ,
type NUMBER ( 10 , 0 ) default 6 NOT NULL ,
max NUMBER ( 10 , 0 ) default 0 NOT NULL ,
min NUMBER ( 19 , 0 ) default 0 NOT NULL ,
module_interval NUMBER ( 19 , 0 ) default 0 NOT NULL ,
2012-02-03 13:33:45 +01:00
module_ff_interval NUMBER ( 19 , 0 ) default 0 NOT NULL ,
2011-03-18 14:23:12 +01:00
tcp_port NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
tcp_send CLOB NOT NULL ,
tcp_rcv CLOB NOT NULL ,
2011-03-18 14:23:12 +01:00
snmp_community VARCHAR2 ( 255 ) default ' NULL ' NOT NULL ,
snmp_oid VARCHAR2 ( 400 ) NOT NULL ,
id_module_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_modulo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_plugin NUMBER ( 10 , 0 ) default 0 ,
2011-04-11 19:05:20 +02:00
plugin_user CLOB default ' ' ,
plugin_pass CLOB default ' ' ,
plugin_parameter CLOB ,
2011-03-18 14:23:12 +01:00
max_timeout NUMBER ( 10 , 0 ) default 0 ,
history_data NUMBER ( 5 , 0 ) default 1 ,
min_warning BINARY_DOUBLE default 0 ,
max_warning BINARY_DOUBLE default 0 ,
2011-07-07 Ramon Novoa <rnovoa@artica.es>
* include/functions_network_components.php,
include/functions_api.php,
include/functions_ui.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
pandoradb.oracle.sql,
extensions/resource_registration.php,
extensions/plugin_registration.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php,
extras/pandoradb_migrate_v3.2_to_v4.0.sql,
godmode/agentes/module_manager_editor_common.php,
godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/massive/massive_edit_modules.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components.php: Added support for
warning/critical status regexp (works with both numeric and string
data types).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4524 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-07-07 13:12:15 +02:00
str_warning CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
min_critical BINARY_DOUBLE default 0 ,
max_critical BINARY_DOUBLE default 0 ,
2011-07-07 Ramon Novoa <rnovoa@artica.es>
* include/functions_network_components.php,
include/functions_api.php,
include/functions_ui.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
pandoradb.oracle.sql,
extensions/resource_registration.php,
extensions/plugin_registration.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php,
extras/pandoradb_migrate_v3.2_to_v4.0.sql,
godmode/agentes/module_manager_editor_common.php,
godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/massive/massive_edit_modules.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components.php: Added support for
warning/critical status regexp (works with both numeric and string
data types).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4524 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-07-07 13:12:15 +02:00
str_critical CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
min_ff_event NUMBER ( 10 , 0 ) default 0 ,
2011-04-11 19:05:20 +02:00
custom_string_1 CLOB default ' ' ,
custom_string_2 CLOB default ' ' ,
custom_string_3 CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
custom_integer_1 INTEGER default 0 ,
custom_integer_2 INTEGER default 0 ,
post_process BINARY_DOUBLE default 0
) ;
CREATE SEQUENCE tnetwork_component_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tnetwork_component_group (
id_sg NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 200 ) default ' ' ,
2011-03-18 14:23:12 +01:00
parent NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE TABLE tnetwork_profile (
id_np NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
description VARCHAR2 ( 250 ) default ' '
) ;
CREATE SEQUENCE tnetwork_profile_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tnetwork_profile_component (
id_nc NUMBER ( 19 , 0 ) default 0 NOT NULL ,
id_np NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX tnetwork_profile_id_np_idx ON tnetwork_profile_component ( id_np ) ;
CREATE TABLE tnota (
id_nota NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
id_incident NUMBER ( 19 , 0 ) NOT NULL ,
id_usuario VARCHAR2 ( 100 ) default ' 0 ' NOT NULL ,
timestamp TIMESTAMP default CURRENT_TIMESTAMP ,
2011-04-11 19:05:20 +02:00
nota CLOB NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE INDEX tnota_id_incident_idx ON tnota ( id_incident ) ;
CREATE TABLE torigen (
2011-04-19 18:30:53 +02:00
origen VARCHAR2 ( 100 ) default ' '
2011-03-18 14:23:12 +01:00
) ;
CREATE TABLE tperfil (
id_perfil NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
incident_edit NUMBER ( 5 , 0 ) default 0 NOT NULL ,
incident_view NUMBER ( 5 , 0 ) default 0 NOT NULL ,
incident_management NUMBER ( 5 , 0 ) default 0 NOT NULL ,
agent_view NUMBER ( 5 , 0 ) default 0 NOT NULL ,
agent_edit NUMBER ( 5 , 0 ) default 0 NOT NULL ,
alert_edit NUMBER ( 5 , 0 ) default 0 NOT NULL ,
user_management NUMBER ( 5 , 0 ) default 0 NOT NULL ,
db_management NUMBER ( 5 , 0 ) default 0 NOT NULL ,
alert_management NUMBER ( 5 , 0 ) default 0 NOT NULL ,
pandora_management NUMBER ( 5 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tperfil_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE trecon_script (
id_recon_script NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
name VARCHAR2 ( 100 ) default ' ' ,
2011-04-11 19:05:20 +02:00
description CLOB default NULL ,
2011-03-18 14:23:12 +01:00
script VARCHAR2 ( 250 ) default ' '
) ;
CREATE SEQUENCE trecon_script_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE trecon_task (
id_rt NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
description VARCHAR2 ( 250 ) default ' ' ,
subnet VARCHAR2 ( 64 ) default ' ' ,
2011-03-18 14:23:12 +01:00
id_network_profile NUMBER ( 10 , 0 ) default 0 NOT NULL ,
create_incident NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_group NUMBER ( 10 , 0 ) default 1 NOT NULL ,
utimestamp NUMBER ( 19 , 0 ) default 0 NOT NULL ,
status NUMBER ( 10 , 0 ) default 0 NOT NULL ,
interval_sweep NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_recon_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_os NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
recon_ports VARCHAR2 ( 250 ) default ' ' ,
2011-03-18 14:23:12 +01:00
snmp_community VARCHAR2 ( 64 ) default ' public ' NOT NULL ,
id_recon_script NUMBER ( 10 , 0 ) ,
2011-04-19 18:30:53 +02:00
field1 VARCHAR2 ( 250 ) default ' ' ,
field2 VARCHAR2 ( 250 ) default ' ' ,
field3 VARCHAR2 ( 250 ) default ' ' ,
2011-07-01 14:41:56 +02:00
field4 VARCHAR2 ( 250 ) default ' ' ,
os_detect NUMBER ( 5 , 0 ) default 1 NOT NULL ,
resolve_names NUMBER ( 5 , 0 ) default 1 NOT NULL ,
parent_detection NUMBER ( 5 , 0 ) default 1 NOT NULL ,
2011-07-07 12:07:19 +02:00
parent_recursion NUMBER ( 5 , 0 ) default 1 NOT NULL ,
disabled NUMBER ( 5 , 0 ) default 1 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tserver (
id_server NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
ip_address VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
status NUMBER ( 10 , 0 ) default 0 NOT NULL ,
laststart TIMESTAMP default NULL ,
keepalive TIMESTAMP default NULL ,
snmp_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
network_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
data_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
master NUMBER ( 10 , 0 ) default 0 NOT NULL ,
checksum NUMBER ( 10 , 0 ) default 0 NOT NULL ,
description VARCHAR2 ( 255 ) default NULL ,
recon_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
version VARCHAR2 ( 20 ) default ' ' ,
2011-03-18 14:23:12 +01:00
plugin_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
prediction_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
wmi_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
export_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
server_type NUMBER ( 10 , 0 ) default 0 NOT NULL ,
queued_modules NUMBER ( 10 , 0 ) default 0 NOT NULL ,
threads NUMBER ( 10 , 0 ) default 0 NOT NULL ,
lag_time NUMBER ( 10 , 0 ) default 0 NOT NULL ,
lag_modules NUMBER ( 10 , 0 ) default 0 NOT NULL ,
total_modules_running NUMBER ( 10 , 0 ) default 0 NOT NULL ,
my_modules NUMBER ( 10 , 0 ) default 0 NOT NULL ,
stat_utimestamp NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX tserver_name_idx ON tserver ( name ) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- server types:
-- 0 data
-- 1 network
-- 2 snmp trap console
-- 3 recon
-- 4 plugin
-- 5 prediction
-- 6 wmi
-- 7 export
-- 8 inventory
-- 9 web
-- TODO: drop 2.x xxxx_server fields, unused since server_type exists.
CREATE TABLE tsesion (
2011-04-19 18:30:53 +02:00
id_sesion NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
id_usuario VARCHAR2 ( 60 ) default ' 0 ' NOT NULL ,
ip_origen VARCHAR2 ( 100 ) default ' ' ,
accion VARCHAR2 ( 100 ) default ' ' ,
descripcion CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
fecha TIMESTAMP default NULL ,
utimestamp NUMBER ( 19 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX tsesion_utimestamp_idx ON tsesion ( utimestamp ) ;
2011-04-19 18:30:53 +02:00
CREATE INDEX tsesion_id_usuario_idx ON tsesion ( id_usuario ) ;
2011-03-18 14:23:12 +01:00
CREATE SEQUENCE tsesion_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE ttipo_modulo (
id_tipo NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
nombre VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
categoria NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
descripcion VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
icon VARCHAR2 ( 100 ) default NULL
) ;
CREATE SEQUENCE ttipo_modulo_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE ttrap (
id_trap NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
source VARCHAR2 ( 50 ) default ' ' ,
oid CLOB default ' ' ,
2011-04-11 19:05:20 +02:00
oid_custom CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
type NUMBER ( 10 , 0 ) default 0 NOT NULL ,
type_custom VARCHAR2 ( 100 ) default ' ' ,
2011-04-11 19:05:20 +02:00
value CLOB default ' ' ,
value_custom CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
alerted NUMBER ( 5 , 0 ) default 0 NOT NULL ,
status NUMBER ( 5 , 0 ) default 0 NOT NULL ,
id_usuario VARCHAR2 ( 150 ) default ' ' ,
timestamp TIMESTAMP default NULL ,
2011-05-13 13:16:18 +02:00
priority NUMBER ( 5 , 0 ) default 2 NOT NULL ,
text VARCHAR2 ( 255 ) default ' ' ,
description VARCHAR2 ( 255 ) default ' ' ,
severity NUMBER ( 10 , 0 ) default 2 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE ttrap_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tusuario (
id_user VARCHAR2 ( 60 ) NOT NULL PRIMARY KEY ,
fullname VARCHAR2 ( 255 ) NOT NULL ,
2011-05-20 12:47:42 +02:00
firstname VARCHAR2 ( 255 ) ,
lastname VARCHAR2 ( 255 ) ,
2011-04-19 18:30:53 +02:00
middlename VARCHAR2 ( 255 ) default ' ' ,
2011-03-18 14:23:12 +01:00
password VARCHAR2 ( 45 ) default NULL ,
comments VARCHAR2 ( 200 ) default NULL ,
last_connect NUMBER ( 19 , 0 ) default 0 NOT NULL ,
registered NUMBER ( 19 , 0 ) default 0 NOT NULL ,
email VARCHAR2 ( 100 ) default NULL ,
phone VARCHAR2 ( 100 ) default NULL ,
is_admin NUMBER ( 5 , 0 ) default 0 NOT NULL ,
language VARCHAR2 ( 10 ) default NULL ,
timezone VARCHAR2 ( 50 ) default ' ' ,
block_size NUMBER ( 10 , 0 ) default 20 NOT NULL ,
2011-05-13 13:16:18 +02:00
flash_chart NUMBER ( 10 , 0 ) default 1 NOT NULL ,
2012-01-03 14:07:40 +01:00
id_skin NUMBER ( 10 , 0 ) DEFAULT 0 NOT NULL ,
2012-02-01 11:57:43 +01:00
disabled NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2012-03-08 17:42:31 +01:00
shortcut NUMBER ( 5 , 0 ) DEFAULT 0 ,
2012-03-08 19:09:21 +01:00
shortcut_data CLOB default ' ' ,
2012-03-08 17:42:31 +01:00
section VARCHAR2 ( 255 ) NOT NULL ,
data_section VARCHAR2 ( 255 ) NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE TABLE tusuario_perfil (
id_up NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
id_usuario VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
id_perfil NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_grupo NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-05-13 13:16:18 +02:00
assigned_by VARCHAR2 ( 100 ) default ' ' ,
id_policy NUMBER ( 10 , 0 ) DEFAULT 0 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tusuario_perfil_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tnews (
id_news NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
author VARCHAR2 ( 255 ) DEFAULT ' ' ,
subject VARCHAR2 ( 255 ) DEFAULT ' ' ,
2011-04-11 19:05:20 +02:00
text CLOB NOT NULL ,
2011-03-18 14:23:12 +01:00
timestamp TIMESTAMP default NULL
) ;
CREATE SEQUENCE tnews_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tgraph (
id_graph NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
id_user VARCHAR2 ( 100 ) default ' ' ,
name VARCHAR2 ( 150 ) default ' ' ,
2011-04-11 19:05:20 +02:00
description CLOB NOT NULL ,
2011-03-18 14:23:12 +01:00
period NUMBER ( 10 , 0 ) default 0 NOT NULL ,
width NUMBER ( 10 , 0 ) default 0 NOT NULL ,
height NUMBER ( 10 , 0 ) default 0 NOT NULL ,
private NUMBER ( 5 , 0 ) default 0 NOT NULL ,
events NUMBER ( 5 , 0 ) default 0 NOT NULL ,
stacked NUMBER ( 5 , 0 ) default 0 NOT NULL ,
2012-02-23 12:28:26 +01:00
id_group NUMBER ( 19 , 0 ) default 0 NOT NULL ,
id_graph_template NUMBER ( 11 , 0 ) default 0 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tgraph_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tgraph_source (
id_gs NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_graph NUMBER ( 19 , 0 ) default 0 NOT NULL ,
id_agent_module NUMBER ( 19 , 0 ) default 0 NOT NULL ,
weight BINARY_DOUBLE default 0
) ;
CREATE SEQUENCE tgraph_source_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE treport (
id_report NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
id_user VARCHAR2 ( 100 ) default ' ' ,
name VARCHAR2 ( 150 ) default ' ' ,
2011-04-11 19:05:20 +02:00
description CLOB NOT NULL ,
2011-03-18 14:23:12 +01:00
private NUMBER ( 5 , 0 ) default 0 NOT NULL ,
id_group NUMBER ( 19 , 0 ) default 0 NOT NULL ,
custom_logo VARCHAR2 ( 200 ) default NULL ,
2011-04-11 19:05:20 +02:00
header CLOB default NULL ,
first_page CLOB default NULL ,
footer CLOB default NULL ,
2012-02-22 15:55:28 +01:00
custom_font VARCHAR2 ( 200 ) default NULL ,
id_template NUMBER ( 10 , 0 ) default 0 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE treport_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "treport_content"
-- -----------------------------------------------------
2011-03-24 17:51:49 +01:00
-- 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
2011-03-18 14:23:12 +01:00
CREATE TABLE treport_content (
id_rc NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_report NUMBER ( 10 , 0 ) default 0 NOT NULL REFERENCES treport ( id_report ) ON DELETE CASCADE ,
id_gs NUMBER ( 10 , 0 ) default NULL ,
id_agent_module NUMBER ( 19 , 0 ) default NULL ,
type VARCHAR2 ( 30 ) default ' simple_graph ' ,
period NUMBER ( 19 , 0 ) default 0 NOT NULL ,
" order " NUMBER ( 19 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
description CLOB ,
2011-03-18 14:23:12 +01:00
id_agent NUMBER ( 19 , 0 ) default 0 NOT NULL ,
2011-04-11 19:05:20 +02:00
text CLOB default NULL ,
external_source CLOB default NULL ,
2011-03-18 14:23:12 +01:00
treport_custom_sql_id NUMBER ( 10 , 0 ) default 0 ,
2011-04-11 19:05:20 +02:00
header_definition CLOB default NULL ,
column_separator CLOB default NULL ,
line_separator CLOB default NULL ,
2011-03-24 17:51:49 +01:00
time_from TIMESTAMP default to_date ( ' 00:00:00 ' , ' hh24:mi:ss ' ) ,
time_to TIMESTAMP default to_date ( ' 00:00:00 ' , ' hh24:mi:ss ' ) ,
2011-03-18 14:23:12 +01:00
monday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
tuesday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
wednesday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
thursday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
friday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
saturday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
sunday NUMBER ( 5 , 0 ) default 1 NOT NULL ,
2011-03-23 13:57:26 +01:00
only_display_wrong NUMBER ( 5 , 0 ) default 0 NOT NULL ,
top_n NUMBER ( 10 , 0 ) default 0 NOT NULL ,
top_n_value NUMBER ( 10 , 0 ) default 10 NOT NULL ,
exception_condition NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-24 17:51:49 +01:00
exception_condition_value BINARY_DOUBLE default 0 NOT NULL ,
2011-03-23 13:57:26 +01:00
show_resume NUMBER ( 10 , 0 ) default 0 NOT NULL ,
order_uptodown NUMBER ( 10 , 0 ) default 0 NOT NULL ,
show_graph NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-03-31 15:46:34 +02:00
group_by_agent NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
style CLOB default ' ' ,
2011-04-06 17:42:05 +02:00
id_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-05-20 13:44:35 +02:00
id_module_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
server_name CLOB default ' '
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE treport_content_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE treport_content_sla_combined (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_report_content NUMBER ( 10 , 0 ) NOT NULL REFERENCES treport_content ( id_rc ) ON DELETE CASCADE ,
2011-05-20 13:44:35 +02:00
id_agent_module NUMBER ( 10 , 0 ) NOT NULL ,
2011-03-18 14:23:12 +01:00
sla_max BINARY_DOUBLE default 0 NOT NULL ,
sla_min BINARY_DOUBLE default 0 NOT NULL ,
2011-05-20 13:44:35 +02:00
sla_limit BINARY_DOUBLE default 0 NOT NULL ,
server_name CLOB default ' '
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE treport_cont_sla_c_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- on update trigger
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
2011-03-23 13:57:26 +01:00
CREATE TABLE treport_content_item (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2012-02-22 15:55:28 +01:00
id_report_content NUMBER ( 10 , 0 ) NOT NULL REFERENCES treport_content ( id_rc ) ON DELETE CASCADE ,
2011-05-20 13:44:35 +02:00
id_agent_module NUMBER ( 10 , 0 ) NOT NULL ,
server_name CLOB default ' '
2011-03-23 13:57:26 +01:00
) ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-23 13:57:26 +01:00
2011-03-18 14:23:12 +01:00
CREATE TABLE treport_custom_sql (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 150 ) default ' ' ,
2011-04-11 19:05:20 +02:00
sql CLOB default NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE treport_custom_sql_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tlayout (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
name varchar ( 50 ) NOT NULL ,
id_group NUMBER ( 10 , 0 ) NOT NULL ,
background varchar ( 200 ) NOT NULL ,
fullscreen NUMBER ( 5 , 0 ) default 0 NOT NULL ,
height NUMBER ( 10 , 0 ) default 0 NOT NULL ,
width NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tlayout_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tlayout_data (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_layout NUMBER ( 10 , 0 ) default 0 NOT NULL ,
pos_x NUMBER ( 10 , 0 ) default 0 NOT NULL ,
pos_y NUMBER ( 10 , 0 ) default 0 NOT NULL ,
height NUMBER ( 10 , 0 ) default 0 NOT NULL ,
width NUMBER ( 10 , 0 ) default 0 NOT NULL ,
label VARCHAR2 ( 200 ) DEFAULT ' ' ,
image VARCHAR2 ( 200 ) DEFAULT ' ' ,
type NUMBER ( 5 , 0 ) default 0 NOT NULL ,
period NUMBER ( 10 , 0 ) default 3600 NOT NULL ,
id_agente_modulo NUMBER ( 19 , 0 ) default 0 NOT NULL ,
id_agent NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_layout_linked NUMBER ( 10 , 0 ) default 0 NOT NULL ,
parent_item NUMBER ( 10 , 0 ) default 0 NOT NULL ,
label_color varchar ( 20 ) DEFAULT ' ' ,
no_link_color NUMBER ( 5 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tlayout_data_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tplugin (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
name VARCHAR2 ( 200 ) NOT NULL ,
2011-04-11 19:05:20 +02:00
description CLOB ,
2011-03-18 14:23:12 +01:00
max_timeout NUMBER ( 10 , 0 ) default 0 NOT NULL ,
execute VARCHAR2 ( 250 ) NOT NULL ,
net_dst_opt VARCHAR2 ( 50 ) default ' ' ,
net_port_opt VARCHAR2 ( 50 ) default ' ' ,
user_opt VARCHAR2 ( 50 ) default ' ' ,
pass_opt VARCHAR2 ( 50 ) default ' ' ,
plugin_type NUMBER ( 5 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tplugin_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tmodule (
id_module NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' '
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tmodule_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tserver_export (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 100 ) default ' ' ,
preffix VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
interval NUMBER ( 10 , 0 ) default 300 NOT NULL ,
2011-04-19 18:30:53 +02:00
ip_server VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
connect_mode VARCHAR2 ( 20 ) default ' local ' ,
id_export_server NUMBER ( 10 , 0 ) default NULL ,
2011-04-19 18:30:53 +02:00
" user " VARCHAR2 ( 100 ) default ' ' ,
pass VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
port NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
directory VARCHAR2 ( 100 ) default ' ' ,
options VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
- - Number of hours of diference with the server timezone
timezone_offset NUMBER ( 5 , 0 ) default 0 NOT NULL ,
CONSTRAINT tserver_export_conn_mode_cons CHECK ( connect_mode IN ( ' tentacle ' , ' ssh ' , ' local ' ) )
) ;
CREATE SEQUENCE tserver_export_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- 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 (
id NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_export_server NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-04-19 18:30:53 +02:00
agent_name VARCHAR2 ( 100 ) default ' ' ,
module_name VARCHAR2 ( 100 ) default ' ' ,
module_type VARCHAR2 ( 100 ) default ' ' ,
2011-03-18 14:23:12 +01:00
data VARCHAR2 ( 255 ) default NULL ,
timestamp TIMESTAMP default NULL
) ;
CREATE SEQUENCE tserver_export_data_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tplanned_downtime (
id NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
name VARCHAR2 ( 100 ) NOT NULL ,
2011-04-11 19:05:20 +02:00
description CLOB NOT NULL ,
2011-03-18 14:23:12 +01:00
date_from NUMBER ( 19 , 0 ) default 0 NOT NULL ,
date_to NUMBER ( 19 , 0 ) default 0 NOT NULL ,
executed NUMBER ( 5 , 0 ) default 0 NOT NULL ,
2011-07-07 12:50:49 +02:00
id_group NUMBER ( 19 , 0 ) default 0 NOT NULL ,
only_alerts NUMBER ( 5 , 0 ) default 0 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tplanned_downtime_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
CREATE TABLE tplanned_downtime_agents (
id NUMBER ( 19 , 0 ) NOT NULL PRIMARY KEY ,
id_agent NUMBER ( 19 , 0 ) default 0 NOT NULL ,
2012-01-27 13:30:30 +01:00
id_downtime NUMBER ( 19 , 0 ) default 0 NOT NULL REFERENCES tplanned_downtime ( id ) ON DELETE CASCADE
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tplanned_downtime_agents_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- GIS extension Tables
-- -----------------------------------------------------
-- Table "tgis_data_history"
-- -----------------------------------------------------
- - Table to store historical GIS information of the agents
CREATE TABLE tgis_data_history (
- - key of the table
id_tgis_data NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
longitude BINARY_DOUBLE NOT NULL ,
latitude BINARY_DOUBLE NOT NULL ,
altitude BINARY_DOUBLE NOT NULL ,
- - timestamp on wich the agente started to be in this position
start_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ,
- - timestamp on wich the agent was placed for last time on this position
end_timestamp TIMESTAMP default NULL ,
- - description of the region correoponding to this placemnt
2011-04-11 19:05:20 +02:00
description CLOB DEFAULT NULL ,
2011-03-18 14:23:12 +01:00
-- 0 to show that the position cames from the agent, 1 to show that the position was established manualy
manual_placement NUMBER ( 5 , 0 ) default 0 NOT NULL ,
-- Number of data packages received with this position from the start_timestampa to the_end_timestamp
number_of_packages NUMBER ( 10 , 0 ) default 1 NOT NULL ,
- - reference to the agent
tagente_id_agente NUMBER ( 10 , 0 ) NOT NULL
) ;
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 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tgis_data_status"
-- -----------------------------------------------------
- - Table to store last GIS information of the agents
2011-03-24 17:51:49 +01:00
- - ON UPDATE NO ACTION is implicit on Oracle DBMS for tagente_id_agente field
2011-03-18 14:23:12 +01:00
CREATE TABLE tgis_data_status (
- - Reference to the agent
2011-03-24 17:51:49 +01:00
tagente_id_agente NUMBER ( 10 , 0 ) NOT NULL REFERENCES tagente ( id_agente ) ON DELETE CASCADE ,
2011-03-18 14:23:12 +01:00
- - Last received longitude
current_longitude BINARY_DOUBLE NOT NULL ,
- - Last received latitude
current_latitude BINARY_DOUBLE NOT NULL ,
- - Last received altitude
current_altitude BINARY_DOUBLE NOT NULL ,
- - Reference longitude to see if the agent has moved
stored_longitude BINARY_DOUBLE NOT NULL ,
- - Reference latitude to see if the agent has moved
stored_latitude BINARY_DOUBLE NOT NULL ,
- - Reference altitude to see if the agent has moved
stored_altitude BINARY_DOUBLE DEFAULT NULL ,
- - Number of data packages received with this position since start_timestampa
number_of_packages NUMBER ( 10 , 0 ) default 1 NOT NULL ,
- - Timestamp on wich the agente started to be in this position
start_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL ,
- - 0 to show that the position cames from the agent , 1 to show that the position was established manualy
manual_placement NUMBER ( 5 , 0 ) default 0 NOT NULL ,
- - description of the region correoponding to this placemnt
2011-04-11 19:05:20 +02:00
description CLOB NULL ,
2011-03-18 14:23:12 +01:00
PRIMARY KEY ( tagente_id_agente )
) ;
CREATE INDEX tgis_data_status_start_t_idx ON tgis_data_status ( start_timestamp ) ;
-- -----------------------------------------------------
-- Table "tgis_map"
-- -----------------------------------------------------
- - Table containing information about a gis map
CREATE TABLE tgis_map (
- - table identifier
id_tgis_map NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
- - Name of the map
map_name VARCHAR2 ( 63 ) NOT NULL ,
- - longitude of the center of the map when it \ ' s loaded
initial_longitude BINARY_DOUBLE DEFAULT NULL ,
- - latitude of the center of the map when it \ ' s loaded
initial_latitude BINARY_DOUBLE DEFAULT NULL ,
- - altitude of the center of the map when it \ ' s loaded
initial_altitude BINARY_DOUBLE DEFAULT NULL ,
- - Zoom level to show when the map is loaded .
zoom_level NUMBER ( 5 , 0 ) default 1 NOT NULL ,
- - path on the server to the background image of the map
map_background VARCHAR2 ( 127 ) DEFAULT NULL ,
- - default longitude for the agents placed on the map
default_longitude BINARY_DOUBLE DEFAULT NULL ,
- - default latitude for the agents placed on the map
default_latitude BINARY_DOUBLE DEFAULT NULL ,
- - default altitude for the agents placed on the map
default_altitude DOUBLE PRECISION DEFAULT NULL ,
- - Group that owns the map
group_id NUMBER ( 10 , 0 ) default 0 NOT NULL ,
- - 1 if this is the default map , 0 in other case
default_map NUMBER ( 5 , 0 ) default 0 NOT NULL
) ;
CREATE INDEX tgis_map_tagente_map_name_idx ON tgis_map ( map_name ) ;
CREATE SEQUENCE tgis_map_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tgis_map_connection"
-- -----------------------------------------------------
- - Table to store the map connection information
CREATE TABLE tgis_map_connection (
- - table id
id_tmap_connection NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
- - Name of the connection ( name of the base layer )
conection_name VARCHAR2 ( 45 ) DEFAULT NULL ,
- - Type of map server to connect
connection_type VARCHAR2 ( 45 ) DEFAULT NULL ,
- - connection information ( this can probably change to fit better the possible connection parameters )
2011-04-11 19:05:20 +02:00
conection_data CLOB DEFAULT NULL ,
2011-03-18 14:23:12 +01:00
- - Number of zoom levels available
num_zoom_levels NUMBER ( 5 , 0 ) DEFAULT NULL ,
- - Default Zoom Level for the connection
default_zoom_level NUMBER ( 5 , 0 ) default 16 NOT NULL ,
- - default longitude for the agents placed on the map
default_longitude BINARY_DOUBLE DEFAULT NULL ,
- - default latitude for the agents placed on the map
default_latitude BINARY_DOUBLE DEFAULT NULL ,
- - default altitude for the agents placed on the map
default_altitude BINARY_DOUBLE DEFAULT NULL ,
- - longitude of the center of the map when it \ ' s loaded
initial_longitude BINARY_DOUBLE DEFAULT NULL ,
- - latitude of the center of the map when it \ ' s loaded
initial_latitude BINARY_DOUBLE DEFAULT NULL ,
- - altitude of the center of the map when it \ ' s loaded
initial_altitude BINARY_DOUBLE DEFAULT NULL ,
- - Group that owns the map
group_id NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tgis_map_connection_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tgis_map_has_tgis_map_connection"
-- -----------------------------------------------------
-- This table is commented because table name length is more 30 chars. TODO: Change it's name
- - Table to asociate a connection to a gis map
- - CREATE TABLE tgis_map_has_tgis_map_connection (
- - reference to tgis_map
-- tgis_map_id_tgis_map NUMBER(10, 0) NOT NULL REFERENCES tgis_map(id_tgis_map) ON DELETE CASCADE,
- - reference to tgis_map_connection
-- tgis_map_connection_id_tmap_connection NUMBER(10, 0) NOT NULL REFERENCES tgis_map_connection (id_tmap_connection) ON DELETE CASCADE,
- - Last Modification Time of the Connection
-- modification_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
- - Flag to mark the default map connection of a map
-- default_map_connection NUMBER(5, 0) default 0 NOT NULL,
-- PRIMARY KEY (tgis_map_id_tgis_map, tgis_map_connection_id_tmap_connection)
- - ) ;
- - CREATE INDEX tgis_map_has_tgis_map_connection_map_tgis_map_id_tgis_map_idx ON tgis_map_has_tgis_map_connection ( tgis_map_id_tgis_map ) ;
- - CREATE INDEX tgis_map_has_tgis_map_connection_map_tgis_map_connection_id_tmap_connection_idx ON tgis_map_has_tgis_map_connection ( tgis_map_connection_id_tmap_connection ) ;
- - This trigger is for tranlate " on update CURRENT_TIMESTAMP " of MySQL .
2011-03-24 17:51:49 +01:00
- - 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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tgis_map_layer"
-- -----------------------------------------------------
- - Table containing information about the map layers
CREATE TABLE tgis_map_layer (
- - table id
id_tmap_layer NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
- - Name of the layer
layer_name VARCHAR2 ( 45 ) NOT NULL ,
- - True if the layer must be shown
view_layer NUMBER ( 5 , 0 ) default 1 NOT NULL ,
- - Number of order of the layer in the layer stack , bigger means upper on the stack . \ n
layer_stack_order NUMBER ( 5 , 0 ) default 0 NOT NULL ,
- - reference to the map containing the layer
tgis_map_id_tgis_map NUMBER ( 10 , 0 ) default 0 NOT NULL REFERENCES tgis_map ( id_tgis_map ) ON DELETE CASCADE ,
- - reference to the group shown in the layer
tgrupo_id_grupo NUMBER ( 19 , 0 ) NOT NULL
) ;
CREATE SEQUENCE tgis_map_layer_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tgis_map_layer_has_tagente"
-- -----------------------------------------------------
- - Table to define wich agents are shown in a layer
CREATE TABLE tgis_map_layer_has_tagente (
tgis_map_layer_id_tmap_layer NUMBER ( 10 , 0 ) NOT NULL REFERENCES tgis_map_layer ( id_tmap_layer ) ON DELETE CASCADE ,
tagente_id_agente NUMBER ( 10 , 0 ) NOT NULL REFERENCES tagente ( id_agente ) ON DELETE CASCADE ,
PRIMARY KEY ( tgis_map_layer_id_tmap_layer , tagente_id_agente )
) ;
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 ) ;
-- -----------------------------------------------------
-- Table "tgroup_stat"
-- -----------------------------------------------------
- - Table to store global system stats per group
CREATE TABLE tgroup_stat (
id_group NUMBER ( 10 , 0 ) default 0 NOT NULL PRIMARY KEY ,
modules NUMBER ( 10 , 0 ) default 0 NOT NULL ,
normal NUMBER ( 10 , 0 ) default 0 NOT NULL ,
critical NUMBER ( 10 , 0 ) default 0 NOT NULL ,
warning NUMBER ( 10 , 0 ) default 0 NOT NULL ,
unknown NUMBER ( 10 , 0 ) default 0 NOT NULL ,
" non-init " NUMBER ( 10 , 0 ) default 0 NOT NULL ,
alerts NUMBER ( 10 , 0 ) default 0 NOT NULL ,
alerts_fired NUMBER ( 10 , 0 ) default 0 NOT NULL ,
agents NUMBER ( 10 , 0 ) default 0 NOT NULL ,
agents_unknown NUMBER ( 10 , 0 ) default 0 NOT NULL ,
utimestamp NUMBER ( 10 , 0 ) default 0 NOT NULL
) ;
-- -----------------------------------------------------
-- Table "tnetwork_map"
-- -----------------------------------------------------
CREATE TABLE tnetwork_map (
id_networkmap NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_user VARCHAR2 ( 60 ) NOT NULL ,
name VARCHAR2 ( 100 ) NOT NULL ,
type VARCHAR2 ( 20 ) NOT NULL ,
layout VARCHAR2 ( 20 ) NOT NULL ,
nooverlap NUMBER ( 5 , 0 ) default 0 NOT NULL ,
simple NUMBER ( 5 , 0 ) default 0 NOT NULL ,
regenerate NUMBER ( 5 , 0 ) default 1 NOT NULL ,
font_size NUMBER ( 10 , 0 ) default 12 NOT NULL ,
id_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_module_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
id_policy NUMBER ( 10 , 0 ) default 0 NOT NULL ,
depth VARCHAR2 ( 20 ) NOT NULL ,
only_modules_with_alerts NUMBER ( 10 , 0 ) default 0 NOT NULL ,
hide_policy_modules SMALLINT default 0 NOT NULL ,
zoom BINARY_DOUBLE default 1 ,
distance_nodes BINARY_DOUBLE default 2 . 5 ,
center NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2011-07-04 15:07:04 +02:00
contracted_nodes CLOB ,
show_snmp_modules NUMBER ( 5 , 0 ) default 0 NOT NULL
2011-03-18 14:23:12 +01:00
) ;
CREATE SEQUENCE tnetwork_map_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tsnmp_filter"
-- -----------------------------------------------------
CREATE TABLE tsnmp_filter (
id_snmp_filter NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
description VARCHAR2 ( 255 ) default ' ' ,
filter VARCHAR2 ( 255 ) default ' '
) ;
CREATE SEQUENCE tsnmp_filter_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tagent_custom_fields"
-- -----------------------------------------------------
CREATE TABLE tagent_custom_fields (
id_field NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2011-04-19 18:30:53 +02:00
name VARCHAR2 ( 45 ) default ' ' ,
2011-03-18 14:23:12 +01:00
display_on_front NUMBER ( 5 , 0 ) default 0 NOT NULL
) ;
CREATE SEQUENCE tagent_custom_fields_s INCREMENT BY 1 START WITH 1 ;
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- -----------------------------------------------------
-- Table "tagent_custom_data"
-- -----------------------------------------------------
CREATE TABLE tagent_custom_data (
id_field NUMBER ( 10 , 0 ) NOT NULL REFERENCES tagent_custom_fields ( id_field ) ON DELETE CASCADE ,
id_agent NUMBER ( 10 , 0 ) NOT NULL REFERENCES tagente ( id_agente ) ON DELETE CASCADE ,
2011-04-11 19:05:20 +02:00
description CLOB default ' ' ,
2011-03-18 14:23:12 +01:00
PRIMARY KEY ( id_field , id_agent )
) ;
-- on update trigger
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-18 14:23:12 +01:00
-- on update trigger 1
2011-03-24 17:51:49 +01:00
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 ; ;
2011-03-31 15:46:34 +02:00
-- 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 BEGIN EXECUTE IMMEDIATE sql_insert ; EXECUTE IMMEDIATE ' SELECT ' | | table_name | | ' _s.currval FROM DUAL ' INTO id ; EXCEPTION WHEN others THEN RAISE_APPLICATION_ERROR ( - 20001 , ' ERROR on insert_id procedure, please check input parameters or procedure logic. ' ) ; END insert_id ; ;
2011-05-26 12:51:17 +02:00
-- -----------------------------------------------------
-- Table "ttag"
-- -----------------------------------------------------
CREATE TABLE ttag (
id_tag NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
name VARCHAR2 ( 100 ) default ' ' NOT NULL ,
description CLOB default ' ' NOT NULL ,
url CLOB default ' ' NOT NULL
) ;
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"
-- -----------------------------------------------------
CREATE TABLE ttag_module (
id_tag NUMBER ( 10 , 0 ) NOT NULL ,
id_agente_modulo NUMBER ( 10 , 0 ) DEFAULT 0 NOT NULL ,
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"
-- -----------------------------------------------------
CREATE TABLE ttag_policy_module (
id_tag NUMBER ( 10 , 0 ) NOT NULL ,
id_policy_module NUMBER ( 10 , 0 ) DEFAULT 0 NOT NULL ,
PRIMARY KEY ( id_tag , id_policy_module )
) ;
CREATE INDEX ttag_poli_mod_id_pol_mo_idx ON ttag_policy_module ( id_policy_module ) ;
-- -----------------------------------------------------
-- Table "ttag_event"
-- -----------------------------------------------------
CREATE TABLE ttag_event (
id_tag NUMBER ( 10 , 0 ) NOT NULL ,
id_evento NUMBER ( 19 , 0 ) DEFAULT 0 NOT NULL ,
PRIMARY KEY ( id_tag , id_evento )
) ;
CREATE INDEX ttag_event_id_evento_idx ON ttag_event ( id_evento ) ;
2012-01-02 15:41:35 +01:00
-- -----------------------------------------------------
-- Table "tnetflow_filter"
-- -----------------------------------------------------
CREATE TABLE tnetflow_filter (
id_sg NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2012-01-17 15:01:49 +01:00
id_name VARCHAR2 ( 600 ) NOT NULL ,
2012-01-12 13:55:17 +01:00
id_group NUMBER ( 10 , 0 ) ,
2012-01-17 15:01:49 +01:00
ip_dst CLOB NOT NULL ,
ip_src CLOB NOT NULL ,
dst_port CLOB NOT NULL ,
src_port CLOB NOT NULL ,
advanced_filter CLOB NOT NULL ,
2012-01-24 Ramon Novoa <rnovoa@artica.es>
* include/functions_config.php,
include/functions_netflow.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
pandoradb.oracle.sql,
operation/netflow/nf_live_view.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/configurar_agente.php,
godmode/menu.php,
godmode/netflow/nf_edit_form.php: Added support for enterprise
netflow modules.
* godmode/netflow/nf_manage.php: Moved to
godmode/setup/setup_netflow.php.
* godmode/netflow/nf_option_form.php: Removed from repository. Not used.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5416 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-24 18:11:12 +01:00
filter_args CLOB NOT NULL ,
2012-01-02 15:41:35 +01:00
aggregate VARCHAR2 ( 60 ) ,
2012-01-10 16:23:56 +01:00
output VARCHAR2 ( 60 )
2012-01-02 15:41:35 +01:00
) ;
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"
-- -----------------------------------------------------
CREATE TABLE tnetflow_report (
id_report NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_name VARCHAR2 ( 100 ) NOT NULL ,
description CLOB default ' ' ,
2012-01-12 13:55:17 +01:00
id_group NUMBER ( 10 , 0 )
2012-01-02 15:41:35 +01:00
) ;
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"
-- -----------------------------------------------------
CREATE TABLE tnetflow_report_content (
id_rc NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
id_report NUMBER ( 10 , 0 ) NOT NULL REFERENCES tnetflow_report ( id_report ) ON DELETE CASCADE ,
2012-01-09 12:45:00 +01:00
id_filter NUMBER ( 10 , 0 ) NOT NULL REFERENCES tnetflow_filter ( id_sg ) ON DELETE CASCADE ,
2012-01-02 15:41:35 +01:00
" date " NUMBER ( 20 , 0 ) default 0 NOT NULL ,
period NUMBER ( 11 , 0 ) default 0 NOT NULL ,
max NUMBER ( 11 , 0 ) default 0 NOT NULL ,
2012-01-13 13:11:00 +01:00
show_graph VARCHAR2 ( 60 ) ,
" order " NUMBER ( 11 , 0 ) default 0 NOT NULL
2012-01-02 15:41:35 +01:00
) ;
CREATE SEQUENCE tnetflow_report_content_s INCREMENT BY 1 START WITH 1 ;
CREATE OR REPLACE TRIGGER tnetflow_report_content_inc BEFORE INSERT ON tnetflow_report_content REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetflow_report_content_s . nextval INTO : NEW . ID_RC FROM dual ; END tnetflow_report_content_inc ; ;
2012-02-08 14:04:18 +01:00
-- -----------------------------------------------------
-- Table `tevent_filter`
-- -----------------------------------------------------
CREATE TABLE tevent_filter (
id_filter NUMBER ( 10 , 0 ) NOT NULL PRIMARY KEY ,
2012-02-09 12:20:28 +01:00
id_group_filter NUMBER ( 10 , 0 ) default 0 NOT NULL ,
2012-02-08 14:04:18 +01:00
id_name VARCHAR2 ( 600 ) NOT NULL ,
id_group NUMBER ( 10 , 0 ) default 0 NOT NULL ,
event_type CLOB default ' ' NOT NULL ,
severity NUMBER ( 10 , 0 ) default - 1 NOT NULL ,
status NUMBER ( 10 , 0 ) default - 1 NOT NULL ,
search CLOB default ' ' ,
text_agent CLOB default ' ' ,
pagination NUMBER ( 10 , 0 ) default 25 NOT NULL ,
event_view_hr NUMBER ( 10 , 0 ) default 8 NOT NULL ,
id_user_ack CLOB ,
group_rep NUMBER ( 10 , 0 ) default 0 NOT NULL ,
tag VARCHAR2 ( 600 ) default ' ' NOT NULL ,
filter_only_alert NUMBER ( 10 , 0 ) default - 1 NOT NULL
) ;