GET /tickets

Obtiene la lista de tickets asociados a alertas definidos en el sistema.

GET /tickets.json Obtiene todos los tickets
GET /tickets/22.json
GET /tickets.json?id=22
Obtiene el ticket cuyo id es el 22.
GET /tickets.json?devicetype=linux Obtiene los tickets que cumplen los criterios de filtrado especificados.
En este caso de tipo linux.

Parámetros

Nombre Tipo Necesario Valor por defecto Descrpción
id Entero No Ninguno Identificador del ticket
alert Entero No Ninguno Identificador de la alerta
category Texto No Ninguno Categoría del ticket
description Texto No Ninguno Descripción del ticket
ticket Texto No Ninguno Identificador externo del ticket
introducido por el usuario
user Texto No Ninguno Usuario que ha creado el ticket
ticket Texto No Ninguno Referencia a ticket externo
type Texto No Ninguno alerts si el ticket está asociado a una alerta activa
store si el ticket está asociado a una alerta del histórico
devicename Texto No Ninguno Nombre del dispositivo
deviceip Texto No Ninguno Dirección IP del dispositivo
devicedomain Texto No Ninguno Dominio del dispositivo
alertdatelast_human Texto No Ninguno Fecha de la ultima actualización de la alerta
alertdatelast_timestamp Entero No Ninguno Timestamp de la última actualización de la alerta
alertdatefirst_human Texto No Ninguno Fecha de la creación de la alerta
alertdatefirst_timestamp Entero No Ninguno Timestamp de la creación de la alerta
alertcounter Entero No Ninguno Contador de la alerta
alerttype Texto No Ninguno Tipo de la alerta
alertack Entero No Ninguno 0: no tiene ack | 1: ack verde | 2: ack azul
3: ack rojo | 4: ack naranja | 5: ack amarillo
alertseverity Entero No Ninguno Severidad de la alerta (1: alerta roja | 2: alerta naranja | 3: alerta amarilla)
alertcause Texto No Ninguno Causa de la alerta

Códigos de respuesta

Código Descripción
200 Resultado correcto
400 Error en la petición.
401 Error de autenticación.
403 Error por falta de permisos.
500 Error interno del servidor

Valor devuelto

Devuelve un vector de datos codificado en json:


{"id":"4","alert":"1671","devicename":"windows7","deviceip":"192.168.2.142","category":"INCIDENCIA HARDWARE","description":"DISPOSITIVO INCOMUNICADO (ICMP) ERROR: 5 packets transmitted, 0 received, +2 errors, 100% packet loss, time  3999ms","ticket":"2222","user":"admin","type":"store","devicedomain":"s30labsi.com","alertdatelast_human":"2015-05-08 14:47:09","alertdatelast_timestamp":"1431089229","alertdatefirst_human":"2015-04-28 20:50:57","alertdatefirst_timestamp":"1430247057","alertcounter":"14017","alerttype":"latency","alertack":"0","alertseverity":"1","alertcause":"DISPOSITIVO INCOMUNICADO (ICMP)"}

Los campos se corresponden con los parámetros especificados previamente.

Ejemplos

cnm@cnm-devel:/opt/cnm/onm/api# curl -ki -H "Authorization: 854b5c0254572b995b3e96d8a05e31b9" "https://localhost/onm/api/1.0/tickets.json?deviceip=192.168.2.142"  

