How to configure CPURAM Load Alarm in Netdata On Debian 12

To Configure CPU/RAM Load Alarm In Netdata On Debian 12

Introduction:

Netdata is a comprehensive monitoring, visualization, and troubleshooting tool for systems, containers, and applications. It offers a wide array of pre-configured alarms developed by the Netdata community of system administrators to address critical aspects of production systems. As such, users often find these alarms to be sufficient without the need for further customization.

Configuration Process:

Step 1: Check the OS version by using the below command.

root@linuxhelp:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Step 2: Go to Browser and Search IP address with port number for checking Netdata alarm as shown in below image.

Step 3: Move to the netdata configuration file location by using the below command.

root@linuxhelp:~# cd /etc

Step 4: Long list the files for Search the Netdata by using the below command.

root@linuxhelp:/etc# ls -la | grep netdata
drwxr-xr-x  10 root root    4096 May 12 23:06 netdata

Step 5: move into the Netdata directory by using the below command.

root@linuxhelp:/etc# cd netdata

Step 6: List the files by using the below command.

root@linuxhelp:/etc/netdata# ls -la
total 72
drwxr-xr-x  10 root root  4096 May 12 23:06 .
drwxr-xr-x 133 root root 12288 May 13 04:45 ..
drwxr-xr-x   2 root root  4096 May 12 07:41 charts.d
drwxr-xr-x   2 root root  4096 May 12 05:53 custom-plugins.d
-rwxr-xr-x   1 root root  8904 May 12 05:49 edit-config
drwxr-xr-x   2 root root  4096 May 12 05:53 go.d
drwxr-xr-x   2 root root  4096 May 12 05:53 health.d
-rw-r--r--   1 root root    69 May 12 05:50 .install-type
drwxr-xr-x   2 root root  4096 May 12 05:53 logsmanagement.d
-rw-r--r--   1 root root   326 May 12 05:49 netdata.conf
-rw-r--r--   1 root root  2021 May 12 05:49 netdata-updater.conf
drwxr-xr-x   2 root root  4096 May 12 05:53 python.d
drwxr-xr-x   2 root root  4096 May 12 05:53 ssl
drwxr-xr-x   2 root root  4096 May 12 05:53 statsd.d

Step 7: check for load configuration file in health.d location by using following command and ,there would be no file there now

root@linuxhelp:/etc/netdata# cd health.d

Step 8: List the files by using the below command.

root@linuxhelp:/etc/netdata/health.d# ls -la
total 8
drwxr-xr-x  2 root root 4096 May 12 05:53 .
drwxr-xr-x 10 root root 4096 May 12 23:06 ..
root@linuxhelp:/etc/netdata/health.d# cd ..

Step 9: Using this scripter, copy configuration file to health.d to change configuratuion setting for CPU load by using the below command.

root@linuxhelp:/etc/netdata# ./edit-config health.d/cpu.conf
Copying '/etc/netdata/../../usr/lib/netdata/conf.d//health.d/cpu.conf' to '/etc/netdata//health.d/cpu.conf' ... 
Editing '/etc/netdata/health.d/cpu.conf' ...

Step 10: Now move to health.d file to change load values by using the below command.

root@linuxhelp:/etc/netdata# cd health.d

Step 11: List files by using the below command.

root@linuxhelp:/etc/netdata/health.d# ls -la
total 12
drwxr-xr-x  2 root root 4096 May 13 04:51 .
drwxr-xr-x 10 root root 4096 May 12 23:06 ..
-rw-r--r--  1 root root 2054 May 13 04:51 cpu.conf

Step 12: Open cpu.conf file and Change this line into the cpu.conf file by using the below command.

root@linuxhelp:/etc/netdata/health.d# vim cpu.conf
warn: $this > (($status >= $WARNING)  ? (10) : (20))
crit: $this > (($status == $CRITICAL) ? (20) : (30))

Step 13: Now restart the health service file of Netdata to apply the changes by using the below command.

root@linuxhelp:/etc/netdata/health.d# netdatacli reload-health

Step 14: Now go to the browser to show the alert made in config file as shown in below image.

Step 15: Now to make own health entity in Netdata as a example I am making ram load heath entity in health.d file by using the below command.

root@linuxhelp:/etc/netdata/health.d# vim ram.conf

Step 16: Provide all these steps in vim.conf file

alarm: ram_usage
    on: system.ram
lookup: average -1m percentage of used
 units: %
 every: 1m
  warn: $this > 40
  crit: $this > 60
  info: The percentage of RAM being used by the system.

Step 17: After that reload the health service file in Netdata by using the below command.

root@linuxhelp:/etc/netdata/health.d# netdatacli reload-health

Step 18: Now go to browser and reload the Netdata dashboard to update the changes you have made. This will show the system.ram load alarm in alert panel as shown in below image.

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required To Configure CPU/RAM load Alarm in Netdata on Debian 12. Your feedback is much welcome.

FAQ
Q
What is the main configuration file in Netdata?
A
By executing "./edit-config health.d/example.conf" this all the configuration file will save in health.d location to edit them.
Q
What is the location for the Netdata in CentOS?
A
The location for Netdata in CentOS is /etc/netdata
Q
Can I create my own health entity in Netdata?
A
Yes, you can create any load monitoring file in netdata.
Q
How to configure any load where the configuration file saved?
A
We can find all the .conf file under the health. d entity.
Q
What is Netdata tool?
A
Netdata helps sysadmins, SREs, DevOps engineers, and IT professionals collect all possible metrics from systems and applications, visualize these metrics in real-time, and troubleshoot complex performance problems.