# Settings

## Activation

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

To activate this feature

* Open 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%2F0zuFbzdmQRfREEh6zJJ5%2Ftools_icon.png?alt=media&#x26;token=0c845c73-011b-45f3-a43b-24ba9e6687a2" alt=""><figcaption></figcaption></figure></div>

* Click on **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%2FpJO1aE35o9g23oUW4kuk%2Ftools_menu.png?alt=media&#x26;token=f9b66758-031c-4426-9998-8a2b15b6564b" alt=""><figcaption></figcaption></figure></div>

* Then

<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&#x26;token=e9d7ef40-dd0d-4153-99be-f182e8a57146" alt=""><figcaption><p>Alerting Settings</p></figcaption></figure>

{% hint style="info" %}
You can opt for notifications regarding new problems **and/or** problem resolutions.
{% endhint %}

## Notification types

You have the option to receive notifications in three different ways.

{% hint style="info" %}
Problems persistently appear on the UI after creation, remaining visible even without an active notification.
{% endhint %}

### Email

Prior to email report delivery, configuring an [SMTP server](https://docs.datasentinel.io/manual/implementation/platform-usage/configuration/smtp) is necessary.

<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&#x26;token=bfc85efb-7843-457f-af84-6141e1066259" alt=""><figcaption></figcaption></figure></div>

### Webhook

A http **POST** request is sent to the specified url with a body containing 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
        }
}
```

*The `extra_data` field can contain different fields depending on the check\_name*

### Custom Script

The script must be executable and present on the platform server. It is executed at each notification and receive the following parameters:

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

{% hint style="info" %}
A [GitHub repository](https://github.com/datasentinel/datasentinel_toolkit) with a comprehensive toolkit that includes usage examples is accessible.\
\
The toolkit comes pre-installed on the on-premises platform and can be found at the following directory: **`/datasentinel/soft/datasentinel_toolkit`**.
{% endhint %}
