How to install Zabbix 6.0 on Rocky Linux 8

Zabbix 6.0 is an open-source tool for monitoring IT infrastructures like networking, servers, cloud services, and virtual machines.

Zabbix collects and displays basic metrics on a dashboard. It uses flexible notification mechanisms that allow users to configure email-based alerts for all the events that happened. This allows a fast reaction to server problems. Zabbix offers excellent data visualization and reporting using stored data. Zabbix reports and configurations are accessed via a web-based frontend.

Key Features of Zabbix 6.0

  • Zabbix 6 now supports monitoring of over 100k Zabbix instances, which is now great whenever you want to monitor your instances.
  • You can now in a position to define your user permission on any business service provided.
  • Now you are in a position to define read-write or read-only permissions to your specific business services.
  • You are now in a position to receive alerts and be able to react to any business changes thanks to Zabbix 6 capability.
  • You are now capable of assigning weight to each of your business services
  • Empowering your business service monitoring is now possible with root cause analysis. You can gather all the root cause analysis using the Zabbix API.
  • Its now possible to have out of the box high availability cluster for Zabbix server.
  • They have embedded new way of learning in the context of machine learning and Kubernetes monitoring capability.

Installing Zabbix 6 on Rocky Linux

Let’s begin installing Zabbix 6 on our Fedora 35 server with the steps below.

To begin the installation, begin by updating Fedora repositories with the following command.

sudo dnf update 

1. Install MariaDB database

We need to make sure we install MariaDB on our machine before proceeding.

So to install MariaDB on our system run the following command.

But before installing let’s enable it first

dnf module list mariadb
# output
Fedora Modular 35 - x86_64
Name           Stream        Profiles                                 Summary                                                  
mariadb        10.3          client, devel, galera, server [d]        MariaDB: a very fast and robust SQL database server      
mariadb        10.4          client, devel, galera, server [d]        MariaDB: a very fast and robust SQL database server      
mariadb        10.5          client, devel, galera, server [d]        MariaDB: a very fast and robust SQL database server      

Fedora Modular 35 - x86_64 - Updates
Name           Stream        Profiles                                 Summary                                                  
mariadb        10.3          client, devel, galera, server [d]        MariaDB: a very fast and robust SQL database server      
mariadb        10.4          client, devel, galera, server [d]        MariaDB: a very fast and robust SQL database server      
mariadb        10.5          client, devel, galera, server [d]        MariaDB: a very fast and robust SQL database server      
mariadb        10.6          client, devel, galera, server            MariaDB: a very fast and robust SQL database server      
mariadb        10.7          client, devel, galera, server            MariaDB: a very fast and robust SQL database server      

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

To enable it to use the following command

sudo dnf module enable mariadb:10.7 -y

Then install with the following command.

sudo dnf install mariadb mariadb-server

Check the version of MariaDB with the following command.

rpm -qi mariadb
Name        : mariadb
Epoch       : 3
Version     : 10.7.1
Release     : 1.module_f35+13505+f0394ab9
Architecture: x86_64
Install Date: Thu 24 Mar 2022 09:42:50 AM UTC
Group       : Unspecified
Size        : 18813213
License     : GPLv2 and LGPLv2
Signature   : RSA/SHA256, Tue 07 Dec 2021 10:40:15 PM UTC, Key ID db4639719867c58f
Source RPM  : mariadb-10.7.1-1.module_f35+13505+f0394ab9.src.rpm
Build Date  : Tue 07 Dec 2021 01:42:46 PM UTC
Build Host  : buildvm-x86-23.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://mariadb.org
Bug URL     : https://bugz.fedoraproject.org/mariadb
Summary     : A very fast and robust SQL database server
Description :
MariaDB is a community developed fork from MySQL - a multi-user, multi-threaded
SQL database server. It is a client/server implementation consisting of
a server daemon (mariadbd) and many different client programs and libraries.
The base package contains the standard MariaDB/MySQL client programs and
utilities.

Enable MariaDB to start on boot

sudo systemctl enable --now mariadb
sudo systemctl start mariadb
sudo systemctl status mariadb

Make sure MariaDB is up and running like this.

