1. Registering and configuring your personal account
Hello! I want to show you how to use the site https://www.netdata.cloud, it will help you create a system of informing you about server problems. In my case, I will set up sending notifications using the bot in telegram. So, go to the site and create an account.
First of all, let’s install it on the server. Push “enter” and “yes” every time you are asked to do so during the installation process.
bash <(curl -Ss https://my-netdata.io/kickstart.sh) --stable-channel
If you see this after installation — you are good!
Go into your account at www.netdata.cloud and get claim command:
Now copy it:
Paste this command to your terminal and you will see your node in netdata:
2. Set up a telegram bot
Open in telegram: @BotFather and create a new bot and name it as you wish, after that you will choose username, but there must be the word “bot”at the end. For example, I create “agoric123409bot” for me. You will get an API key that looks like: AAAA:BBBBBBBBBBBBBBBBBBB
- Create group chat and invite your bot you just created and another one: @myidbot. My group: https://t.me/agoric123409 You can see alarms there.
- Write /getgroupid@myidbot and you will get ID of your new created group.
- Replace “AAAA:BBBBBBBBBBBBBBBBBBB” and “-XXXXXX” with you bot’s API key and groupid, which you received earlier and send test message to group via the bot using a bash command :
curl -X POST "https://api.telegram.org/botAAAA:BBBBBBBBBBBBBBBBBBB/sendMessage" -d "chat_id=-XXXXXX&text=my sample text"
If you did everything correctly, you will see the text in your chat:
3. Server setting
- Find TELEGRAM_BOT_TOKEN=”” and put there your API key. (remember? it’s like “AAAA:BBBBBBBBBBBBBBBBBBB”)
- Find DEFAULT_RECIPIENT_TELEGRAM=”” and paste there your group id “-XXXXXX”
- Save changes & Restart netdata:
systemctl restart netdata
- Let’s test it!
After that you’ll receive messages to your chat with bot:
Now I will set low system settings to check if the bot is working correctly.
Take a look here:
I’ll put $WARNING range from 1 to 5 % usage and $CRITICAL from 5 to 10, % usage, like this:
Also I’ll correct CPU alarms:
I’ll put $WARNING range from 1 to 3 and $CRITICAL from 3 to 10
And finally I’ll correct disk parameters:
I put $WARNING from 1 to 5 and CRITICAL from 5 to 15
Save changes and restart netdata!
systemctl restart netdata
After few seconds we received information about critical RAM & CPU usage:
Now I will return these parameters to normal values. However, you can set any parameters that you consider worthy of your attention.
You can configure alerts to match your requests by further reading the netdata documentation:
Sincerely, yours OranG3cluB
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Special for Agoric.