CREATE TABLE NA_CONTACTS
 (NAME VARCHAR(240)
 ,TEMPLATE VARCHAR(240)
 ,CONTNAME VARCHAR(240)
 ,ALIAS VARCHAR(240)
 ,PLATFORM VARCHAR(240)
 ,ID_CONTACT VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_SRVGRPS
 (SGNAME VARCHAR(240) NOT NULL
 ,ALIAS VARCHAR(240) NOT NULL
 ,PLATFORM VARCHAR(240)
 );

CREATE TABLE NA_PLATFORMS
 (PLATFORM VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_TYPEHOATS
 (EXTENDED INTEGER DEFAULT 0
 ,TYPENAME VARCHAR(240) NOT NULL
 ,OBLIGATO INTEGER DEFAULT 0
 );

CREATE TABLE NA_SGMEMBERS
 (ID_SRV VARCHAR(240) NOT NULL
 ,SGNAME VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_TYPESRVATS
 (OBLIGATO INTEGER DEFAULT 0
 ,EXTENDED INTEGER DEFAULT 0
 ,TYPENAME VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_COMMANDS
 (COMMLINE VARCHAR(500) NOT NULL
 ,COMMNAME VARCHAR(240) NOT NULL
 ,NOTIFICA INTEGER DEFAULT 0
 );

CREATE TABLE NA_SRVATTRS
 (TYPENAME VARCHAR(240) NOT NULL
 ,ID_SRV VARCHAR(240) NOT NULL
 ,VALUE VARCHAR(240) DEFAULT '0'
 ,OVRD INTEGER DEFAULT 0
 );

CREATE TABLE NA_TIMEPERDS
 (TIMENAME VARCHAR(240) NOT NULL
 ,SUNDAY VARCHAR(240)
 ,TUESDAY VARCHAR(240)
 ,THURSDAY VARCHAR(240)
 ,MONDAY VARCHAR(240)
 ,SATURDAY VARCHAR(240)
 ,FRIDAY VARCHAR(240)
 ,WEDNESDAY VARCHAR(240)
 ,ALIAS VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_HOSTGRPS
 (ALIAS VARCHAR(240) NOT NULL
 ,HOSTGRP VARCHAR(240) NOT NULL
 ,PLATFORM VARCHAR(240)
 );

CREATE TABLE NA_HOSTS
 (ADDRS VARCHAR(240)
 ,TEMPLATE VARCHAR(240)
 ,ALIAS VARCHAR(240)
 ,HOSTNAME VARCHAR(240)
 ,PLATFORM VARCHAR(240)
 ,ID_HOST VARCHAR(240) NOT NULL
 ,NAME VARCHAR(240)
 );

CREATE TABLE NA_HGMEMBERS
 (HOSTGRP VARCHAR(240) NOT NULL
 ,ID_HOST VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_CGMEMBERS
 (CONTGRP VARCHAR(240) NOT NULL
 ,ID_CONTACT VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_SRVDEPENS
 (ID_SRVDEPEN VARCHAR(240) NOT NULL
 ,HOSTNAME VARCHAR(240) NOT NULL
 ,DEPENSRV VARCHAR(240) NOT NULL
 ,DEPENHOST VARCHAR(240) NOT NULL
 ,NOTF_CRIT VARCHAR(240)
 ,INHERIT INTEGER DEFAULT 0
 ,SRVDESCR VARCHAR(240) NOT NULL
 ,EXEC_CRIT VARCHAR(240)
 );

CREATE TABLE NA_ADMINS
 (NIF VARCHAR(240) NOT NULL
 ,NOMBRE VARCHAR(240) NOT NULL
 ,PASSWORD VARCHAR(240) NOT NULL
 ,ESTADO INTEGER DEFAULT 1 NOT NULL
 ,FECUDE VARCHAR(240) NOT NULL
 ,EMAIL VARCHAR(240)
 ,ADMIN INTEGER DEFAULT 1 NOT NULL
 );

CREATE TABLE NA_HOSTDEPENS
 (ID_HOSTDEPEN VARCHAR(240) NOT NULL
 ,EXEC_CRIT VARCHAR(240)
 ,NOTF_CRIT VARCHAR(240)
 ,HOSTNAME VARCHAR(240) NOT NULL
 ,DEPENHOST VARCHAR(240) NOT NULL
 ,INHERIT INTEGER DEFAULT 0
 );

CREATE TABLE NA_CONTATTRS
 (TYPENAME VARCHAR(240) NOT NULL
 ,ID_CONTACT VARCHAR(240) NOT NULL
 ,VALUE VARCHAR(240) DEFAULT '0'
 ,OVRD INTEGER DEFAULT 0
 );

CREATE TABLE NA_SERVICES
 (DESCR VARCHAR(240)
 ,TEMPLATE VARCHAR(240)
 ,HOSTNAME VARCHAR(240)
 ,ID_SRV VARCHAR(240) NOT NULL
 ,PLATFORM VARCHAR(240)
 ,NAME VARCHAR(240)
 );

CREATE TABLE NA_CONTGRPS
 (ALIAS VARCHAR(240) NOT NULL
 ,CONTGRP VARCHAR(240) NOT NULL
 ,PLATFORM VARCHAR(240)
 );

CREATE TABLE NA_HOSTSATTRS
 (ID_HOST VARCHAR(240) NOT NULL
 ,TYPENAME VARCHAR(240) NOT NULL
 ,VALUE VARCHAR(240)
 ,OVRD INTEGER DEFAULT 0
 );

CREATE TABLE NA_SRVESCALS
 (ID_SRVESCAL VARCHAR(240) NOT NULL
 ,SRVDESCR VARCHAR(240) NOT NULL
 ,HOSTNAME VARCHAR(240) NOT NULL
 ,LASTNOTIF VARCHAR(240) NOT NULL
 ,ESCALOPT VARCHAR(240)
 ,CONTGRP VARCHAR(240) NOT NULL
 ,FIRSTNOTIF VARCHAR(240) NOT NULL
 ,ESCALPER VARCHAR(240) NOT NULL
 );

CREATE TABLE NA_TYPECNATS
 (OBLIGATO INTEGER DEFAULT 0
 ,TYPENAME VARCHAR(240) NOT NULL
 ,EXTENDED INTEGER DEFAULT 0
 );

CREATE TABLE NA_HOSTESCALS
 (ID_HOSTESCAL VARCHAR(240) NOT NULL
 ,HOSTGRP VARCHAR(240) NOT NULL
 ,ESCALPER VARCHAR(240)
 ,HOSTNAME VARCHAR(240) NOT NULL
 ,ESCALOPT VARCHAR(240)
 ,LASTNOTIF VARCHAR(240) NOT NULL
 ,NOTIFINT VARCHAR(240) NOT NULL
 ,CONTGRP VARCHAR(240) NOT NULL
 ,FIRSTNOTIF VARCHAR(240) NOT NULL
 );

# Insertamos una fila en la tabla de administradores para que se pueda
# acceder inicialmente a la aplicacion
INSERT INTO na_admins (NIF,NOMBRE,PASSWORD,ESTADO,FECUDE,EMAIL,ADMIN)
VALUES ('00000000X', 'nagiosadm', 'admin', '1', '', 'nagiosadm@nagios.org', '1');


# Creamos tablas para simular secuencias para los identificadores de
# contactos, servidores y servicios. Y las iniciamos
CREATE TABLE na_contseq (id INT NOT NULL);
INSERT INTO na_contseq VALUES (0);
CREATE TABLE na_hostseq (id INT NOT NULL);
INSERT INTO na_hostseq VALUES(0);
CREATE TABLE na_srvseq (id INT NOT NULL);
INSERT INTO na_srvseq VALUES(0);


## Creamos las claves primarias y foráneas de las tablas
ALTER TABLE NA_CONTACTS ADD (CONSTRAINT PRIMARY KEY (ID_CONTACT));
ALTER TABLE NA_SRVGRPS ADD (CONSTRAINT PRIMARY KEY (SGNAME));
ALTER TABLE NA_PLATFORMS ADD (CONSTRAINT PRIMARY KEY (PLATFORM));
ALTER TABLE NA_TYPEHOATS ADD (CONSTRAINT PRIMARY KEY (TYPENAME));
ALTER TABLE NA_SGMEMBERS ADD (CONSTRAINT PRIMARY KEY (ID_SRV,SGNAME));
ALTER TABLE NA_TYPESRVATS ADD (CONSTRAINT PRIMARY KEY (TYPENAME));
ALTER TABLE NA_COMMANDS ADD (CONSTRAINT PRIMARY KEY (COMMNAME));
ALTER TABLE NA_TIMEPERDS ADD (CONSTRAINT PRIMARY KEY (TIMENAME));
ALTER TABLE NA_HOSTGRPS ADD (CONSTRAINT PRIMARY KEY (HOSTGRP));
ALTER TABLE NA_HOSTS ADD (CONSTRAINT PRIMARY KEY (ID_HOST));
ALTER TABLE NA_HGMEMBERS ADD (CONSTRAINT PRIMARY KEY (ID_HOST,HOSTGRP));
ALTER TABLE NA_CGMEMBERS ADD (CONSTRAINT PRIMARY KEY (ID_CONTACT,CONTGRP));
ALTER TABLE NA_SRVDEPENS ADD (CONSTRAINT PRIMARY KEY (ID_SRVDEPEN));
ALTER TABLE NA_ADMINS ADD (CONSTRAINT PRIMARY KEY (NIF));
ALTER TABLE NA_HOSTDEPENS ADD (CONSTRAINT PRIMARY KEY (ID_HOSTDEPEN));
ALTER TABLE NA_CONTATTRS ADD (CONSTRAINT PRIMARY KEY (ID_CONTACT,TYPENAME));
ALTER TABLE NA_SERVICES ADD (CONSTRAINT PRIMARY KEY (ID_SRV));
ALTER TABLE NA_CONTGRPS ADD (CONSTRAINT PRIMARY KEY (CONTGRP));
ALTER TABLE NA_SRVESCALS ADD (CONSTRAINT PRIMARY KEY (ID_SRVESCAL));
ALTER TABLE NA_TYPECNATS ADD (CONSTRAINT PRIMARY KEY (TYPENAME));
ALTER TABLE NA_HOSTESCALS ADD (CONSTRAINT PRIMARY KEY (ID_HOSTESCAL));
ALTER TABLE NA_CONTACTS ADD (CONSTRAINT FOREIGN KEY (TEMPLATE) REFERENCES NA_CONTACTS (ID_CONTACT));
ALTER TABLE NA_CONTACTS ADD (CONSTRAINT FOREIGN KEY (PLATFORM) 
REFERENCES NA_PLATFORMS (PLATFORM));
ALTER TABLE NA_SRVGRPS ADD (CONSTRAINT FOREIGN KEY   (PLATFORM) REFERENCES NA_PLATFORMS (PLATFORM));
ALTER TABLE NA_SGMEMBERS ADD (CONSTRAINT FOREIGN KEY (ID_SRV) REFERENCES NA_SERVICES (ID_SRV));
ALTER TABLE NA_SGMEMBERS ADD (CONSTRAINT FOREIGN KEY (SGNAME) 
REFERENCES NA_SRVGRPS (SGNAME) ON DELETE CASCADE);
ALTER TABLE NA_SRVATTRS ADD (CONSTRAINT FOREIGN KEY (TYPENAME) REFERENCES NA_TYPESRVATS (TYPENAME));
ALTER TABLE NA_SRVATTRS ADD (CONSTRAINT FOREIGN KEY (ID_SRV) 
REFERENCES NA_SERVICES (ID_SRV) ON DELETE CASCADE);
ALTER TABLE NA_HOSTGRPS ADD (CONSTRAINT FOREIGN KEY (PLATFORM) REFERENCES NA_PLATFORMS (PLATFORM));
ALTER TABLE NA_HOSTS ADD (CONSTRAINT FOREIGN KEY (TEMPLATE) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_HOSTS ADD (CONSTRAINT FOREIGN KEY (PLATFORM) REFERENCES NA_PLATFORMS (PLATFORM));
ALTER TABLE NA_HGMEMBERS ADD (CONSTRAINT FOREIGN KEY (HOSTGRP) 
REFERENCES NA_HOSTGRPS (HOSTGRP) ON DELETE CASCADE);
ALTER TABLE NA_HGMEMBERS ADD (CONSTRAINT FOREIGN KEY (ID_HOST) 
REFERENCES NA_HOSTS (ID_HOST) ON DELETE CASCADE);
ALTER TABLE NA_CGMEMBERS ADD (CONSTRAINT FOREIGN KEY (CONTGRP) 
REFERENCES NA_CONTGRPS (CONTGRP) ON DELETE CASCADE);
ALTER TABLE NA_CGMEMBERS ADD (CONSTRAINT FOREIGN KEY (ID_CONTACT) 
REFERENCES NA_CONTACTS (ID_CONTACT));
ALTER TABLE NA_SRVDEPENS ADD (CONSTRAINT FOREIGN KEY (DEPENSRV) 
REFERENCES NA_SERVICES (ID_SRV));
ALTER TABLE NA_SRVDEPENS ADD (CONSTRAINT FOREIGN KEY (DEPENHOST) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_SRVDEPENS ADD (CONSTRAINT FOREIGN KEY (SRVDESCR) REFERENCES NA_SERVICES (ID_SRV));
ALTER TABLE NA_SRVDEPENS ADD (CONSTRAINT FOREIGN KEY (HOSTNAME) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_HOSTDEPENS ADD (CONSTRAINT FOREIGN KEY (DEPENHOST) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_HOSTDEPENS ADD (CONSTRAINT FOREIGN KEY (HOSTNAME) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_CONTATTRS ADD (CONSTRAINT FOREIGN KEY (TYPENAME) REFERENCES NA_TYPECNATS (TYPENAME));
ALTER TABLE NA_CONTATTRS ADD (CONSTRAINT FOREIGN KEY (ID_CONTACT) 
REFERENCES NA_CONTACTS (ID_CONTACT) ON DELETE CASCADE);
ALTER TABLE NA_SERVICES ADD (CONSTRAINT FOREIGN KEY (PLATFORM) REFERENCES NA_PLATFORMS (PLATFORM));
ALTER TABLE NA_SERVICES ADD (CONSTRAINT FOREIGN KEY (TEMPLATE) REFERENCES NA_SERVICES (ID_SRV));
ALTER TABLE NA_CONTGRPS ADD (CONSTRAINT FOREIGN KEY (PLATFORM) REFERENCES NA_PLATFORMS (PLATFORM));
ALTER TABLE NA_HOSTSATTRS ADD (CONSTRAINT FOREIGN KEY (ID_HOST) 
REFERENCES NA_HOSTS (ID_HOST) ON DELETE CASCADE);
ALTER TABLE NA_HOSTSATTRS ADD (CONSTRAINT FOREIGN KEY (TYPENAME) REFERENCES NA_TYPEHOATS (TYPENAME));
ALTER TABLE NA_SRVESCALS ADD (CONSTRAINT FOREIGN KEY (HOSTNAME) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_SRVESCALS ADD (CONSTRAINT FOREIGN KEY (ESCALPER) REFERENCES NA_TIMEPERDS (TIMENAME));
ALTER TABLE NA_SRVESCALS ADD (CONSTRAINT FOREIGN KEY (SRVDESCR) REFERENCES NA_SERVICES (ID_SRV));
ALTER TABLE NA_SRVESCALS ADD (CONSTRAINT FOREIGN KEY (CONTGRP) REFERENCES NA_CONTGRPS (CONTGRP));
ALTER TABLE NA_HOSTESCALS ADD (CONSTRAINT FOREIGN KEY (HOSTNAME) REFERENCES NA_HOSTS (ID_HOST));
ALTER TABLE NA_HOSTESCALS ADD (CONSTRAINT FOREIGN KEY (ESCALPER) REFERENCES NA_TIMEPERDS (TIMENAME));
ALTER TABLE NA_HOSTESCALS ADD (CONSTRAINT FOREIGN KEY (CONTGRP) REFERENCES NA_CONTGRPS (CONTGRP));


##Insertamos los tipos validos para los hosts
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'register', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'name', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'id_host', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'plataforma', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'host_name', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'alias', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'address', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'parents', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'hostgroups', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'check_command', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'max_check_attempts', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'check_interval', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'passive_checks_enabled', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'check_period', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'obsess_over_host', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'check_freshness', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'freshness_threshold', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'event_handler', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'event_handler_enabled', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'low_flap_threshold', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'high_flap_threshold', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'flap_detection_enabled', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'process_perf_data', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'retain_status_information', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'retain_nonstatus_information', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'contact_groups', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'notification_interval', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'notification_period', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'notification_options', '1');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'notifications_enabled', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'stalking_options', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'active_checks_enabled', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'notes', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'notes_url', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'action_url', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'icon_image', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'icon_image_alt', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'vrml_image', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', 'statusmap_image', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', '2d_coords', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('1', '3d_coords', '0');
INSERT INTO na_typehoats (extended,typename,obligato) VALUES ('0', 'plantilla', '0');

##Insertamos los tipos básicos para los services
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'Id_Service', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'plantilla', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'register', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'name', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'plataforma', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'host_name', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'obsess_over_service', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'check_freshness', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'freshness_threshold', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'event_handler', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'event_handler_enabled', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'low_flap_threshold', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'high_flap_threshold', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'flap_detection_enabled', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'process_perf_data', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'retain_status_information', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'retain_nonstatus_information', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'service_description', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'servicegroups', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'is_volatile', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'check_command', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'max_check_attempts', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'normal_check_interval', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'retry_check_interval', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'active_checks_enabled', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'passive_checks_enabled', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'check_period', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'parallelize_check', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'notification_interval', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'notification_period', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'notification_options', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'notifications_enabled', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'contact_groups', '1');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('0', 'stalking_options', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('1', 'notes', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('1', 'notes_url', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('1', 'action_url', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('1', 'icon_image', '0');
INSERT INTO na_typesrvats (extended,typename,obligato) VALUES ('1', 'icon_image_alt', '0');
INSERT INTO na_typesrvats (obligato,extended,typename) VALUES ('0','0','command_arguments');

## Insertamos los tipos básicos para los contactos
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'plantilla', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'register', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'id_contact', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'name', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'plataforma', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'contact_name', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'alias', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'contactgroups', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'host_notification_period', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'service_notification_period', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'host_notification_options', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('1', 'service_notification_options', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'host_notification_commands', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'service_notification_commands', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'email', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'pager', '0');
INSERT INTO na_typecnats (obligato,typename,extended) VALUES ('0', 'addressx', '0');
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">
	<head>
            <title>e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.</title>

                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="Buscador de proyectos ETSI" />
<meta name="author" content="Daniel Callejo"/>
<meta name="author" content="Federico L&oacute;pez"/>
<meta name="author" content="Juli&aacute;n P&eacute;rez"/>
<meta name="author" content="Jos&eacute; Mar&iacute;a Vidal Vidal"/>
<base href="https://biblus.us.es/bibing/proyectos/" /><link rel="shortcut icon" href="./favicon.ico" />
<link rel="stylesheet" href="./publico/css/estructura.css" type="text/css" />
<link rel="stylesheet" href="./publico/css/bootstrap.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="./publico/css/enlaces-capas.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/pestanas.css" type="text/css"  /> 
<link rel="stylesheet" href="./publico/css/formularios.css" type="text/css" />
<link rel="stylesheet" href="./publico/css/lightbox.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/autocompleter.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/resultados.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/milista.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/explorador.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/ultimos.css" type="text/css"  />
<link rel="stylesheet" href="./publico/css/contactar.css" type="text/css"  />
<!-- <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" /> -->
<script src="./publico/javascript/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="./publico/javascript/bootstrap.js" type="text/javascript"></script>

<script src="./publico/javascript/mootools-1.2.4-core.js" type="text/javascript"></script>
<script src="./publico/javascript/mootools-1-1.2.4.2-more.js" type="text/javascript"></script>
<script src="./publico/javascript/targetbl.js" type="text/javascript"></script>
<script src="./publico/javascript/mensajes.js" type="text/javascript"></script>
<script src="./publico/javascript/form.js" type="text/javascript"></script>
<script src="./publico/javascript/autocompleter/Observer.js" type="text/javascript"></script>
<script src="./publico/javascript/autocompleter/Autocompleter.js" type="text/javascript"></script>
<script src="./publico/javascript/autocompleter/Autocompleter.Request.js" type="text/javascript"></script>
<script src="./publico/javascript/domready.js" type="text/javascript"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2HP38G406P"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-2HP38G406P');
</script>



<script type="text/javascript">
function seleccionar_todo(){
   for (i=0;i<document.formulario_marcados.elements.length;i++)
      if(document.formulario_marcados.elements[i].type == "checkbox")
         document.formulario_marcados.elements[i].checked=1
}
function deseleccionar_todo(){
   for (i=0;i<document.formulario_marcados.elements.length;i++)
      if(document.formulario_marcados.elements[i].type == "checkbox")
         document.formulario_marcados.elements[i].checked=0
} 
</script>
	</head>
    <body style="min-width: 960px; background-color: #e2e2e2; height: 100%">	
		<a name="arriba"></a>
<div>
<div id="header">
    <table id="Tabla_01" height="105" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <img src="./publico/imagenes/cabecera/banner_new2_01.jpg" width="3" height="105" alt="">
        </td>
        <td>
            <img src="./publico/imagenes/cabecera/banner_new2_02.jpg" width="100" height="105" alt="">
        </td>
        <td width="100%" align="right"  style="min-width: 613px; background-repeat: no-repeat; background-position: top right; font-size: medium; font-weight: bold; color: white;">
            <table width="100%" height="105" border="0">
                <tr>
                    <td style=" vertical-align: top; width: 547px">
                        <!-- <a style="text-decoration: none" href="./"><img src="./publico/imagenes/cabecera/banner_new2_03.jpg"alt=""></a> -->
                        <a style="text-decoration: none" href="https://biblus.us.es/bibing/proyectos/"><img src="./publico/imagenes/cabecera/banner_new2_03.jpg"alt=""></a>
                     </td>
                     <td  background="./publico/imagenes/cabecera/banner_new2_04.jpg" style="background-repeat: no-repeat; background-color: #c6d4e8;"><br><br><br>
                         &nbsp;
                        </td>
                    </tr>
             </table>
        </td>
    </tr>
    <tr style="border-top: 1px solid #ffffff;">
        <td colspan="3" id="menu_sup" style="font-size: small; text-align: right; background-color: #9c1f2f; vertical-align: bottom">
                                     

                                <a href="https://biblus.us.es/bibing/proyectos/" class="enlace " style=" color: #ffffff">Inicio&nbsp;&nbsp;|</a>
                                <a href="https://biblus.us.es/bibing/proyectos/acerca/" style=" color: #ffffff" class="enlace ">&nbsp;&nbsp;Acerca de&nbsp;&nbsp;|</a>
                                
                                <a href="https://biblus.us.es/bibing/proyectos/contactar/" style=" color: #ffffff" class="enlace ">&nbsp;&nbsp;Contactar&nbsp;&nbsp;</a>
                         <!--       <a href="https://biblus.us.es/bibing/proyectos/ayuda/" style=" color: #ffffff" class="enlace  ">&nbsp;&nbsp;Ayuda&nbsp;&nbsp;|</a> -->
                                <!-- <form id="idioma" class=""  method="post" action="">
                                <div class="inline" style="color: white">
                                <input type="submit" class="tipo_letra " style=" color: #ffffff"name="idioma" value="Castellanossss" />&nbsp;&nbsp;
                                </div>	
                                </form> -->

                                </td>

    </tr>
    </table>
</div>
<br><br>
<div class="colmask rightmenu">
<div class="panel panel-default" style="margin:20px">
            <div class="panel-heading"><h4>APLICACIÓN PARA LA GENERACIÓN Y ADMINISTRACIÓN DE LA CONFIGURACIÓN DE NAGIOS</h4><h5 style="color:grey"><span class="glyphicon glyphicon-user""></span> : <b>Bravo Ortiz, Agustín</b><br><span class="glyphicon glyphicon-book""></span>  :<b> Ingenier&iacute;a Telecomunicación</b></h5></div><div class="panel-body"><div class="contenido_proyecto"><div class="titulo2_explorador">Contenido del proyecto:</div><div class="ruta"><a href="use/abreproy/11449">Directorio ra&iacute;z</a>&nbsp;&nbsp;>&nbsp;&nbsp;<a href="use/abreproy/11449/direccion/sql%252F">sql</a>&nbsp;&nbsp;>&nbsp;&nbsp;<a href="use/abreproy/11449/direccion/sql%252Finstalldb.sql%252F">installdb.sql</a></div><div class="listing"></div></div></div></div>
</div>
</div>

        
	</body>
 
 
<!-- Inicio Google Analytics -->
<!--
	<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	
	<script type="text/javascript">
		try {
		var pageTracker = _gat._getTracker("UA-7789620-1");
		pageTracker._trackPageview();
	} 
		catch(err) {}
	</script>
-->
<!-- Fin Google Analytics -->

</html>