● mariadb.service - MariaDB 10.7 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
     Active: active (running) since Thu 2022-03-24 09:48:21 UTC; 33s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 21189 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
    Process: 21211 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
    Process: 21306 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
   Main PID: 21295 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 11 (limit: 1112)
     Memory: 117.5M
        CPU: 1.174s
     CGroup: /system.slice/mariadb.service
             └─21295 /usr/libexec/mariadbd --basedir=/usr

Now we need to secure our MySQL installation with the following command;

mysql_secure_installation

You will get the following output.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

You can test the database with this command

mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.7.1-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

Create initial database

To create a database use MySQL -u root -p to login.

mysql -u root -p
MariaDB [(none)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by 'password';
Query OK, 0 rows affected (0.014 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> quit
Bye

2. Install Apache server

To install Apache run the following command. Check this article on how to install an Apache webserver

sudo dnf install httpd -y

To make sure the server can come up after reboot, we need to enable it and start the service manually first.

systemctl enable httpd
systemctl start httpd
systemctl status httpd

Make sure the status is up and running.

● httpd.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor pre>
     Active: active (running) since Thu 2022-03-24 08:21:55 UTC; 8s ago
       Docs: man:httpd.service(8)
   Main PID: 20209 (httpd)
     Status: "Started, listening on: port 80"
      Tasks: 177 (limit: 1112)
     Memory: 14.0M
        CPU: 121ms
     CGroup: /system.slice/httpd.service
             ├─20209 /usr/sbin/httpd -DFOREGROUND
             ├─20210 /usr/sbin/httpd -DFOREGROUND
             ├─20211 /usr/sbin/httpd -DFOREGROUND
             ├─20212 /usr/sbin/httpd -DFOREGROUND
             └─20213 /usr/sbin/httpd -DFOREGROUND

3. Install Zabbix 6.0 Repository

First, we need to add Zabbix 6.0 into our Fedora repository using RPM packages. this will become a bit easy to run and install Zabbix.

rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm

Check the output below

Retrieving https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
warning: /var/tmp/rpm-tmp.vvTBxI: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Verifying...                          ############################# [100%]
Preparing...                          ############################# [100%]
Updating / installing...
   1:zabbix-release-6.0-1.el8         ############################# [100%]

4. Install Zabbix6.0 frontend, agent and server

To install frontend, server, and agent, we need a web server such as Apache or Nginx plus a database such as Mysql or PostgreSQL. We will see how we will use all of them.

dnf install zabbix-server-mysql \
zabbix-web-mysql \
zabbix-apache-conf \
zabbix-sql-scripts \
zabbix-selinux-policy \
zabbix-agent

5. Import initial databases schema

Use the following command to import the initial database schema. Make sure you provide the database password you created earlier on.

zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -u zabbix -p zabbix

6. Configure the database for Zabbix 6.0 server

Use your favorite text editor to edit this configuration file.

sudo vi /etc/zabbix/zabbix_server.conf

Set the password on this configuration file

DBPassword=password

Save and exit

7. Start Zabbix server and agent proceses

use the following command to start Zabbix server and agent

systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm

Make sure the Zabbix is up and running. Check with the following command.

systemctl status zabbix-server
● zabbix-server.service - Zabbix Server with MySQL DB
     Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; bad; vendor preset: disabled)
     Active: active (running) since Thu 2022-03-24 11:07:59 UTC; 11min ago
   Main PID: 23252 (zabbix_server)
      Tasks: 1 (limit: 1112)
     Memory: 3.0M
        CPU: 51ms
     CGroup: /system.slice/zabbix-server.service
             └─23252 /usr/sbin/zabbix_server -f

Mar 24 11:07:59 fedora systemd[1]: Started Zabbix Server with MySQL DB.

8. Configure Zabbix frontend

To connect to the new Zabbix frontend head over to http://<your_IP_address>/zabbix.

You will see the following

zabbix 6.0
Zabbix 6.0
Zabbix validation
Zabbix validation
Zabbix congrats message
Zabbix congrats message

Lastly login with Admin as username and zabbix as password.

Zabbix 6.0 dashboard

Congratulations you have installed Zabbix 6.0 on Rocky Linux 8.

About Kipkoech Sang

I am a technology enthusiast who loves to share gained knowledge through offering daily tips as a way of empowering others. I am fan of Linux and all other things open source.
View all posts by Kipkoech Sang →

Leave a Reply

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