Customize notifications
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 the audits.
Add a contact
You can receive notifications by e-mail or phone, or via HTTP requests. Notifications to e-mail and HTTP can be received free of charge, for notifications by SMS you need to buy an SMS package.
Email
Phone
HTTP request
-
В control panels from the top menu, press Products and select Network monitoring.
-
Go to the section Reports and notifications → tab Contacts.
-
Click Add a contact.
-
In the field Name enter a name.
-
In the field Contact select how you want to receive notifications — Email.
-
In the field Email enter your email address.
-
Optional: check the checkbox Limit the time notifications are sent and specify the time of shipment in the desired time zone.
-
Click Add.
-
В control panels from the top menu, press Products and select Network monitoring.
-
Go to the section Reports and notifications → tab Contacts.
-
Click Add a contact.
-
In the field Name enter the name of the contact.
-
In the field Contact select how you want to receive notifications — Phone.
-
Enter your phone number.
-
Optional: check the checkbox Limit the time notifications are sent and specify the time of shipment in the desired time zone.
-
Click Add.
-
Create a php file in the directory with your site, for example, log.php.
-
Add some code to the script to test it:
<?php
echo "<response>";
?>Specify
<response>
— expected response5ca8ada39381ec79e881132b1fa3dac3
. -
В control panels from the top menu, press Products and select Network monitoring.
-
Go to the section Reports and notifications → tab Contacts.
-
Click Add a contact.
-
In the field Name enter the name of the contact.
-
In the field Contact select how you want to receive notifications — HTTP.
-
In the field HTTP add the absolute address of the link to the file you created in step 1, for example,
http://domain.com/log.php
. -
Click Check it out.
-
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 sample script.
-
Optional: check the checkbox Limit the time notifications are sent and specify the time of shipment 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>
— token to access your bot via API, which you received when you created the bot. -
Get chat ID — copy the value of the parameter
chat_id
. -
Create a file
log.php
. -
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 you want to send a message to;<token>
— Telegram bot key (token) of the following form864190220:AAGY3To77NuySjaGmupS7PfEQy952V08QOA
;<url>
— file referencehttp://test-http-get.ru/modules/log/get.log
.
-
Create a directory in the root directory of your site
log
. -
In the directory, create a file named
get.log
where the log of GET requests will be saved. -
In the same directory, place the file
log.php
created in step 3.
Customize notification
A separate notification is configured for each metric.
- В control panels from the top menu, press Products and select Network monitoring.
- Open the tab Metrics.
- Open the metrics page → tab Notifications.
- Check the contacts to which you want the notification to be sent.
- Click New notice.
- 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 texting package: from the top menu, press Products → Network monitoring → see the number of remaining SMS in the upper right corner. To purchase additional SMSs, press Order SMS, enter the quantity and press Pay for the service.
View public statistics
Another way to keep track of the status of metrics is on the public stats page.
В control panels go to Monitoring → Monitoring → click on the link Public statistics page.