> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/copy-of-privado-editran-v5.3-cics/estadisticas-y-monitorizacion/gestion-de-alarmas.md).

# Gestión de alarmas

El objetivo del subsistema de Gestión de Alarmas es el control en la evolución normal de los procesos de la plataforma editran en cada una de las fases de la presentación y transmisión de los datos, de forma que si ocurre algún tipo de incidencia, se tenga la posibilidad de notificación inmediata de dichos problemas a distintos interlocutores (a través de correo electrónico, mensajes sms, notificación a gestor externo, etc.),  así como el guardar en un log dicha la información de la incidencia ocurrida.  También se pueden dar alarmas cuando se finalizan correctamente los posteriores a emisión o recepción.

Los tipos de alarmas pueden ser:

1. Alarmas a gestor externo.  Se proporciona un programa ejemplo. ZTBEBA10 que hace displays y que graba en el log de sistema.
2. Alarmas a e-mail. Estas pueden ser de 3 tipos:

* Alarmas a través del servidor SMTP del zOS.
* Alarmas a través del programa sendmail de la partición UNIX del zOS
* Alarmas a través de un gestor externo. En este caso, se establece una conexión ip entre el host y un servidor unix-pc-Windows, y este gestiona el envío. Para implementar el programa en el servidor consulte con INDRA.

3. Alarmas a móviles a través de un gestor externo. En este caso, se establece una conexion ip entre el host y un servidor unix-pc-Windows, y este gestiona el envío. Para implementar el programa en el servidor consulte con INDRA. En el servidor habrá que instalar un modem standard a 28800 con velocidad máxima a 57600 y el teléfono configurarlo con velocidad 58600, e intercambio de datos (fax/datos) con la opción recepción fax/dat marcada

El funcionamiento es el siguiente:

1. El usuario define en un fichero de perfiles y da de alta sesiones (con criterios genéricos o específicos), indicando como quiere realizar notificaciones cuando el proceso de emisión - recepción falla, ya sea en un procedimiento previo o posterior, como si se ha producido una interrupción con códigos determinados (para verlos consulte en editran/P los códigos A7I).  También se puede hacer para cuando el posterior funciona correctamente.
2. El usuario define un fichero de log, que contiene los datos de las sesiones que han fallado, el motivo y si se ha notificado a alguien el error.
3. Una vez que se produce un fallo, el sistema graba en log y notifica esta incidencia, si así se le indica.

## Definición de ficheros

La definición de los ficheros ZTBEFAL, ZTBEFPE se realizará con los jcl’s ZTBEJIAL, ZTBEJIPE respectivamente. Es importante destacar que el ZTBEFAL tiene shr (3,3).

## Modificación de los procedimientos de Onesait · Editran <a href="#toc303669325" id="toc303669325"></a>

En los procedimientos previos y posteriores a emisión y recepción, así como en el de interrupción (ZTBGP\*\*) se deben añadir las fichas de ficheros ZTBEFAL, ZTBEFPE.

```cobol
//ZTBEFPE  DD   DSN=puntero.ZTBEFPE,DISP=SHR
//ZTBEFAL  DD   DSN=puntero.ZTBEFAL,DISP=SHR
```

&#x20;También, se puede (se recomienda hacerlo) incluir un segundo paso en el procedimiento, a continuación del paso de carga, descarga, excepción, etc., de forma que si abenda dicho paso, entra este paso y la alarma es notificada. Si no se incluye este paso y abenda el anterior, la alarma no será notificada. Si la alarma es notificada, lo normal es que el paso anterior no abende (acabará con rc xx), de forma que este paso no entrará.&#x20;

```cobol
//      SET AB='ERROR ABEND CODE. CONSULTE SALIDA DEL JCL'          
//PASOERR  EXEC PGM=ZTBEBA00,COND=(ONLY),                           
//         PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP&AB',                
//         REGION=8M,TIME=25                                        
//STEPLIB  DD   DSN=puntero.LOAD,DISP=SHR                       
//ZTBEFPE  DD   DSN=puntero.ZTBEFPE,DISP=SHR                   
//ZTBEFAL  DD   DSN=puntero.ZTBEFAL,DISP=SHR                   
//ZTBPFPE  DD   DSN=puntero.ZTBPFPE,DISP=SHR                   
//ZTBGFPER DD   DSN=puntero.ZTBGFPER,DISP=SHR                  
//ZTBGFLOG DD   DSN=puntero.ZTBGFLOG,DISP=SHR                  
//ZTBGFPRI DD   SYSOUT=*,DCB=(BLKSIZE=105)                          
//* (INTERNAL READER DE LA IGA. PONGASE CLASE DE SALIDA DE TRABAJOS )
//ZTBGFINT DD   SYSOUT=(H,INTRDR),DCB=(BLKSIZE=80)                  
//SYSOUT   DD   SYSOUT=*,OUTLIM=999999                              
//SYSPRINT DD   SYSOUT=*,OUTLIM=999999                              
//SYSDBOUT DD   SYSOUT=*,OUTLIM=999999                              
//ABENDAID DD   SYSOUT=*,OUTLIM=999999                              
//SYSUDUMP DD   SYSOUT=*,OUTLIM=999999                              
//SYSABOUT DD   SYSOUT=*,OUTLIM=999999                              
//CEEDUMP  DD   SYSOUT=*,OUTLIM=999999
```

