(Last Updated On: March 9, 2019)

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:

How to Install Netdata on RHEL 8 / CentOS 8

How to Install Netdata on RHEL 8 / CentOS 8

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

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

For other systems such as RHEL 8 and FreeBSD, use our guides below:

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

$ systemctl status netdata
● netdata.service - Real time performance monitoring
Loaded: loaded (/usr/lib/systemd/system/netdata.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2019-03-02 07:14:31 CET; 4min 44s ago
Process: 21775 ExecStartPre=/bin/chown -R netdata:netdata /var/run/netdata (code=exited, status=0/SUCCESS)
Process: 21771 ExecStartPre=/bin/mkdir -p /var/run/netdata (code=exited, status=0/SUCCESS)
Process: 21768 ExecStartPre=/bin/chown -R netdata:netdata /var/cache/netdata (code=exited, status=0/SUCCESS)
Process: 21766 ExecStartPre=/bin/mkdir -p /var/cache/netdata (code=exited, status=0/SUCCESS)
Main PID: 21778 (netdata)
CGroup: /system.slice/netdata.service
├─21778 /usr/sbin/netdata -P /var/run/netdata/netdata.pid -D -W set global process scheduling policy keep -W set global OOM score keep
├─21837 bash /usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1
├─21847 /usr/libexec/netdata/plugins.d/apps.plugin 1
└─21851 /usr/libexec/netdata/plugins.d/go.d.plugin 1
Mar 02 07:14:31 techwiz-app-server systemd[1]: Starting Real time performance monitoring…
Mar 02 07:14:31 techwiz-app-server systemd[1]: Started Real time performance monitoring.
Mar 02 07:14:31 techwiz-app-server netdata[21778]: /usr/libexec/netdata/plugins.d/anonymous-statistics.sh 'START' '-' '-'
Mar 02 07:14:31 techwiz-app-server netdata[21778]: 2019-03-02 07:14:31: netdata INFO : MAIN : /usr/libexec/netdata/plugins.d/anonymous-stati…'-' '-'
Hint: Some lines were ellipsized, use -l to show in full.

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.

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:

Select InfluxDB data source type from the list.

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

Save and test the settings provided.

Step 5: Create / Import Netdata Grafana dashboard.

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

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

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.

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