# Platform Diagnostics Tools

These tools collect and display key information about the Datasentinel platform, making it easier to troubleshoot problems efficiently and provide faster resolutions.

## Diagnostics

```bash
/datasentinel/soft/datasentinel_backend/scripts/datasentinel_diagnostics.sh
```

This script provides:

1. **Detailed OS Information** – Including memory usage by Datasentinel components (+ InfluxDB) and data directory sizes.
2. **InfluxDB Diagnostics** – Connects to the InfluxDB database to retrieve retention policies, system metrics, shard usage, and configuration settings.
3. **Monitored Instance Details** – Displays key information about all monitored PostgreSQL instances.

{% hint style="warning" %}
The script outputs the information directly in the terminal and also writes the results to a file located at:\
\&#xNAN;**`/tmp/datasentinel_diagnostics_<HOST_NAME>.txt`**
{% endhint %}

## Compress log files

```bash
/datasentinel/soft/datasentinel_backend/scripts/compress_log_files.sh
```

This script compress backend log files from `/datasentinel/log` and creates `/tmp/datasentinel_trace_files.tar.gz` for support use.

## SQL Collection Limit Analysis

```bash
/datasentinel/soft/datasentinel_backend/scripts/dump_top_instance_query_texts.sh 10
```

This script identifies the top N PostgreSQL instances that have reached their **daily SQL collection limit** and extracts the **query texts** collected for the current day.&#x20;

It accepts an optional parameter to specify the **top N instances** (default 5) to include in the output.

It helps analyze which queries were captured before the limit was hit, providing useful insights for troubleshooting or fine-tuning monitoring settings.

{% hint style="warning" %}
The results are saved to files **`/tmp/<INSTANCE_NAME>.txt`**
{% endhint %}
