How to Install and Use Netdata Monitoring Tool on Linux

Netdata is a distributed, near real-time, scalable & performance and health monitoring solution for Linux, FreeBSD and MacOS. Yes! It is open-source too. It has been developed in such a way that it can be installed on each Linux system, without interrupting or dead-locking the currently running applications on the server. You can use this tool to monitor and get an overview of what is happening in near real-time, on your Linux systems and applications. Okay so let me start with a tutorial of Netdata and drive you through installation, dashboards, monitoring multiple servers & finally uninstallation.

Netdata monitors everything you think of :

  • CPU Core - Total and Per Core, interrupts, softirqs and frequency.
  • Memory - Total Memory, RAM, Swap and Kernel usage.
  • Disk I/O - per disk: bandwidth, operations, backlog, utilization, etc.
  • Network - bandwidth, packets, errors, drops, etc.
  • Firewall - Monitors Netfilter / iptables Linux firewall connections, events, errors, etc.
  • Processes - Running, Blocked, Forks, Active, etc.
  • System Applications - with the process tree for CPU, memory, swap, disk reads/writes, threads, etc.
  • Apache and Nginx Status.
  • MySQL database - queries, updates, locks, issues, threads, etc.
  • Postfix email server message queue.
  • Squid proxy server bandwidth and requests monitoring.
  • Hardware sensors - temperature, voltage, fans, power, humidity, etc.
  • SNMP devices.

Many people view netdata as a collectd + graphite alternative or compare it with munin. Netdata attempts to offer lots of functionality, without the dedicated resources - of course within limits and with dashboard utilities.

You need to get notifications on your mobile when you are out of office. Oh! Netdata also supports real-time alarms. Netdata alarms can be setup on any combination of metrics and can send notifications.

So were you thinking about hardware requirement, don’t worry it can be installed on simple machine which can spare 1 to 3 % of CPU utilization. So lets start with installation, this tutorial will cover installation on ARC Linux, Ubuntu 16.06 & CentOS 7.

Installation

For CentOS/Fedora netdata provided one line installation script. The script will install latest netdata and also updates daily.

For 32-bit system:

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

For 64-bit system:

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

The above command will run automated scripts and start downloading Netdata

For Ubuntu 16.06 first update all important packages,

$ sudo apt-get update
$ sudo apt-get install git zlib1g-dev uuid-dev libmnl-dev gcc make autoconf autoconf-archive autogen automake pkg-config curl python python-yaml python-mysqldb python-psycopg2 nodejs lm-sensors netcat

For ArcLinux,

$ sudo pacman -S netdata
$ sudo packman -S curl
$ sudo curl -Ss 'https://raw.githubusercontent.com/firehol/netdata-demo-site/master/install-required-package.sh' > /tmp/kickstart.sh && bash /tmp/kickstart.sh -i netdata 

Dashboard Example

Note all this dashboard are web hosted, so if you install this on server you can access this information from anywhere.

How to Get CPU Information

Detailed information for each CPU's in system. Summary of system can be found in system Overview -> CPU.


Detailed information of interrupts handled by CPU of system.

Fetch User Information

Per user statistics are collected using apps.plugin. This plugin walks through all the processes and aggregates statistics per users. For the processed like spell scripts, the reported values includes the resources used by the commands these scripts run within each timeframe.

Below image shows dashboard for 2 core CPU.

Fetch Real time Memory Utilization

Real Memory (RAM) used per user. This does not includes shared memory. (users.mem)


The data shown in below dashboard is for each users in a group and utilisation of resources. Pink is for net data and red is for Root for CPU time in %.

Web Usage & Monitoring

Web dashboard is so interesting it calculates metrics for each web resources. As you see its listed down under Netdata Monitoring -> web, there are 2 thread running.

Netdata CG dashboard, shows information for proc and cgroups which accumulates data every millisecond. plugins used for this dashboard are netdata.plugin_proc_cpu & netdata.plugin_cgroup_cpu.


Netdata Monitoring also helps with monitoring apps using apps.plugin which collects data every millisecond with different metrics W.R.T user & system, calls, files access, targets & new kids generated.

How to Get Alerts

Netdata alarms showing active raised alarm using system.softnet_stat. Below image shows how many time alarm are raised within 10 min of time. Configuring alarm for above system parameter is shown in right side where db lookup, check every, execute path, source location of config file can be determined here.


This are alarm log under alarm section. you can have look at Event Date which shows exacts date and time of alarm raised.

Kernel Information

Kernel shows 2 different type of metrics one is Dirty Matrics & other is complete Kernel Matrics. Dirty metrics shows amount of memory waiting to be written on disk. Writeback is how much memory is actively being written on disk. The total amount of memory being used by kernel. SLAB is amount of memory used by the kernel to cache data structure for its own. KERNELSTACK is the amount of memory allocated for each task done by the kernel. VMALLOCUSED is the amount of memory being used as virtual address space.

Network Monitoring

IPv4 networking collects bandwidth information, packets, connection errors.
tcp: connections, packets, errors, handshake.
udp: packets, errors, broadcast: bandwidth, packets.
Interprocess Communication - IPC such as semaphores and arrays if needed.
netfilter / iptables Linux firewall: connections, connection tracker events, errors.

Below are images for networking, Firewall & IPV4 networking;

Disk Utilization

Charts show the performance for all the system data. Special Meter based metrics shows the data real time for system admin. In Disk menu special listing where space utilization, reserved for root and if user is getting out of space is determined.

How to Add multiple Servers

This is not all, go and grab a cup of tea... I have managed to add multiple server like ARCLinux, Ubuntu & CentOS get connected to single portal where an system Admin can easily monitor server just by clicking. Yes, this is possible below image shows list of different server configured and managed to add in portal.

  1. You will need more than 1 server Netdata installation done,
  2. You go to browser and add servers IP address follower by port no, 19999
  3. Similarly, browse for Multiple server IP, List will be automatically added in the dropdown for future use.

Uninstallation

The script netdata-installer.sh generates another script called netdata-uninstaller.sh.
To uninstall netdata, run:

cd /path/to/netdata.git
$ ./netdata-uninstaller.sh --force
$ service netdata stop
$ systemctl stop netdata

Disable running netdata at startup, with one of the following (based on your distro):

$ rc-update del netdata
$ update-rc.d netdata disable
$ chkconfig netdata off
$ systemctl disable netdata

Finally, remove all netdata files and delete user (depending on user need),

$ rm -rf /opt/netdata
$ groupdel netdata
$ userdel netdata

Read Also :

"s-tui" - Terminal Tool to Monitoring CPU Temperature in Linux
How to Install Centreon on Centos 7 for Monitoring
How to Install "stacer" Monitoring and Optimising Tool on Linux
How to Setup Monitoring using Dashing Icinga2 Dashboard

That's all for today. I know this has been a long topic to cover but hope you like and gain detailed understanding, Thanks for your support and look forward to getting more and more interesting topics for you. Bye!

Yash Vasa 1:45 am

About Yash Vasa

Yash, a passionate Linux System Administrator and tech enthusiasts. He drive immerse gratification in conducting research on Industrial IoT platforms and keeping up to date with the latest technology world. He believe that combination of brilliant mind, gold ideas & utter disregards for what is possible can & will change the world.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.

1 Comment

  1. Hi there,

    Is there any opensource network monitoring tool like ntopng? I have linux router and I want to monitor the hosts connected and routed through it.