Monitoring the Keep-Network node using Zabbix.

Karapunarly_Alex
5 min readAug 31, 2020

Hi, everybody. Today I will show you how to set up monitoring of the Keep-Network project node using the effective and multifunctional Zabbix monitoring system. Moreover, we will monitor 2 containers — Random Beacon and ECDSA, but you can also configure one or more containers. I use Ubuntu 18.04. Let’s go!

First, you need to install Zabbix itself and everything necessary for its correct operation. It is better to perform all installations under administrator rights.

Installation.

sudo apt-get update

sudo apt-get install zabbix-server-mysql zabbix-agent zabbix-frontend-php [installing the server itself, the agent, and frontend]

[and components necessary for Zabbix to work correctly]

sudo apt-get install php-mysql php-gd php-bcmath php-mbstring php-xml php-ldap php-json

Or this way

wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+bionic_all.deb

dpkg -i zabbix-release_5.0–1+bionic_all.deb

apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent

(If you update Zabbix: apt-get install — only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent)

Configuring mysql security.

Run the “mysql_secure_installation” script. This will help you perform several procedures that will eliminate certain default values that are dangerous to use:

sudo mysql_secure_installation

this script will ask you for the superuser password that you created during installation. Immediately after that, you will be asked a number of questions. You must answer “ Y “ (Yes) to all remaining questions.

Database creation.

log in to the database by entering the password that you came up with before:

mysql -u root –p

create database zabbix character set utf8 collate utf8_bin;

grant all privileges on zabbix.* to zabbix@localhost identified by ‘password’;

flush privileges;

exit;

On the Zabbix server host, import the initial schema and data. You will be prompted to enter your newly created password.

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Extra settings.

Opening the port for Zabbix: ufw allow 80/tcp

Then edit one of the configs

cd /etc/apache2/conf-available#

nano zabbix-frontend-php.conf — edit the time zone and access rights

Next, enable the zabbix configuration file for apache2:

sudo a2enconf zabbix-frontend-php

Editing the config file

nano /etc/zabbix/zabbix_server.conf

You must uncomment the password string for the database and insert the password you created earlier:

Launch.

After we have made all the necessary settings, it is time to launch our Zabbix.

Enter the server’s IP address in the browser bar and you should see the following (if the configuration is successful)

Click next step, it should be written everywhere OK

Next spep, Database name and User must be zabbix, Password — specify your password

As a result, we should see the following

The username is Admin, password zabbix.

Installing the Zabbix template.

Next, you need to download my template for monitoring Docker containers for two nodes, Beacon and ECSDA

You can download the archive from this link:

Also download to your server — wget https://codeload.github.com/GolDSnakeR/zabbix_docker_template/zip/master

unzip master

cp docker_template.conf /etc/zabbix/zabbix_agent.d

usermod -a -G docker zabbix

Importing a template.

Then go to Configuration — Templates — Import and select the xml file. We leave everything by default

Now we need to restart the agent service:

systemctl restart zabbix-agent.service

Adding our template for monitoring our server. Configuration — Templates, select your server and then the tab templates. In the search bar looking for Template App Docker — Agent 1 and adding it. It should look like the picture.

Screens.

Next, we need to create a complex screen where we can monitor different data. Go to monitoring — Screens. Choose create screen.

Go in and select Edit screen. Select the field where we want to place the monitoring element and click Change:

You can choose different data to display, I chose graphs. But I advise you to try different data elements.

In the host section, select our server to monitor and then see a list of individual elements to monitor from our template.

Next, we place different monitoring elements and the overall picture will look like in the photo below.

Thank you all for your attention. If you have any questions, you can contact me in PM.

Discord: Aleksey#1658

TELEGRAM — @Karapunarly_Alex

--

--