We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install Zabbix Server on Rocky Linux 9 / AlmaLinux 9

Learn how to – Install Zabbix Server on Rocky Linux 9 / AlmaLinux 9.

System monitoring is a very vital activity for any infrastructure. This makes great sense, considering the fact that modern enterprises largely rely on applications to run businesses. Monitoring is therefore done to improve and maintain the performance and health of servers/applications. There are several monitoring stacks available in the market today. They include Dynatrace, New Relic, Zenoss, Elastic Stack, Prometheus, N-able RMM, Datadog Infrastructure Monitoring, Zabbix, PRTG Network Monitor, Nagios e.t.c

Zabbix is a free and open-source enterprise-grade software, used to monitor and analyze the performance of applications, components, and services in an environment. Its core is written in C and Java languages with the frontend written in PHP. Using Zabbix is so beneficial as it helps identify faults and errors on time and send alerts to the response team. This increases the productivity of servers/applications in the environment thus guaranteeing business continuity.

Zabbix infra solution works with the server-client model. The Zabbix server communicates with clients referred to as Zabbix agents. The agents can be Linux, Windows, or NIX systems with the client software installed. The Zabbix agent supports both active (trapping) and passive (polling) checks from the server.

The below diagram can be used to illustrate the Zabbix Architecture.

The latest release version, Zabbix 6.0 LTS offers several features. Some of the features include:

  • High availability, performance, and scalability: It has proxies to provide automatic load balancing and HA, native HA setup for Zabbix Server, scalable history storage, and several API performance improvements.
  • Machine learning: used for baseline monitoring with advanced anomaly detection.
  • Event correlation and enterprise alarm console: this release version has the ability to perform event filtering, de-duplication, and aggregation using event preprocessing rules. It also has the ability to manually hide and suspend problems for a period of time, as well as a problem view that is optimized for faster problem resolution and collaborative work.
  • Advanced visualization and reporting: this comprises stacked graphs, graph annotations, advanced host status widgets, events over time widgets, geographical maps e.t.c
  • Business service monitoring (BSM): with the ability to scale to 100K of business services, alerting on service status changes, multi-tenancy for Services, impact analysis, import/export for service tree e.t.c
  • Security improvements: password complexity policy for Zabbix UI and audit log for all user and API operations being added

In this tutorial, we will learn how to install and configure Zabbix Server on Rocky Linux 9 / AlmaLinux 9.

Requirements

In this setup, we will work with the following:

  • PHP
  • Apache web server
  • MySQL/ MariaDB database server

You also need to set SELinux in permissive:

sudo setenforce 0 && sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
cat /etc/selinux/config | grep SELINUX=

#1. Install Zabbix Server on Rocky Linux 9 / AlmaLinux 9

In this guide, we will install Zabbix 6.2 LTS. Add the repository to the system with the command:

sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-3.el9.noarch.rpm

Once the repository has been added, install the required packages with the command:

sudo dnf install vim zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y

#2. Install and Configure a Database for Zabbix

Zabbix allows you to choose between the MySQL and PostgreSQL databases. In this guide, we will go for the MariaDB database, a fork of MySQL.

To install MariaDB, use the command:

sudo dnf install mariadb-server mariadb -y

Start and enable the service:

sudo systemctl start mariadb && sudo systemctl enable mariadb

Harden the MariaDB instance:

$ sudo mariadb-secure-installation
....
Enter current password for root (enter for none): Press Enter
.....
Switch to unix_socket authentication [Y/n] y
.....
Change the root password? [Y/n] y
New password: 
Re-enter new password:
.....
Remove anonymous users? [Y/n] y
....
Disallow root login remotely? [Y/n] y
....
Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y
....
Thanks for using MariaDB!

Now login to the MariaDB server and create a database for Zabbix:

$ sudo mysql -u root -p
CREATE DATABASE zabbix character set utf8mb4 collate utf8mb4_bin;
CREATE USER zabbix@localhost IDENTIFIED by 'StrongDBPassw0rd';
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost;
FLUSH PRIVILEGES; 
QUIT 

Import initial schema and data to the database:

sudo zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p'StrongDBPassw0rd' zabbix

#3. Configure the Zabbix on Rocky Linux 9 / AlmaLinux 9

Zabbix, stores its configuration file at /etc/zabbix/zabbix_server.conf. Open this file and edit it as desired:

sudo vim /etc/zabbix/zabbix_server.conf

In the config, make the below adjustments to accommodate your database:

DBName=zabbix
DBUser=zabbix
DBPassword=StrongDBPassw0rd

Once the changes have been made, restart the service:

sudo systemctl restart zabbix-server

Configure your Timezone by editing the PHP file below:

$ sudo vim /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Africa/Nairobi

The Zabbix server can be set to monitor itself by editing the agent conf as below:

$ sudo vim /etc/zabbix/zabbix_agentd.conf
Hostname=zabbix.ownyourlife.com.ng

It is also possible to configure a remote Zabbix agent. This can be done using the aid provided in the guides below:

Now restart and enable the Zabbix server/agent and Apache:

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

Allow the required ports through the firewall:

sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
sudo firewall-cmd --reload

#4. Access Zabbix UI on Rocky Linux 9 / AlmaLinux 9

The Zabbix web UI can be accessed using the URL http://IP_Address/zabbix/ or http://domain_name/zabbix/

You will see the welcome page as shown below:

Proceed to the next step and ensure all the requirements are met.

Now add the database to the system;

Set the preferred Zabbix server name and theme:

A preview of the made configurations will then be granted to you.

If you agree to them, proceed and install the Zabbix frontend. Once complete, you will see this:

Click on Finish and proceed to the login page. The default login credentials are :

Username: Admin
Password: zabbix

Fill in the creds as shown below and sign in to Zabbix

Once authenticated, you will see the below dashboard.

Set a preferred password by navigating to Administration > Users > Admin > Password > Change Password

Once the desired password has been set, click Update to save the changes

#5. Configure the Zabbix Monitoring Target

To configure the monitoring target on Zabbix, navigate to Configuration > Hosts. Add a target host by clicking on Create Host. For this case, we set the Zabbix server to monitor itself, so it already appears listed and enabled.

Once the host appears here, it is ready to be monitored. You can now view the graphs under Monitoring > Hosts > Server name.

Conclusion

We now have a Zabbix Server installed and configured on Rocky Linux 9 / AlmaLinux 9. Furthermore, we have demonstrated how to configure a monitoring target. Now add the preferred Zabbix agents and monitor them. I hope this was helpful.

See more on this page:

Install Zabbix Server on Debian

Install and Configure Zabbix 6 on Ubuntu

How To Install Zabbix 6 on RHEL 8 | CentOS Stream 8

Cart

Your Cart is Empty

Back To Shop