## Pruebas de instalación <a href="#toc303669326" id="toc303669326"></a>

Una vez instalado el producto, las pruebas consistirán en la definición de un perfil adecuado y carga con parámetros erróneos.

## Mensajes de error <a href="#toc303669327" id="toc303669327"></a>

Si se utiliza un gestor e-mail o sms externo y no se ha conseguido el envío, en el propio procedimiento se dan displays con información más detallada del problema.&#x20;

```
* ERRORES DEVUELTOS EN EL PROGRAMA ZTBEBITS                      *
* ================================                               *
* RESULTADO RAZON      DESCRIPCION                               *
* --------- --------------------------------------------------   *
*     91    ERROR EN EL SERVIDOR (FUNC. 301 ENVIAR E-MAIL)       *
*     92    ERROR EN EL SERVIDOR (FUNC. 302 ENVIAR SMS)          *
*     99    ERROR PROCESO REMOTO. ERROR PROGRAMA. ERROR CONEXION *
*           A SERVIDOR. ERROR MACROS TCP                         *
*       1X-3X ERRORES DE AREAS DE LLAMADA AL PROGRAMA ZTBEBITS   *
*           99/01 FUNCION DESCONOCIDA                            *
*           99/06 TCPNAME ERRONEO                                *
*           99/07 DIRECCION IP DEL SERVIDOR ERRONEA              *
*           99/08 PUERTO DEL SERVIDOR ERRONEO                    *
*           99/09 SEGUNDOS ACTIVACION SERVIDOR ERRONEOS          *
*           99/11 LONGITUD DE E-MAIL ERRONEA                     *
*           99/12 E-MAIL A ENVIAR ERRONEO                        *
*           99/15 LONGITUD DE SMS DE PERFIL ERRONEO              *
*           99/16 SMS DE PERFIL ERRONEO                          *
*           99/23 LONGITUD TEXTO ERRONEA                         *
*           99/24 TEXTO ERRONEO                                  *
*       5X  ERRORES DE TIEMPO TRANSCURRIDO EN SERVER             *
*           99/51 NO SE HA CONSEGUIDO ENVIAR EL ON (NI 1 OCTETO) *
*           99/52 NO SE HA CONSEGUIDO ENVIAR EL ON (ALGUN OCTETO)*
*           99/53 NO SE HA CONSEGUIDO ENVIAR DATOS (NI 1 OCTETO) *
*           99/54 NO SE HA CONSEGUIDO ENVIAR DATOS (ALGUN OCTETO)*
*           99/55 NO SE HA CONSEGUIDO RECIBIR DATOS(NI 1 OCTETO) *
*           99/56 NO SE HA CONSEGUIDO RECIBIR DATOS(ALGUN OCTETO)*
*           99/57 NO SE HA CONSEGUIDO ENVIAR EL OFF(NI 1 OCTETO) *
*           99/58 NO SE HA CONSEGUIDO ENVIAR EL OFF(ALGUN OCTETO)*
*       6X-7X ERRORES TCP/IP EN CONEXION CON EL SERVIDOR         *
*           99/61 ERROR EN MACRO INITAPI                         *
*           99/62 ERROR EN MACRO SOCKET                          *
*           99/63 ERROR EN MACRO GETHOSTBYNAME                   *
*           99/64 ERROR EN MACRO SETSOCKOPT                      *
*           99/65 ERROR EN MACRO FCNTL                           *
*           99/66 ERROR EN MACRO CONNECT                         *
*           99/67 ERROR EN MACRO SELECT DE ESCRITURA             *
*           99/68 ERROR EN MACRO READ                            *
*           99/69 ERROR EN MACRO SELECT DE LECTURA               *
*           99/70 ERROR EN MACRO WRITE                           *
*           99/71 ERROR EN MACRO EZACIC08                        *
*           99/72 ERROR EN MACRO EZACIC06                        *
*       8X  ERRORES EN LOS DATOS QUE DEVUELVE EL SERVIDOR        *
*           99/81 LONGITUD DE DATOS INVALIDA                     *
******************************************************************
```

Por ejemplo, se mostraría el siguiente display en el procedimiento, en caso en que el servidor no esté activo:&#x20;

