---
title: "Configure availability check notifications"
sidebar_label: "Configure notifications"
description: "How to add contacts for notifications, how to configure notifications for a specific check, how to configure a weekly report"
sidebar_position: 3
toc_max_heading_level: 2
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import AddEmail from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/availability-check/add-email.mdx'
import CheckIcon from '@selectel/docux/icons/check'

# Configure reports and notifications for availability check results

You can:

* [configure notifications for a specific check](#configure-check-notification). Notifications can be received via email, phone, or HTTP requests. You can select the desired event—the check result that triggers a notification—and specify the notification frequency;
* [configure a summary weekly report](#configure-weekly-report) for all checks over the week. The report is sent via email every Monday and contains information about all checks performed over the last seven days.

You can also track the current status of checks on the [public statistics page](/availability-check/public-statistics-page.mdx).

## Add contact \{#add-contact}

You can receive notifications about checks via email, SMS to your phone, or via HTTP requests.Email and HTTP notifications are free; for SMS notifications, you need to purchase an SMS package.

Email can also be used to receive the [weekly report](#configure-weekly-report).

<Tabs queryString="add-contact">
  <TabItem value="email" default>
    <TabItemLabel>
      Email
    </TabItemLabel>

    <AddEmail />
  </TabItem>

  <TabItem value="phone" default>
    <TabItemLabel>
      Phone
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/availability-check/reports), on the top menu, click **Products** and select **Availability Check**.

    2. Go to **Reports and notifications** → **Contacts** tab.

    3. Click **Add contact**.

    4. Enter a contact name; it will be displayed only in the control panel.

    5. Select the type of contact — **Phone**.

    6. Enter the phone number.

    7. Optional: to receive notifications only at specific times, select the **Limit notification time** checkbox and specify the sending time in the required time zone.

    8. Click **Add**.
  </TabItem>

  <TabItem value="http-request">
    <TabItemLabel>
      HTTP request
    </TabItemLabel>

    1. Create a php file in the directory with your site, for example **log.php**.

    2. Add the following code to your script for verification:

       ```php
       <?php
       echo "<response>";
       ?>
       ```

       Specify `<response>` — an expected response of the form `5ca8ada39381ec79e881132b1fa3dac3`.

    3. In the [control panel](https://my.selectel.ru/availability-check/reports), on the top menu, click **Products** and select **Availability Check**.

    4. Go to **Reports and notifications** → **Contacts** tab.

    5. Click **Add contact**.

    6. Enter the contact name.

    7. Select the type of contact — **HTTP**.

    8. In the **HTTP** field, add the absolute URL to the file you created in step 1, for example `http://domain.com/log.php`.

    9. Click **Verify**.

    10. The expected response you added to the file in step 2 will appear in the control panel.

    11. Optional: to receive notifications only at specific times, select the **Limit notification time** checkbox and specify the sending time in the required time zone.

    12. Click **Add**.

    13. Modify the php file and add a working script to it. You can use the [example script](#script-example).

    ### Example script \{#script-example}

    This script sends a message to Telegram if a new entry appears in the check log. The check log can be viewed in the [control panel](https://my.selectel.ru/availability-check/history): in the top menu, click **Products** → **Availability Check** → **Check Log** tab.

    1. Start a conversation with the bot from your account and get a list of updates for your bot:

       ```bash
       https://api.telegram.org/bot<token>/getUpdates
       ```

       Specify `<token>` — an API access token for your bot that you received when creating the bot.

    2. Get the chat ID — copy the value of the `chat_id` parameter.

    3. Create a file named `log.php`.

    4. Add the following script to the file:

       ```php
       <?php
       $file_get = $_SERVER["DOCUMENT_ROOT"] . "/modules/log/get.log";
       if (!empty($_GET)) {
           $fw = fopen($file_get, "a");
           fwrite($fw, "GET " . var_export($_GET, true));
           fclose($fw);
           $ch = curl_init();
           curl_setopt($ch, CURLOPT_URL,
       "https://api.telegram.org/bot<token>/sendMessage?chat_id=<chat_id>&text='New entry in checks log: <url>'");
           $result=curl_exec($ch);
           curl_close($ch);
           }
       ?>
       ```

       Specify:

       * `<chat-id>` — the chat ID or username of the user to whom the message should be sent;
       * `<token>` — the Telegram bot key (token) of the form `864190220:AAGY3To77NuySjaGmupS7PfEQy952V08QOA`;
       * `<url>` — a link to a file of the form `http://test-http-get.ru/modules/log/get.log`.

    5. Create a `log` directory in the root directory of your site.

    6. In that directory, create a file named `get.log` where the GET request log will be saved.

    7. Place the `log.php` file created in step 3 into this same directory.
  </TabItem>
</Tabs>

## Configure notifications for a check \{#configure-check-notification}

1. Make sure you have [added contacts](#add-contact) for which you want to configure notifications. You can view the list of added contacts in the [control panel](https://my.selectel.ru/availability-check/reports): on the top menu, click **Products** → **Availability Check** → **Reports and notifications**.

2. In the [control panel](https://my.selectel.ru/availability-check/reports), on the top menu, click **Products** and select **Availability Check**.

3. Open the **Checks** tab.

4. Open the check page → **Notifications** tab.

5. Select the contacts to which notifications should be sent. All notifications for the check will be sent to all selected contacts.

6. Click **New notification**.

7. Configure the notification settings:

   7.1. Select which event—the check request result—you want to monitor.

   7.2. Select when to be informed about the event (send a notification)—immediately or after several consecutive requests that return the same event.

   7.3. Select the notification frequency, for example, no more than one notification per minute.

8. If you do not want to receive notifications when a check result changes to successful, clear the **Notify on recovery** checkbox.Recovery notifications are not sent at the moment of recovery, but at the notification frequency you specified in step 7.For example, if a server recovers within a minute, but the notification frequency is set to once per hour, the recovery notification will be sent an hour after the failure notification.

9. Click .<CheckIcon />

10. If you selected contacts with a phone number in step 5, ensure you have an SMS package: in the top menu, click **Products** → **Availability Check** → **Reports and Mailings** → in the top right corner, check the number of remaining SMS messages. To purchase additional SMS messages, click **Order SMS**, specify the quantity, and click **Pay for service**.

## Configure a weekly report \{#configure-weekly-report}

All checks are added by default to the free weekly report sent by email on Mondays. The report contains the results of all checks from the last seven days. You can remove a check from the report when [creating a check](/availability-check/create-check.mdx) or [remove a check from the report](/availability-check/manage-checks.mdx#remove-check-from-weekly-report) after it has been created.

1. In the [Control panel](https://my.selectel.ru/availability-check/reports), in the top menu click **Products** and select **Availability Check**.
2. Go to the **Reports and Mailings** section.
3. Open the **Reports** tab.
4. In the **Weekly report** row, ensure that the report is enabled.
5. Select the email addresses to which the report should be sent. If the required address is not in the list, [add it to contacts](#add-contact) and repeat steps 1-4.

<Formbricks />
