Monitoring

Monitoring from the command line

The easiest way to see the server load is through the CLI:

sudo apt install htop -y
htop

But we will analyze a more complex one, however, due to the truncated functions, it is easily configured and everyone can install it without any problems.

Netdata

To write an article and test this method, I took the article of the same name from Digital Oceanarrow-up-right.

The advantage of Netdata is that you can monitor the server from any device without entering the terminal.

sudo apt update && sudo apt upgrade -y

Installing the necessary dependencies

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

In the last command above, we have to install the recommended but optional packages, but in practice libmnl-dev is not installed (Ubuntu 20.04) which leads to errors in further installation. Therefore, we do the following:

# Looking for available packages libuv:
apt-cache search libuv

# Install:
sudo add-apt-repository ppa:acooks/libwebsockets6
sudo apt-get update
sudo apt-get install libuv1.dev

# Just in case, install:
sudo apt install python3
sudo apt install libffi-dev
sudo apt install python3-dev
sudo apt install python3-virtualenv
sudo apt-get install python3-venv
sudo apt-get install python3-dev
sudo apt-get install gcc -y
sudo apt install python3-pip
sudo apt install build-essential -y
sudo apt install build-essential python3-dev python3-pip

The preparation is over. We clone the Netdata repository from GitHub and go to the copied directory:

Building and installing the Netdata package:

We open port 19999, since this port is used by NetData servers. In order to understand how UFW works - an article from DigitalOcean "Initial server setuparrow-up-right".

🎉Done! It remains to replace your_server_ip with the IP of the server, and see the result in the browser:

Last updated