```
*************************************************
*ERRORES DETECTADOS EN PROCESO TCP/IP EDITRAN/E*
-------------------------------------------------
                                                 
ERROR MACRO WRITE. ERRNO: 0000000061             
CODIGO DE RETORNO : 00099                        
CODIGO DE RAZON   : 00070                        
                                                 
*************************************************
En el log de alarmas, continuando el ejemplo anterior, aparecería, el siguiente error:
                                                 <----- RESULTADOS ----->         
                                                 EXT. <-- E-MAIL --> SMS          
             SESION            FECHA      HORA   R-01 R-02 R-03 R-04 R-05         
    ======================== ========== ======== ==== ==== ==== ==== ====         
    XXXXXXXXXXXXXXXXXXXXXXXX DD/MM/AAAA HH:MM:SS  00   00   00   99   00          
    ZTBGXXXX: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
 
* ERRORES DEVUELTOS EN EL PROGRAMA ZTBEBA00                      *
* ================================                               *
* RESULTADO RAZON      DESCRIPCION                               *
* --------- --------------------------------------------------   *
*     81    ERROR EN APERTURA ZTBGFINT                           *
*     82    ERROR EN ESCRITURA ZTBGFINT                          *
*     83    ERROR EN CIERRE ZTBGFINT                             *
*     84    ERROR AL ALOCAR FCOSMTP                              *
*     85    ERROR AL ABRIR FCOSMTP                               *
*     86    ERROR AL ESCRIBIR FCOSMTP                            *
*     87    ERROR AL CERRAR FCOSMTP                              *
*     88    ERROR AL DESALOCAR FCOSMTP                           *
```

## Parametrización correo electrónico SMTP

En los perfiles editran/E se pedirán 2 parámetros relacionados:

* Nombre del dominio de la máquina SMTP. Es el valor especificado en NJENODENAME
* Nombre del procedimiento de arranque.

Se configura de la siguiente forma (ejemplo):

```
;***********************************************************************
;
;  Defaults that normally aren't changed:
;
PORT 25                 ; Port to accept incoming mail
BADSPOOLFILEID tcpmaint ; Mailbox where unreadable spool files and
                        ; looping mail are transferred.
LOG                     ; Log all SMTP mail delivered
INACTIVE 180            ; Time-out for inactive connections
FINISHOPEN 120          ; Time-out for opening TCP connections
RETRYAGE 3              ; Keep retrying mail delivery for 3 days
WARNINGAGE 3            ; Warn sender that mail has been undeliverable
                        ; for 1 day, but that attempts to deliver the
                        ; mail will continue for another 2 days.
RETRYINT 2              ; Retry mail delivery every 2 horas
;ETRYINT 120            ; Retry mail delivery every 2 horas
MAXMAILBYTES 524288     ; Largest mail to accept over a TCP connection
RESOLVERRETRYINT 20     ; Retry pending name resolutions every 20 minutes
RCPTRESPONSEDELAY 60    ; How long to delay RCPT TO: response when
                        ; waiting for an address resolution.
TEMPERRORRETRIES 0      ; How many times to retry temporary delivery
                        ; errors.  The default, 0, means retry for
                        ; RETRYAGE days; otherwise the mail is returned
                        ; after this number of deliver attempts.
SPOOLPOLLINTERVAL 30    ; Amount of time in seconds between spool polling
TIMEZONE EST            ; Specifies the printable 3-letter name of
                        ; the local time zone.  Remember to change this
                        ; for daylight saving time.
DEBUG                 ; Normally not used, causes debug information to
                        ; be written to the SMTP DEBUG file.
;
NJENODENAME NODOMVSB
;***********************************************************************
;
; The following statements tell SMTP where incoming mail is stored
; while it is being queued for delivery.
;
MAILFILEDSPREFIX SMTP   ; Data set prefix name for queued mail files
MAILFILEUNIT SYSDA      ; MVS unit name for new file allocations
; MAILFILEVOLUME volume ; MVS volume name for new file allocations
;
;***********************************************************************
;
; The POSTMASTER statement specifies the mailboxes where mail
; addressed to postmaster is spooled.  Multiple POSTMASTER statements
; can be specified when not running in SECURE mode.
;
POSTMASTER tcpmaint
;
;***********************************************************************
;
; Use the SMSGAUTHLIST statement to specify the addresses of local
; users authorized to issue privileged SMTP SMSG commands.
;
SMSGAUTHLIST
    TCPMAINT
    SWTJLAM
ENDSMSGAUTHLIST
;
;***********************************************************************
;
; The OUTBOUNDOPENLIMIT statement specifies the maximum number of
; simultaneous TCP connections over which SMTP will actively deliver
; mail.
;
OUTBOUNDOPENLIMIT 10
;
;***********************************************************************
;
; The REWRITE822HEADER statement specifies whether SMTP will
; rewrite the RFC822 headers on all mail passing from NJE to TCP
; through the mail gateway.  The SMTP.RULES data set specifies how the
; server is to rewrite the headers.
;
; The PRINT | NOPRINT options specify whether SMTP will print
; the rules to the SMTP output when SMTP starts.
;
REWRITE822HEADER YES PRINT
;
;***********************************************************************
IPMAILERADDRESS 192.168.15.22
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.editran.onesait.com/documentacion-editran/copy-of-privado-editran-v5.3-cics/estadisticas-y-monitorizacion/gestion-de-alarmas.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
