Customize notifications of monitoring results
You can select an event when checking a metric and configure notifications to be sent — if the event is met or not met, you will receive a notification.With this, you can identify problem areas during your audits.
Add a contact
You can receive notifications to email or phone, or via HTTP requests.Notifications to email and HTTP can be received free of charge, for notifications via SMS you need to buy an SMS package.
Email
Phone
HTTP request
-
In the Control Panel, on the top menu, click Products and select Network Monitoring.
-
Go to Reports and Notifications → Contacts tab.
-
Click Add Contact.
-
In the Name field, enter a name.
-
In the Contact field, select the method of receiving notifications — Email.
-
In the Email field, enter an email address.
-
Optional: check the Limit notification sending time checkbox and specify the sending time in the desired time zone.
-
Click Add.
-
In the Control Panel, on the top menu, click Products and select Network Monitoring.
-
Go to Reports and Notifications → Contacts tab.
-
Click Add Contact.
-
In the Name field, enter the name of the contact.
-
In the Contact field, select Phone as the method for receiving notifications.
-
Enter your phone number.
-
Optional: 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 is5ca8ada3938381ec79e881132b1fa3dac3
. -
In the Control Panel, on the top menu, click Products and select Network Monitoring.
-
Go to Reports and Notifications → Contacts tab.
-
Click Add Contact.
-
In the Name field, enter the name of the contact.
-
In the Contact field, select HTTP as the method for receiving notifications.
-
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.
-
Modify the php file and add a working script to it. You can use the example script.
-
Optional: check the Limit notification sending time checkbox and specify the sending time in the desired time zone.
-
Click Add.
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 for accessing 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
A separate notification is configured for each metric.
- In the Control Panel, on the top menu, click Products and select Network Monitoring.
- Open the Metrics tab.
- Open the metrics page → Notifications tab.
- Check the contacts to which you want the notification to be sent.
- Click New Notification.
- Customize the notification settings: the event, after how many failures, and at what frequency to send the notification.
- If you have selected contacts with a phone number, make sure you have a SMS package: in the top menu, click Products → Network Monitoring → see the number of remaining SMS in the upper right corner.To purchase additional SMS, click Order SMS, specify the quantity and click Pay for Service.
View public statistics
Another way to keep track of the status of metrics is on the public stats page.
In the control panel, go to Monitoring → Monitoring → click on the Public Statistics Page link .