# Discovery

Este plugin puede integrarse con el *Discovery* de Pandora FMS.

Para ello se debe cargar el paquete ".disco" que puede descargar desde la librería de Pandora FMS:

[https://pandorafms.com/library/](https://pandorafms.com/library/)

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-04/scaled-1680-/io5image.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-04/io5image.png)

Una vez cargado, se podrán monitorizar entornos de SAP HANA creando tareas de *Discovery* desde la sección *Management &gt; Discovery &gt; Aplications*.

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-04/scaled-1680-/Jteimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-04/Jteimage.png)

Para cada tarea se solicitarán los siguientes parámetros mínimos:

- **SAP HANA target string:** Dirección IP del host con SAP HANA, puerto, instancia de la base de datos.
- **Credenciales:** Usuario y contraseña de tipo Custom, para ello necesitaremos crear en el apartado *Management &gt; Configuration &gt; Credential store* una nueva credencial.

[![step2.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-04/scaled-1680-/step2.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-04/step2.png)

También se podrá ajustar la configuración de la tarea para personalizar la monitorización deseada:

- **Max threads**: Número máximo de hilos concurrentes que se utilizarán para ejecutar las consultas de monitorización.
- **Target agent**: Permite indicar manualmente el nombre de los agentes en los que se crearán los módulos. Se debe introducir un nombre de agente por cada *SAP HANA target string*, respetando el mismo orden. Si se deja vacío, el plugin creará los agentes automáticamente con el formato **HOST - DATABASE**.
- **Regexp to filter modules**: Habilita el filtrado de módulos mediante expresiones regulares.
- **Allow regexp**: Si se activa el filtro, solo se crearán los módulos cuyo nombre coincida con esta expresión regular.
- **Regexp to discard modules**: Habilita el descarte de módulos mediante expresiones regulares.
- **Deny regexp**: Si se activa el descarte, no se crearán los módulos cuyo nombre coincida con esta expresión regular.
- **Backups Size**: Crea el módulo *backups\_estimated\_size\_bytes*, con el tamaño estimado de los backups de SAP HANA.
- **Timestamp**: Crea el módulo *timestamp*, con la fecha/hora actual de la base de datos para verificar desfases temporales.
- **Hana Version**: Crea el módulo *version*, con la versión instalada de SAP HANA.
- **Data Disk Information**: Crea los módulos *volumes\_count* y *volumes\_io\_entries*, con información básica sobre volúmenes y actividad de E/S.
- **Hana Service Statistics**: Crea módulos por cada servicio SAP HANA detectado, incluyendo *ACTIVE\_STATUS*, *PROCESS\_CPU\_TIME*, *TOTAL\_CPU\_TIME*, *PROCESS\_MEMORY*, *TOTAL\_MEMORY*, *AVAILABLE\_MEMORY*, *ACTIVE\_REQUEST\_COUNT*, *PENDING\_REQUEST\_COUNT*, *ACTIVE\_THREAD\_COUNT*, *THREAD\_COUNT*, *OPEN\_FILE\_COUNT*, *REQUESTS\_PER\_SEC*, *RESPONSE\_TIME*, *START\_TIME* y *SYS\_TIMESTAMP*.
- **Hana CPU Time**: Crea los módulos *cpu\_total\_time\_ms*, *cpu\_process\_time\_ms* y *cpu\_service\_count*, con métricas agregadas del uso de CPU en los servicios SAP HANA.
- **Hana RS Fragmentation**: Crea el módulo *rowstore\_fragmentation\_pct*, con el porcentaje estimado de fragmentación del Row Store.
- **Hana License**: Crea los módulos *license\_expiration\_date*, *license\_days\_remaining*, *license\_memory\_limit*, *license\_hardware\_key*, *license\_installation\_number*, *license\_product\_name*, *license\_system\_id*, *license\_swproductname* y *license\_enforced*, con información de licencia del entorno SAP HANA.
- **Hana IO Stats**: Crea los módulos *io\_total\_read\_bytes*, *io\_total\_write\_bytes* e *io\_total\_time\_ms*, con métricas agregadas de lectura, escritura y tiempos de E/S.
- **Hana Get Stated Connections**: Crea los módulos *connections\_total*, *connections\_running*, *connections\_idle*, *connections\_queued*, *connections\_disconnected* y *connections\_unknown*, con el estado de las conexiones activas.
- **Hana Memory**: Crea los módulos *memory\_used\_bytes* y *memory\_allocation\_limit\_bytes*, con métricas de uso y límite de memoria.
- **Hana Transactions**: Crea los módulos *blocked\_transactions*, *blocked\_transactions\_distinct\_users* y *open\_transactions*, con información sobre transacciones abiertas y bloqueadas.
- **Execute custom queries**: Habilita la ejecución de consultas personalizadas definidas en el campo **Custom queries**.
- **Custom queries**: Permite crear varios módulos personalizados usando bloques *check\_begin*/*check\_end*.
- **Custom module prefix**: Define un prefijo que se concatenará al nombre de los módulos generados.
- **Custom modules (legacy)**: Permite declarar módulos personalizados con el formato heredado **module:query:type:description**.

[![image.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-05/scaled-1680-/u4uimage.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-05/u4uimage.png)

Ejemplos de custom queries:

```
check_begin
name connections_total
description Conexiones totales (SYS.M_CONNECTIONS)
operation value
target SELECT COUNT(*) FROM SYS.M_CONNECTIONS
datatype generic_data
unit conns
check_end

check_begin
name connections_active
description Conexiones activas RUNNING (SYS.M_CONNECTIONS)
operation value
target SELECT COUNT(*) FROM SYS.M_CONNECTIONS WHERE CONNECTION_STATUS = 'RUNNING'
datatype generic_data
unit conns
check_end

check_begin
name memory_used_bytes
description Memoria usada total (INSTANCE_TOTAL_MEMORY_USED_SIZE)
operation value
target SELECT COALESCE(SUM(INSTANCE_TOTAL_MEMORY_USED_SIZE),0) FROM SYS.M_HOST_RESOURCE_UTILIZATION
datatype generic_data
unit bytes
check_end

check_begin
name memory_allocation_limit_bytes
description Limite de asignacion de memoria (ALLOCATION_LIMIT)
operation value
target SELECT COALESCE(SUM(ALLOCATION_LIMIT),0) FROM SYS.M_HOST_RESOURCE_UTILIZATION
datatype generic_data
unit bytes
check_end

check_begin
name cpu_total_time_ms
description CPU total time agregado (TOTAL_CPU_TIME)
operation value
target SELECT COALESCE(SUM(TOTAL_CPU_TIME),0) FROM SYS.M_SERVICE_STATISTICS
datatype generic_data
unit ms
check_end

check_begin
name cpu_process_time_ms
description CPU process time agregado (PROCESS_CPU_TIME)
operation value
target SELECT COALESCE(SUM(PROCESS_CPU_TIME),0) FROM SYS.M_SERVICE_STATISTICS
datatype generic_data
unit ms
check_end

check_begin
name service_total_memory_bytes
description Memoria total agregada por servicios (TOTAL_MEMORY)
operation value
target SELECT COALESCE(SUM(TOTAL_MEMORY),0) FROM SYS.M_SERVICE_STATISTICS
datatype generic_data
unit bytes
check_end

check_begin
name service_available_memory_bytes
description Memoria disponible agregada (AVAILABLE_MEMORY)
operation value
target SELECT COALESCE(SUM(AVAILABLE_MEMORY),0) FROM SYS.M_SERVICE_STATISTICS
datatype generic_data
unit bytes
check_end

check_begin
name io_total_read_bytes
description IO total leido acumulado (TOTAL_READ_SIZE)
operation value
target SELECT COALESCE(SUM(TOTAL_READ_SIZE),0) FROM SYS.M_VOLUME_IO_TOTAL_STATISTICS
datatype generic_data
unit bytes
check_end

check_begin
name io_total_write_bytes
description IO total escrito acumulado (TOTAL_WRITE_SIZE)
operation value
target SELECT COALESCE(SUM(TOTAL_WRITE_SIZE),0) FROM SYS.M_VOLUME_IO_TOTAL_STATISTICS
datatype generic_data
unit bytes
check_end

check_begin
name io_total_time_ms
description Tiempo total de IO acumulado (TOTAL_IO_TIME)
operation value
target SELECT COALESCE(SUM(TOTAL_IO_TIME),0) FROM SYS.M_VOLUME_IO_TOTAL_STATISTICS
datatype generic_data
unit ms
check_end

check_begin
name rowstore_free_pct
description Rowstore porcentaje libre (FREE_SIZE/ALLOCATED_SIZE)
operation value
target SELECT CASE WHEN SUM(ALLOCATED_SIZE)=0 THEN 0 ELSE ROUND(SUM(FREE_SIZE)*100.0/SUM(ALLOCATED_SIZE),2) END FROM SYS.M_RS_MEMORY
datatype generic_data
unit %
min_warning 40
min_critical 20
inverse_warning 1
inverse_critical 1
check_end

check_begin
name hana_time_utc
description Timestamp UTC de la BD
operation value
target SELECT TO_VARCHAR(CURRENT_UTCTIMESTAMP) FROM DUMMY
datatype generic_data_string
check_end

check_begin
name hana_services_running
description Numero de servicios activos (ACTIVE_STATUS='YES')
operation value
target SELECT COUNT(*) FROM SYS.M_SERVICE_STATISTICS WHERE ACTIVE_STATUS = 'YES'
datatype generic_data
unit services
check_end
```

Ejemplos de legacy queries:

```
legacy_memory_used:SELECT COALESCE(SUM(INSTANCE_TOTAL_MEMORY_USED_SIZE),0) FROM SYS.M_HOST_RESOURCE_UTILIZATION:generic_data:Legacy memory usage
legacy_hana_version:SELECT VERSION FROM SYS.M_DATABASE:generic_data_string:Legacy HANA version
```