How to Configure Telegram with Netdata for CPU, RAM load Alert

To Configure Telegram With Netdata CPU/RAM Load

Introduction:

Telegram is a super-fast and free messaging app that can work on all your devices at the same time. Netdata is a tool for observing, visualization, and troubleshooting solution for systems, containers, and applications. The open-source monitoring Agent operates in concert with Netdata Cloud to deliver single-node and infrastructure monitoring on a single pane of glass.

Configuration Steps:

Check the installed version of OS

[root@localhost ~]# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL=https://bugzilla.redhat.com/

Now Create account in Telegram and connect with @BotFather in telegram Now create a new Bot using following command

Now give username to bot Next connect @myidbot to your telegram Now create a a group in which you want to receive alerts from netdata Add myidbot into your channel Now to get group id post the command like below snap Now add your Bot Linuhelp_bot into your channel Now move to the Netdata location.

[root@localhost ~]# cd /etc/netdata/
[root@localhost netdata]# ll
total 432
-rw-r--r--. 1 root root  46919 Jan 13 10:47 \
drwxr-xr-x. 2 root root      6 Jan  9 04:48 charts.d
drwxr-xr-x. 2 root root      6 Jan  9 04:48 custom-plugins.d
-rwxr-xr-x. 1 root root   2045 Jan 18 03:59 edit-config
drwxr-xr-x. 2 root root      6 Jan  9 04:48 go.d
-rw-r--r--. 1 root root      0 Jan 12 01:43 health_
-rwxr--r--. 1 root root  46919 Jan 17 23:32 health_alarm_notify.conf
drwxr-xr-x. 2 root root     97 Jan 17 23:53 health.d
-rw-r--r--. 1 root root 339587 Jan  9 04:49 netdata.conf
drwxr-xr-x. 2 root root      6 Jan  9 04:48 node.d
lrwxrwxrwx. 1 root root     23 Jan 18 03:59 orig -> /usr/lib/netdata/conf.d
drwxr-xr-x. 2 root root      6 Jan  9 04:48 python.d
drwxr-xr-x. 2 root root      6 Jan  9 04:48 ssl

Now open below file and edit them accordingly shown below

[root@localhost netdata]# vim health_alarm_notify.conf
Update file as below

SEND_TELEGRAM="YES"
TELEGRAM_BOT_TOKEN="1588391551:AAEk9m_X_uDjAsU_pVOe39rGgRGZ-hk0JFY"
DEFAULT_RECIPIENT_TELEGRAM="-360570513"

Now see all the CPU Configuration for load alert

[root@localhost netdata]# cd health.d
[root@localhost health.d]# ll
total 56
-rw-r--r--. 1 root root 46870 Jan 11 10:34 \
-rw-r--r--. 1 root root  1680 Jan 17 23:53 cpu.conf
-rwxr--r--. 1 root root     0 Jan 12 06:59 health_alarm_notify.conf
-rw-r--r--. 1 root root   190 Jan 17 23:37 ram.conf
-rw-r--r--. 1 root root     0 Jan 13 10:20 ram.confcd
[root@localhost health.d]# vim cpu.conf
[root@localhost health.d]# vim ram.conf

After making changes restart the netdata

[root@localhost health.d]# systemctl restart netdata

Now open netdata dashboard This is the ram load alert This is the load alert telegram getting from netdata Now got the alert for CPU usage With this the configuration of telegram on Netdata comes to an end.

FAQ
Q
How to differentiate between a group id and chat id in telegram?
A
Group id always starts with -(hyphen).
Q
How to generate group id in telegram?
A
To generate groupid you have to connect myidbot to your group and then send command /getgroupid, it will generate a new group id.
Q
What is BotFather in telegram?
A
BothFather is a bot in telegram which generates a token number for your Netdata to connect to the telegram.
Q
Can I receive a live alert on Telegram for Netdata?
A
Yes, absolutely. All the alerts will be live according to your server activity.
Q
What is Netdata?
A
Netdata is an open-source tool designed to collect real-time metrics, such as CPU usage, disk activity, bandwidth usage, website visits, etc., and then display them in live, easy-to-interpret charts.