# Reminders

In this article we will look at how to configure alerts in GLPI.

An "**alert**" in GLPI is the combination of four concepts:

* A [Saved search](https://help.glpi-project.org/tutorials/notifications/broken-reference)
* An alert configured for this search
* An automatic action to trigger the alert
* A Notification

{% hint style="success" %}
**Case study to illustrate the concept**

I want to be alerted when the **`number of Tickets`** with the **`New`** status **`exceeds 4`**
{% endhint %}

Adapt the following method to your context (other examples: alert if the number of computers with the status "In stock" is less than 10, or alert if at least one server-type computer has less than 90% free disk space).

## Save a search

***

### Creating a search

First, we need to save the search on which we want to place an alert.

* In the menu **`Assistance`** > **`Tickets`** (in our case)
* Enter the search parameters in the search engine
* Start the **`search`**!

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-b98f1ff09fda8b8ccf8af127847ef2d91ef17779%2FEtre-alerte-1.png?alt=media)

* The search result is displayed

<div align="left"><img src="https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-11b9dcadc50c45ccaf30a10004a2167bf366381d%2FEtre-alerte-2.png?alt=media" alt="Alt text"></div>

***

### Save search

To save your search, click on the icon in the search engine.

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-bf97189795077df0f875dc9fc63813b84cc0b6ac%2FEtre-alerte-3bis.png?alt=media)

* Give your search a name
* Define its visibility (private in this case)
* The **`Count`** field defines whether you want the number of results to appear in a tooltip
* Choose the entity and the recursivity
* Click on **`add`**

The search is now saved.

***

### View saved searches

You can view your searches via the **`Lists`** icon at the top right of your interface:

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-d693ae9059fa8e5d86e3c8946fb6e330c8c9f907%2FEtre-alerte-5.png?alt=media)

The sliding banner will give you a list of your saved searches:

<div align="left"><img src="https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-661b5028a0c824b46a1947c6cb8a85578892d4e4%2FEtre-alerte-7.png?alt=media" alt="Alt text"></div>

Now just click on your search to display the results.

## Set up an alert for a saved search

* Go to **`Tools`** > **`Saved searches`**
* Choose the saved search on which you wish to place an alert
* In the **`Saved search alerts`** tab
* Click on **Add an alert**.

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-8241f05d8a1a2ff6ac56f976463a3ce7ed165888%2FEtre-alerte-8.png?alt=media)

Here you need to :

* Name this alert
* Choose the operator and value that will trigger the alert (strictly greater than 4 in our case)
* Make this alert active
* Click on **`add`**

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-64cd69412296df0fb4957dddee1104c6a1c7b061%2FEtre-alerte-9.png?alt=media)

Our alert is configured.

## Automatic action to trigger the alert

The principle is simple:

* You have configured a search linked to an alert.
* In this alert, you have defined a threshold that triggers the alert (in our example above, the alert is triggered if the number of Tickets in New status is strictly greater than 4).

An automatic action will therefore be run regularly to trigger these alerts; this is called **savedsearchesalerts**:

* Go to **`setup`** > **`Automatic actions`**.
* Click on **`savedsearchesalerts`**.
* Configure it according to your needs:

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-f98271772dfe5a412349e37d4e64d57b224e3051%2FEtre-alerte-10.png?alt=media)

{% hint style="warning" %}
**Warning**

Attention As this automatic action is global to your entire platform, we strongly recommend that you configure the execution frequency to be as low as possible in order to cover as many alerts as possible.
{% endhint %}

***

### Notification (by email)

The final step is to set up a notification that will be sent if the defined threshold is exceeded.

There are two possible scenarios:

* Alert on a saved search **Personal**
* Alert on a saved search **Public**

If the alert comes from a saved "Personal" (non-public) search, you will only need to create a single notification that will group together all your alerts. You will be the only recipient, so there is no need to multiply the number of emails.

If the alert comes from a search that has been saved as "Public", you will need to create a new notification. **Personal notification** :

* In the menu **`setup`** > **`Notifications`** > **`Notifications`**
* Choose the **`Saved searches`** notification
* Change it to **`Activated`**
* Click on **`Save`**

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-be2909c193133b5ea4b6fcf4a74873ff69f659c3%2FEtre-alerte-11.png?alt=media)

* On the **`Gabarits`** tab, you can specify whether you want an email notification and the notification template and/or an Ajax notification and the notification template.
* In the **Recipients** tab, it will only be possible to add **Users**.

**Public Notification**:

* The first step is to create the event that will be associated with the notification for this alert
* Go to **`Tools`** > **`Saved Searches`** Choose the saved search on which you want to create the event.
* Choose the saved search on which you want to be notified.

If the search is in public mode, go to the **`Search alerts`** tab and GLPI will ask you to create this event:

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-d080fba14ed046a5a1b56b539f5b34486b9f6d0c%2FEtre-alerte-12.png?alt=media)

* You will then need to click on the **`create now`** button.

Next, create the notification:

* **`setup`** > **`Notifications`** > **`Notifications`**
* Add a new notification
* Add a **`name`**
* Active : **`Yes`**
* Type : **`Saved search alert`**
* Event : choose the **`search desired`**
* Click on **`save`**

![Alt text](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-27344eb925af00da6b12e07168c1e28706a809d7%2FEtre-alerte-13.png?alt=media)

* In the "Templates" tab, you can specify whether you want an email notification and the notification template and/or an Ajax notification and the notification template.
* Finally, in the **Recipients** tab, you will need to add the desired recipients.

## References

GLPI documentation ["Notifications"](https://glpi-user-documentation.readthedocs.io/fr/latest/modules/setup/notifications/index.html)
