Share your love
Install Zabbix 6.4 on AlmaLinux 9
This tutorial intends to teach you to Install and Configure Zabbix 6.4 on AlmaLinux 9. Also, you have learned to access your Zabbix dashboard from a web interface. Zabbix is an open-source monitoring tool. It provides monitoring metrics, such as network utilization, CPU load, and disk space consumption.
Zabbix 6.4 is the newly released version of Zabbix. It has new features improvements and bug fixes. For more information, you can visit Zabbix 6.4 Release Notes.
Install and Configure Zabbix 6.4 on AlmaLinux 9
Before you start your Zabbix installation, you need some requirements.
Requirements
First, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide on Initial Server Setup with AlmaLinux 9.
Also, you need to have the LAMP stack installed on your server. To do this, you can check our guide on Install LAMP Stack on AlmaLinux 9.
Step 1 – Download and Install Zabbix 6.4 on AlmaLinux 9
First, if you have an Epel repo installed on your server, you must disable the Zabbix packages provided by EPEL. To do this, open the file with the command below:
sudo vi /etc/yum.repos.d/epel.repo
Add the following line to the file:
[epel]
...
excludepkgs=zabbix*
When you are done, save and close the file.
At this point, you need to use the following command to add the Zabbix 6.4 repository on AlmaLinux 9:
# sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
# sudo dnf clean all
Next, you can use the following command to install Zabbix 6.4 on your server:
sudo dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
When your installation is completed, you need to create a Zabbix database and user. To do this, proceed to the next step.
Step 2 – Configure MariaDB for Zabbix on AlmaLinux 9
Log in to your MariaDB console with the following command:
sudo mysql -u root -p
Next, from your MariaDB console run the following command to create a user, here we named it zabbixuser, and you can choose your desired name. Remember to choose a strong password for your user.
MariaDB [(none)]> CREATE USER zabbixuser@localhost IDENTIFIED BY 'password';
Create the database with the command below:
MariaDB [(none)]> CREATE DATABASE zabbixdb character set utf8mb4 collate utf8mb4_bin;
Now grant all the privileges to the Zabbix database user:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO zabbixuser@localhost;
Flush the privileges and exit from your MariaDB console with the command below:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Import Database Schema
Here you need to import the database schema with the following command:
# sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -u zabbixuser -p zabbixdb
You will be asked to enter your Zabbix user password.
Change Database Settings on Zabbix Configuration File
Now you need to edit the Zabbix configuration file on AlmaLinux 9.
Open the file with your favorite text editor, we use the vi editor:
sudo vi /etc/zabbix/zabbix_server.conf
Find the line below and change them to your database settings:
DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password
You need to uncomment the DBHost and DBPassword lines by removing the “#” from the beginning of the lines.
When you are done, save and close the file.
Step 3 – Configure PHP-FPM for Zabbix on AlmaLinux 9
At this point, you need to specify the timezone setting in the Zabbix configuration on AlmaLinux 9. To do this, run the command below:
sudo vi /etc/php-fpm.d/zabbix.conf
Add the following line to the file with your time zone:
php_value[date.timezone] = America/New_York
When you are done, save and close the file.
Restart all the services to apply the changes:
sudo systemctl restart zabbix-server zabbix-agent httpd php-fpm
To enable the services to start on boot, run the following command:
sudo systemctl enable zabbix-server zabbix-agent php-fpm
Step 4 – Configure SELinux and Firewall for Zabbix on AlmaLinux 9
At this point, you need to set SELinux to be allowed to access the Zabbix frontend on AlmaLinux 9. To do this, run the following command:
# sudo setenforce 0
# sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
Then, you need to allow traffic on ports 10050 and 10051 through the AlmaLinux firewall with the command below:
# sudo firewall-cmd --add-service=http --permanent
# sudo firewall-cmd --add-port={10051,10050}/tcp --permanent
Reload the firewall to apply the changes:
sudo firewall-cmd --reload
Step 5 – Access Zabbix 6.4 Dashboard via Web Interface
Here you access the Zabbix web interface on AlmaLinux 9 by typing your server’s IP address in your web browser followed by /Zabbix:
http://server-ip/zabbix
You will see the Zabbix welcome page just click on the next step.
In the next window, you will see the check for the prerequisites. Make sure all the required PHP extensions are installed then click on the Next step button.
Then, you will see the configure DB connection page. Set your database details and click on the next step.
Next, you need to choose the server name and default theme and click the Next step.
Here you need to check the pre-installation summary and click Next step.
Next, you need to click on the finish button to complete your Zabbix 6.4 installation.
Now you will get into the Zabbix login screen. Enter the Admin as the username and zabbix as the password and click on the sign-in button.
You will see your Zabbix 6.4 dashboard.
From your dashboard, you can monitor things such as:
- Network Monitoring
- Server Monitoring
- Cloud Monitoring
- Services Monitoring
- KPI/SLA monitoring
Conclusion
At this point, you have learned to Install and Configure Zabbix 6.4 on AlmaLinux 9. Zabbix is a powerful monitoring tool that you can use for your servers and systems. Hope you enjoy using it. You may like these articles on the Orcacore website:
How To Install Monitorix on AlmaLinux 8