Customize notifications of monitoring results
You can:
- Customize notifications by individual metric. Notifications can be received via email, phone, or HTTP requests. You can select the desired test event and notification frequency for the notification;
- set up a weekly summary report on the results of monitoring. The report comes to your e-mail every Monday and contains information about all checks performed over the last seven days.
You can also track the current status of metrics on the public statistics page.
Add a contact
You can receive metrics notifications by e-mail, SMS to your phone or via HTTP requests.You can receive e-mail and HTTP notifications for free, for SMS notifications you need to buy an SMS package.
Email can also be used to receive a weekly report.
Email
Phone
HTTP request
-
In the dashboard, from the top menu, click Products and select Monitoring.
-
Go to Reports and Notifications → Contacts tab.
-
Click Add Contact.
-
Enter the name of the contact, it will only appear in the control panel.
-
Select the contact type — Email.
-
Enter your mailing address.
-
Optionally, to ensure that notifications come only at certain times, check the Limit notification sending time checkbox and specify the sending time in the desired time zone.
-
Click Add.
-
An e-mail with a confirmation link will be sent to the specified e-mail address. To confirm your e-mail, open the link from the e-mail in any browser.
-
In the dashboard, from the top menu, click Products and select Monitoring.
-
Go to Reports and Notifications → Contacts tab.
-
Click Add Contact.
-
Enter the name of the contact, it will only appear in the control panel.
-
Select the contact type — Phone.
-
Enter your phone number.
-
Optionally, to ensure that notifications come only at certain times, check the Limit notification sending time checkbox and specify the sending time in the desired time zone.
-
Click Add.
-
Create a php file, such as log.php, in the directory with your site.
-
Add some code to the script to test it:
<?php
echo "<response>";
?>Specify
<response>
— the expected response is of the form5ca8ada3938381ec79e881132b1fa3dac3
. -
In the dashboard, from the top menu, click Products and select Monitoring.
-
Go to Reports and Notifications → Contacts tab.
-
Click Add Contact.
-
Enter the name of the contact.
-
Select the contact type — HTTP.
-
In the HTTP field, add the absolute address of the link to the file you created in step 1, for example,
http://domain.com/log.php
. -
Click Verify.
-
The expected response that you added to the file in step 2 will appear in the dashboard.
-
Optionally, to ensure that notifications come only at certain times, check the Limit notification sending time checkbox and specify the sending time in the desired time zone.
-
Click Add.
-
Modify the php file and add a working script to it. You can use the example script.
Example script
This script sends a message to Telegram if a new entry appears in the monitoring message log.
-
Start a dialog with the bot from your account and get a list of updates for your bot:
https://api.telegram.org/bot<token>/getUpdates
Specify
<token>
— the token to access your bot via API, which you received when creating the bot. -
Get the chat ID — copy the value of
the chat_id
parameter. -
Create a
log.php
file. -
Add the following script to the file:
<?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='Новая запись в файле мониторинга: <url>'");
$result=curl_exec($ch);
curl_close($ch);
}
?>Specify:
<chat-id>
— The chat ID or username of the user to whom you want to send a message;<token>
— Telegram bot key (token) of the form864190220:AAGY3To77NuySjaGmupS7PfEQy952V08QOA
;<url>
— link to a file of the formhttp://test-http-get.ru/modules/log/get.log
.
-
Create a
log
directory in the root directory of your site. -
In the directory, create a file named
get.log
where the log of GET requests will be saved. -
In the same directory, place the
log.php
file created in step 3.
Customize notification by metric
-
Make sure you have added the contacts for which you want to set up notifications. You can view the list of added contacts in the control panel: from the top menu, click Products → Monitoring → Reports and Notifications.
-
In the dashboard, from the top menu, click Products and select Monitoring.
-
Open the Metrics tab.
-
Open the metrics page → Notifications tab.
-
Mark the contacts to which you want to send notifications. All notifications in the metric will be sent to all marked contacts.
-
Click New Notification.
-
Customize the notification settings:
- which event you want to track;
- when to notify the event — immediately or after several consecutive checks that return the same event;
- What is the minimum frequency with which notifications should be sent, for example, no more than one notification per minute.
-
If you don't want to be notified that the check result has changed to successful — uncheck the Notify of recovery checkbox.
-
Click .
-
If you selected contacts with a phone number in step 5, make sure you have a SMS package: in the top menu, click Products → Monitoring → Reports and Notifications → in the upper right corner, see the number of remaining SMSs.To purchase additional SMSs, click Order SMS, specify the quantity and click Pay for Service.
Customize weekly report
All metrics are added by default to a free weekly report that is emailed on Mondays. The report contains the results of all metric checks for the last seven days.You can cancel adding a metric to the report when you create a metric or remove a metric from the report after it is created.
- In the dashboard, from the top menu, click Products and select Monitoring.
- Go to Reports and Notifications.
- Open the Reports tab.
- In the Weekly Report row, make sure the report is enabled.
- Check the e-mail addresses to which you want the report to be sent. If the desired address is not on the list, add it to your contacts and repeat steps 1-4.