Netdata is Linux, FreeBSD, and MacOS compatible tool used for distributed real-time performance and health monitoring of systems. Netdata is one of the best real-time monitoring tools which works with Virtual Machines, physical servers, containers and IOT devices. It utilizes modern interactive web dashboards.
Some good features of netdata as of recent release include:
- Auto-scaling of chart units
- IP access lists for filtering access to netdata
- Enhanced VMs and containers monitoring
- Highlighted time-frames across all charts of the dashboard
- Dashboard snapshots, for loading/saving of selected time-frames
- Timezone conversion at the dashboard to allow comparing charts with server logs
- Zero maintenance, configuration, and dependencies
- It is easily customizable, extensible, and embeddable
- Scales to infinity
- Time-series back-ends supported – it can archive its metrics on graphite, opentsdb, Prometheus, JSON document DBs, in the same or lower detail.
Installing Netdata on CentOS 7
First, start by installing the missing dependencies that are required by netdata. This is done by running.
# yum -y install curl git # curl -Ss 'https://raw.githubusercontent.com/firehol/netdata-demo-site/master/install-required-packages.sh'
Then execute the downloaded script.
# bash install-required-packages.sh
This will download a number of packages needed by netdata. After it has finished, you can proceed to clone netdata source code from Github.
# git clone https://github.com/firehol/netdata.git --depth=1 Cloning into 'netdata'... remote: Counting objects: 736, done. remote: Compressing objects: 100% (676/676), done. remote: Total 736 (delta 99), reused 265 (delta 43), pack-reused 0 Receiving objects: 100% (736/736), 2.54 MiB | 149.00 KiB/s, done. Resolving deltas: 100% (99/99), done.
Then start netdata installation by executing the netdata-installer.sh script.
# cd netdata/ # ./netdata-installer.sh ^ |.-. .-. .-. .-. . netdata | '-' '-' '-' '-' real-time performance monitoring, done right! +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---> You are about to build and install netdata to your system. It will be installed at these locations: - the daemon at /usr/sbin/netdata - config files in /etc/netdata - web files in /usr/share/netdata - plugins in /usr/libexec/netdata - cache files in /var/cache/netdata - db files in /var/lib/netdata - log files in /var/log/netdata - pid file at /var/run/netdata.pid - logrotate file at /etc/logrotate.d/netdata This installer allows you to change the installation path. Press Control-C and run the same command with --help for help. Press ENTER to build and install netdata to your system >
To start the installation process, press <ENTER>
After successful installation, you should get a message like below:
..... Uninstall script generated: ./netdata-uninstaller.sh Update script generated : ./netdata-updater.sh netdata-updater.sh can work from cron. It will trigger an email from cron only if it fails (it does not print anything when it can update netdata). Run this to automatically check and install netdata updates once per day: sudo ln -s /root/netdata/netdata-updater.sh /etc/cron.daily/netdata-updater --- We are done! --- ^ |.-. .-. .-. .-. .-. . netdata .-. .- | '-' '-' '-' '-' '-' is installed and running now! -' '-' +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---> enjoy real-time performance and health monitoring...
Configure Memory de-duplication
If you have kernel memory de-duper (called Kernel Same-page Merging, or KSM) available, but it is not currently enabled. You should enable it by running the commands:
echo 1 >/sys/kernel/mm/ksm/run echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
It will lower netdata memory utilization by 40-60%.
To start netdata run:
# systemctl start netdata # systemctl status netdata
Open netdata port on firewalld
Now that we have confirmed netdata service to be running, open its service port on the firewall so that you can access it outside. Use the commands:
# firewall-cmd --add-port=19999/tcp --permanent # firewall-cmd --reload
Configure SELinux
You can choose to disable SELinux, put it in permissive mode or configure port 19999 to work with SELinux. To put SELinux in permissive mode, run
# setenforce 0 # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: permissive Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 28 # cat /etc/selinux/config | grep -v ^# | grep SELINUX= SELINUX=permissive
To disable SELinux, change the line to SELINUX=disabled and reboot the server.
If SELinux is set to enforcing. You may need to install semanage tool for this:
# yum -y install policycoreutils-python
Now you can use semanage command line tool to label netdata port.
# semanage port -a -t ssh_port_t -p tcp 19999 # systemctl restart netdata # systemctl status netdata ● netdata.service - Real time performance monitoring Loaded: loaded (/etc/systemd/system/netdata.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2018-02-21 11:14:43 EAT; 3h 43min ago Process: 8600 ExecStartPre=/bin/chown -R netdata:netdata /var/cache/netdata (code=exited, status=0/SUCCESS) Process: 8598 ExecStartPre=/bin/mkdir -p /var/cache/netdata (code=exited, status=0/SUCCESS) Main PID: 8603 (netdata) CGroup: /system.slice/netdata.service ├─ 8603 /usr/sbin/netdata -P /run/netdata/netdata.pid -D ├─ 8639 /usr/bin/python /usr/libexec/netdata/plugins.d/python.d.pl... ├─ 8640 /usr/libexec/netdata/plugins.d/apps.plugin 1 └─23394 bash /usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1
Visit your server IP address and port 19999. You should have netdata running.