Creating Telegram Bot
Search: BotFather.
Click βStartβ to activate the BotFather bot.
Choose the command /newbot and Click.
Choose a name for your bot. Example: fujitestavalanche.
Choose a username for your bot. Example: fujitestavalanche_bot.
You will receive a message with a link to your bot t.me/nameyourbot.
After giving your bot username, your TOKEN will be available as noted below:
Note: Copy the alphanumeric code of your TOKEN , as we will use it later!
Note that TOKEN is the code right after βHTTP API:β.
Start communicating with our bot by entering the name of your bot in the search tab and choose it. Example: fujitestavalanche.
Click on the βStartβ button and you will be subscribed to your bot.
Type β/ start
β.
Obtain the CHAT ID (chat ID of the bot):
Two parameters: TOKEN and CHAT ID β are mandatory for creating the script for the real-time alert system of your Avalanche Network node.
We must remember that we already have a TOKEN.
First install the βjqβ utility, set your TOKEN variable and, using the curl command.
If CHAT_ID is not available, it's okay to type β
/ start
β three to four times, in the same way, re-enter the command linecurl -s https://api.telegram.org/bot$TOKEN/getUpdates | jq .result [0] .message.chat.id
until the CHAT_ID code appears.
The Avalanchego monitoring script, which includes the real-time alert system of your Avalanche network node, performs three fundamental checks every minute, as shown below:
Our Avalanchego monitoring script has two mandatory and two optional parameters, which are:
Avalanchego Monitoring Script Installation:
Test to verify that your script is working correctly:
In this script we are using the default parameters for a
40% CPU limit
and API call IP is127.0.0.1
.
crontab
file. Edit it via crontab -e
and remove or comment (put # at the beginning of the line) the related line as shown below: