From 97773c924a9fb72b2429cf5dcd544da3d949f3a2 Mon Sep 17 00:00:00 2001 From: yungwine Date: Thu, 10 Oct 2024 21:34:37 +0400 Subject: [PATCH 1/4] add MyTonCtrl alert bot docs --- docs/participate/run-nodes/alerting.md | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 docs/participate/run-nodes/alerting.md diff --git a/docs/participate/run-nodes/alerting.md b/docs/participate/run-nodes/alerting.md new file mode 100644 index 0000000000..32dcbfd18b --- /dev/null +++ b/docs/participate/run-nodes/alerting.md @@ -0,0 +1,55 @@ +# MyTonCtrl Alert Bot + +## Overview + +MyTonCtrl Alert Bot is a tool that allows you to receive notifications about the status of your node via Telegram Bot. +It is a part of the MyTonCtrl toolset and is available for both validators and liteservers. + +## Setup + +To set up the MyTonCtrl Alerting Bot, follow these steps: + +### Prepare bot + +1. Go to https://t.me/BotFather and create bot using command `/newbot`. After that, you will receive a `BotToken`. +2. Go to your bot and press the `Start` button. This will allow you to receive messages from the bot. +3. If you want to receive messages from the bot in a group (chat), add the bot to the group and give it the necessary rights (make group admin). +4. Go to https://t.me/getmyid_bot and press the `Start` button. It will reply you with your `ChatId`, use that if you want to receive messages directly to your Telegram account. +If you want to receive messages in a group, add the bot to the group, and it will reply with the `ChatId` of the group. + +### Enable the Alert Bot + +1. Enable `alert-bot` via command + + ```bash + MyTonCtrl> enable_mode alert-bot + ``` +2. Run command + + ```bash + MyTonCtrl> set BotToken + ``` +3. Run command + + ```bash + MyTonCtrl> set ChatId + ``` +4. Restart `mytoncore` service using command + + ```bash + $ sudo systemctl restart mytoncore + ``` + +## Supported Alerts + +The MyTonCtrl Alert Bot supports the following alerts: + +* Validator's wallet balance is low +* Node's db usage is more than 80% +* Node's db usage is more than 95% +* Validator had low efficiency in the round +* Node is out of sync +* Node is not running (service is down) +* Node is not answering to ADNL connection +* Validator created zero blocks for past 6 hours +* Validator has been slashed in the previous validation round From 8c6a27a423693aea5f9d66eaa3939ba226ba4613 Mon Sep 17 00:00:00 2001 From: yungwine Date: Thu, 10 Oct 2024 17:31:22 +0400 Subject: [PATCH 2/4] update sidebars --- sidebars/develop.js | 1 + 1 file changed, 1 insertion(+) diff --git a/sidebars/develop.js b/sidebars/develop.js index 04ac4b68d4..84f702fee5 100644 --- a/sidebars/develop.js +++ b/sidebars/develop.js @@ -214,6 +214,7 @@ module.exports = [ label: 'MyTonCtrl', items: [ 'participate/run-nodes/mytonctrl', + 'participate/run-nodes/alerting', 'participate/run-nodes/mytonctrl-status', ], }, From 8371885cc77d0b8de99a87e12aa14098d3475c8a Mon Sep 17 00:00:00 2001 From: yungwine Date: Thu, 17 Oct 2024 21:45:12 +0400 Subject: [PATCH 3/4] update alerting.md --- docs/participate/run-nodes/alerting.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/participate/run-nodes/alerting.md b/docs/participate/run-nodes/alerting.md index 32dcbfd18b..c4bea62f1f 100644 --- a/docs/participate/run-nodes/alerting.md +++ b/docs/participate/run-nodes/alerting.md @@ -40,6 +40,13 @@ If you want to receive messages in a group, add the bot to the group, and it wil $ sudo systemctl restart mytoncore ``` +5. Check that the bot is able to send messages by running the command + + ```bash + MyTonCtrl> test_alert + ``` + You should receive a message from the bot in your Telegram account or chat. + ## Supported Alerts The MyTonCtrl Alert Bot supports the following alerts: @@ -53,3 +60,11 @@ The MyTonCtrl Alert Bot supports the following alerts: * Node is not answering to ADNL connection * Validator created zero blocks for past 6 hours * Validator has been slashed in the previous validation round + +## En(dis)bling Alerts + +To enable or disable alerts, use the following commands: + +* To enable an alert, use the command `enable_alert `. +* To disable an alert, use the command `disable_alert `. +* To check the status of alerts, use the command `alerts_list`. From e4a5487229bb836fad12cca4b0f3be470fdf5dc3 Mon Sep 17 00:00:00 2001 From: yungwine Date: Fri, 25 Oct 2024 13:33:46 +0400 Subject: [PATCH 4/4] Update alerting.md --- docs/participate/run-nodes/alerting.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/participate/run-nodes/alerting.md b/docs/participate/run-nodes/alerting.md index bded533ef6..6a57f70ecf 100644 --- a/docs/participate/run-nodes/alerting.md +++ b/docs/participate/run-nodes/alerting.md @@ -34,12 +34,8 @@ If you want to receive messages in a group, add the bot to the group, and it wil ```bash MyTonCtrl> set ChatId ``` -4. Restart `mytoncore` service using command - ```bash - $ sudo systemctl restart mytoncore - ``` -5. Check that the bot is able to send messages by running the command +4. Check that the bot is able to send messages by running the command ```bash MyTonCtrl> test_alert @@ -67,4 +63,4 @@ To enable or disable alerts, use the following commands: * To enable an alert, use the command `enable_alert `. * To disable an alert, use the command `disable_alert `. -* To check the status of alerts, use the command `alerts_list`. +* To check the status of alerts, use the command `list_alerts`.