HTTP/1.1 200 OK
Date: Tue, 23 Jun 2015 10:45:56 GMT
Server: Apache/2.2.16 (Debian) PHP/5.3.3-7 with Suhosin-Patch proxy_html/3.0.1 mod_ssl/2.2.16 OpenSSL/0.9.8o mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.3-7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
:
Vary: Accept-Encoding
Content-Length: 7285
Content-Type: text/html; charset=utf-8 [{"id":"6","alert":"1844","devicename":"windows7","deviceip":"192.168.2.142","category":"INCIDENCIA HARDWARE","description":"SIN RESPUESTA SNMP sin respuesta snmp (Timeout)","ticket":"","user":"admin","type":"alerts","devicedomain":"s30labsi.com","alertdatelast_human":"2015-06-23 12:44:46","alertdatelast_timestamp":"1435056286","alertdatefirst_human":"2015-05-26 10:53:04","alertdatefirst_timestamp":"1432630384","alertcounter":"39005","alerttype":"snmp","alertack":"0","alertseverity":"1","alertcause":"SIN RESPUESTA SNMP"},{"id":"5","alert":"1180","devicename":"windows7","deviceip":"192.168.2.142","category":"INCIDENCIA HARDWARE","description":"TCP PORT 3389 (REMOTE DESKTOP) ERROR: IO::Socket::INET: connect: No route to host  Se ha abierto una incidencia en OTRS con los siguientes datos: Dispositivo: windows7 Tipo: Event Categoria: INCIDENCIA HARDWARE Elemento: SERVIDOR P\u00e9rdida de servicio: SI Severidad: 2 low Usuario: test2 ID en OTRS:   Se ha abierto una incidencia en OTRS con los siguientes datos: Dispositivo: windows7 Tipo: Event Categoria: INCIDENCIA HARDWARE Elemento: RED P\u00e9rdida de servicio: SI Severidad: 2 low Usuario: ipmi ID en OTRS: 2015060310000017","ticket":"2015060310000017","user":"admin","type":"alerts","devicedomain":"s30labsi.com","alertdatelast_human":"2015-06-23 12:44:46","alertdatelast_timestamp":"1435056286","alertdatefirst_human":"2015-02-27 12:40:42","alertdatefirst_timestamp":"1425037242","alertcounter":"152818","alerttype":"latency","alertack":"0","alertseverity":"1","alertcause":"TCP PORT 3389 (REMOTE DESKTOP)"},{"id":"4","alert":"1671","devicename":"windows7","deviceip":"192.168.2.142","category":"INCIDENCIA HARDWARE","description":"DISPOSITIVO INCOMUNICADO (ICMP) ERROR: 5 packets transmitted, 0 received, +2 errors, 100% packet loss, time 3999ms","ticket":"2222","user":"admin","type":"store","devicedomain":"s30labsi.com","alertdatelast_human":"2015-05-08 14:47:09","alertdatelast_timestamp":"1431089229","alertdatefirst_human":"2015-04-28 20:50:57","alertdatefirst_timestamp":"1430247057","alertcounter":"14017","alerttype":"latency","alertack":"0","alertseverity":"1","alertcause":"DISPOSITIVO INCOMUNICADO (ICMP)"},{"id":"3","alert":"1672","devicename":"windows7","deviceip":"192.168.2.142","category":"INCIDENCIA HARDWARE","description":"SIN RESPUESTA SNMP sin respuesta snmp (Timeout)","ticket":"1111","user":"admin","type":"store","devicedomain":"s30labsi.com","alertdatelast_human":"2015-05-08 14:47:11","alertdatelast_timestamp":"1431089231","alertdatefirst_human":"2015-04-28 20:50:57","alertdatefirst_timestamp":"1430247057","alertcounter":"14016","alerttype":"snmp","alertack":"0","alertseverity":"1","alertcause":"SIN RESPUESTA SNMP"},{"id":"2","alert":"1546","devicename":"windows7","deviceip":"192.168.2.142","category":"INCIDENCIA HARDWARE","description":"DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio Total = 64317550592.000000000  | v2:  Espacio Usado = 40033062912.000000000  | v3:  Espacio Libre = 24284487680.000000000  | v4:  Usado(%) = 62.240000000  | **ALERTA (V4>45) (62.24 > 45)** DISCO LLENO WMI Ejecutado script: linux_metric_wmi_disk.pl (RC=0) RCSTR=[OK] Metrica: WMI - DISCO C:  | v1:  Espacio T","ticket":"","user":"admin","type":"store","devicedomain":"s30labsi.com","alertdatelast_human":"2015-04-14 02:15:58","alertdatelast_timestamp":"1428970558","alertdatefirst_human":"2015-04-13 11:24:43","alertdatefirst_timestamp":"1428917083","alertcounter":"891","alerttype":"xagent","alertack":"0","alertseverity":"1","alertcause":"DISCO LLENO WMI"}]