Agoric & Netdata

Orangeclub
4 min readMar 29, 2021

--

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

  • Run /etc/netdata/edit-config health_alarm_notify.conf
  • 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! /usr/libexec/netdata/plugins.d/alarm-notify.sh test

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.

cd /etc/netdata
./edit-config health.d/ram.conf

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:

./edit-config health.d/cpu.conf

I’ll put $WARNING range from 1 to 3 and $CRITICAL from 3 to 10

And finally I’ll correct disk parameters:

./edit-config health.d/disks.conf

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:

- https://learn.netdata.cloud/docs/agent/health/quickstart
- https://learn.netdata.cloud/docs/agent/health/reference
- https://learn.netdata.cloud/docs/agent/health
- https://learn.netdata.cloud/docs/agent/daemon/config#health-section-options
- https://github.com/netdata/netdata/blob/master/docs/guides/monitor/dimension-templates.md

Sincerely, yours OranG3cluB

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Special for Agoric.

Website: https://agoric.com

Twitter: https://twitter.com/agoric

Github: https://github.com/agoric

Discord: https://discord.com/invite/qDW8DRes4s

Medium: https://medium.com/agoric

Telegram: https://t.me/agoricsystems

Youtube: https://www.youtube.com/channel/UCpY91oQLh_Lp0mitdZ5bYWg

--

--