Did you know you can visualize Netdata metrics on Grafana?. This guide will walk you through the steps of installing Netdata, and configuring metrics to be visualized on Grafana. The database that will be used to store Netdata monitoring metrics is InfluxDB. Netdata is a powerful distributed, real-time health and performance monitoring tool used for infrastructure systems and various applications.

You can highly optimize monitoring agent you install on all your systems and containers. Grafana, on the other hand, is a tool that allows you to query and visualize your metrics no matter where they are stored.

Step 1: Install Netdata

Netdata can be installed on any Linux system by running kickstart script provided by the developers.

For RHEL 8 and FreeBSD, use:

For any other Linux flavor, run below automated script to install Netdata.

bash <(curl -Ss https://my-netdata.io/kickstart.sh)

This will install all Netdata system dependencies before building Netdata on the system. The service should be automatically started after installation.

If not running start it manually.

 systemctl enable --now netdata

Check service status.

$ systemctl status netdata
● netdata.service - Real time performance monitoring
   Loaded: loaded (/usr/lib/systemd/system/netdata.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2023-08-19 22:53:20 UTC; 36s ago
  Process: 47285 ExecStartPre=/bin/chown -R netdata /run/netdata (code=exited, status=0/SUCCESS)
  Process: 47283 ExecStartPre=/bin/mkdir -p /run/netdata (code=exited, status=0/SUCCESS)
  Process: 47281 ExecStartPre=/bin/chown -R netdata /var/cache/netdata (code=exited, status=0/SUCCESS)
  Process: 47280 ExecStartPre=/bin/mkdir -p /var/cache/netdata (code=exited, status=0/SUCCESS)
 Main PID: 47287 (netdata)
    Tasks: 79 (limit: 10843)
   Memory: 171.8M
   CGroup: /system.slice/netdata.service
           ├─47287 /usr/sbin/netdata -P /run/netdata/netdata.pid -D
           ├─47290 /usr/sbin/netdata --special-spawn-server
           ├─47461 /usr/libexec/netdata/plugins.d/go.d.plugin 1
           ├─47465 /usr/libexec/netdata/plugins.d/ebpf.plugin 1
           ├─47467 /usr/libexec/netdata/plugins.d/debugfs.plugin 1
           ├─47472 /usr/libexec/netdata/plugins.d/apps.plugin 1
           └─47486 /usr/libexec/netdata/plugins.d/systemd-journal.plugin 1

Aug 19 22:53:21 cent8.mylab.io ebpf.plugin[47465]: set name of thread 47482 to EBPF SHM
Aug 19 22:53:21 cent8.mylab.io ebpf.plugin[47465]: thread created with task id 47483
Aug 19 22:53:21 cent8.mylab.io ebpf.plugin[47465]: set name of thread 47483 to EBPF FUNCTIONS
Aug 19 22:53:21 cent8.mylab.io debugfs.plugin[47467]: Zswap is disabled
Aug 19 22:53:21 cent8.mylab.io debugfs.plugin[47467]: Failed to find powercap zones.
Aug 19 22:53:22 cent8.mylab.io apps.plugin[47472]: Using now_boottime_usec() for uptime (dt is 5 ms)

You can also try Netdata in a docker container by running:

docker run -d --name=netdata \
  -p 19999:19999 \
  -v /proc:/host/proc:ro \
  -v /sys:/host/sys:ro \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  --cap-add SYS_PTRACE \
  --security-opt apparmor=unconfined \
  netdata/netdata

Step 2: Install InfluxDB & Grafana

The next step is the installation of InfluxDB and Grafana, we have guides for both Debian, Ubuntu and CentOS servers.

Install Grafana:

How to Install Grafana on Ubuntu and Debian

Install Grafana and InfluxDB on CentOS 7

How to Install Grafana on RHEL 8

Install InfluxDB:

Install InfluxDB on Ubuntu and Debian

How to Install InfluxDB on Fedora

How to Install InfluxDB on RHEL 8 / CentOS 8

Step 3: Configure Netdata to use InfluxDB

We will configure Netdata to use InfluxDB as time series database. Open netdata configuration and look for [backend] block and set.

[backend]
enabled = yes
type = opentsdb
destination = localhost:4242

It should look similar to below.

netdata configure influxdb backend

Now open InfluxDB configuration and enable OpenTSDB service

$ sudo vim /etc/influxdb/influxdb.conf
[[opentsdb]]
   enabled = true
   bind-address = ":4242"
   database = "opentsdb"

Restart influxdb and netdata services after making the change.

sudo systemctl restart influxdb netdata 

Confirm that you have port 4242 listening.

~# ss -tunelp | grep 4242
 tcp    LISTEN   0 128  *:4242  *:* users:(("influxd",pid=27646,fd=15)) uid:998 ino:176788 sk:17 v6only:0 <->      

Netdata should start sending metrics to InfluxDB.

$ influx -username 'monitoring' -password 'StrongPassword'
 Connected to http://localhost:8086 version 1.7.4
 InfluxDB shell version: 1.7.4
 Enter an InfluxQL query
> SHOW DATABASES
name: databases
name
----
_internal
opentsdb 

You can see opentsdb database has been created, let’s confirm if there is Netdata metrics in this database.

> USE opentsdb 
> SHOW MEASUREMENTS LIMIT 10
   name: measurements
   name
   netdata.apps.cpu.VMs
   netdata.apps.cpu.X
   netdata.apps.cpu.apps.plugin
   netdata.apps.cpu.charts.d.plugin
   netdata.apps.cpu.containers
   netdata.apps.cpu.cron
   netdata.apps.cpu.dhcp
   netdata.apps.cpu.go.d.plugin
   netdata.apps.cpu.iscsi
   netdata.apps.cpu.kernel 

Step 4: Configure Grafana to use InfluxDB

Login to your Grafana using http://serverip:3000 and login as admin user and password. The click on “Add data source:

grafana add influxdb backend

Select InfluxDB data source type from the list.

grafana add influxdb backend 02

Provide server URL, database name, and authentication details if you have http authentication turned on.

grafana add influxdb backend 02 01

Save and test the settings provided.

grafana add influxdb backend 03

Step 5: Create / Import Netdata Grafana dashboard.

I found a working Netdata dashboard for grafana. Import it by providing Dashboard number.

netdata grafana 01

Click “Load” to get the dashboard imported. Select InfluxDB data source you added earlier to finish importing.

netdata grafana 02

Within a short time, you should see netdata metrics for your server on Grafana. The dashboard just show simple system stats, you can improve for your use.

netdata grafana 03

Conclusion

You have learned how you can use Netdata, InfluxDB and Grafana to monitor your Application servers, database servers and other applications running in your infrastructure. If you’re interested in other monitoring guides, check out:

Monitor Linux System with Grafana and Telegraf

Monitoring Ceph Cluster with Prometheus and Grafana

How to Monitor Redis Server with Prometheus and Grafana in 5 minutes

How to Monitor Linux Server Performance with Prometheus and Grafana in 5 minutes

How to Monitor BIND DNS server with Prometheus and Grafana

Monitoring MySQL / MariaDB with Prometheus in five minutes

How to Monitor Apache Web Server with Prometheus and Grafana in 5 minutes

LEAVE A REPLY

Please enter your comment!
Please enter your name here