> For the complete documentation index, see [llms.txt](https://docs.datasentinel.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasentinel.io/manual/features/key-features/alerting/settings.md).

# Settings

Turn alerting on for the platform and choose how notifications are sent: email, webhook or custom script.

## Activation

{% hint style="info" %}
Alerting is turned **off** by default on the platform.
{% endhint %}

To turn it on:

{% stepper %}
{% step %}

### Open the tools menu

<div align="left"><figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FjtvOaWdVdR3TkapgvvUQ%2Ftools_icon.png?alt=media&amp;token=99b0c7a9-8d88-4f40-b784-f7e6687c0043" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Click **Global settings**

<div align="left"><figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FyF2ObfgOFHJSio5vkd52%2Ftools_menu.png?alt=media&amp;token=6c019fe1-199f-492e-b794-56438546d86a" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Enable alerting and choose the notifications

<figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FRI3ZptGMzZxJV9OrdCFb%2Falerting_settings.png?alt=media&amp;token=e9d7ef40-dd0d-4153-99be-f182e8a57146" alt=""><figcaption><p>Alerting Settings</p></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
You can be notified of new problems, of recoveries, or of both.
{% endhint %}

## Notification types

Notifications can be sent in three ways. You can combine them.

{% hint style="info" %}
A problem stays visible in the interface once it is created, even when no notification type is enabled.
{% endhint %}

### Email

Email notifications need an [SMTP server](https://docs.datasentinel.io/manual/implementation/platform-usage/configuration/smtp.md) configured on the platform.

<div align="center" data-full-width="false"><figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2F6J84ERanOMCbyuLh6Qk0%2Fnotification-email.png?alt=media&amp;token=bfc85efb-7843-457f-af84-6141e1066259" alt=""><figcaption></figcaption></figure></div>

### Webhook

An HTTP **POST** request is sent to the URL you specify. Its body contains the following fields:

```json
{
        "event_time": "2022-10-05 10:19:27",
        "notification_type": "PROBLEM",
        "pg_instance": "server@crm-production",
        "check_name": "memory_usage",
        "check_state": "CRITICAL",
        "message": "Memory usage: 95% used (1730MB/1835MB) [>=95% - CRITICAL]",
        "extra_data": {
            "value": 96,
            "used": 2512,
            "total": 3000
        }
}
```

| Field               | Content                                                      |
| ------------------- | ------------------------------------------------------------ |
| `event_time`        | Time of the notification                                     |
| `notification_type` | `PROBLEM` or `RECOVERY`                                      |
| `pg_instance`       | PostgreSQL instance concerned                                |
| `check_name`        | Name of the rule                                             |
| `check_state`       | `WARNING`, `CRITICAL` or `OK`                                |
| `message`           | Description of the problem, with the value and the threshold |
| `extra_data`        | Values of the check. Its fields depend on the rule.          |

### Custom Script

The script must be executable and present on the platform server. It is executed at each notification and receives these parameters, in this order:

1. Event time
2. Notification type
3. PostgreSQL instance
4. Check name
5. State
6. Message

{% hint style="info" %}
The [Datasentinel toolkit](https://github.com/datasentinel/datasentinel_toolkit) on GitHub includes an example script.

The toolkit is pre-installed on the on-premises platform, in **`/datasentinel/soft/datasentinel_toolkit`**.
{% endhint %}

## Next step

Alerting is now on. Define the rules in the [Templates](https://docs.datasentinel.io/manual/features/key-features/alerting/templates.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.datasentinel.io/manual/features/key-features/alerting/settings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
