Zabbix is an open-source monitoring tool that enables you to keep tabs on the functionality and accessibility of servers, network devices, and software applications. It can be used to keep an eye on a system’s CPU, memory, disk space, network bandwidth, and other functions.
A replacement for CentOS, Almalinux is a community-driven, open-source Linux distribution. It is an operating system that is dependable, secure, and well-suited for server applications.
On an Almalinux server, Zabbix monitoring can be installed to provide you with useful information about the functionality and state of your system. This can assist you in locating and resolving problems before they have an impact on your company’s operations.
Our Server support team is available to answer your questions at any time.
Prerequisites
Be certain of the following before starting::
- A server running Almalinux (version 8.x)
- Access to root or a sudo user with administrative rights
- A strong Zabbix database password
Step 1: Update system packages first
Update your system packages to the most recent version as the first step. You will have the most recent security updates and bug fixes thanks to this.
sudo dnf update
Step 2: Install the Zabbix Repository
You must set up the Zabbix repository in order to install Zabbix monitoring.
sudo dnf install https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
Step 3: Install the Zabbix Server, Frontend, and Agent Packages
You can now install the Zabbix server, frontend, and agent packages after setting up the Zabbix repository.
sudo dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent
Step 4: Install the MySQL/MariaDB Database Server
The monitoring data that Zabbix collects must be kept on a database server. This tutorial will make use of MariaDB.
sudo dnf install mariadb-server
Step 5: Start and enable the database server
Launch the MariaDB database server and set it to launch automatically when the computer boots.
sudo systemctl start mariadb sudo systemctl enable mariadb
Step 6: Run the MySQL Secure Installation Script
Using the MySQL secure installation script to secure the database server is advised.
sudo mysql_secure_installation
Using this script, you can create a root password, eliminate anonymous users, prevent remote root login, and delete test databases.
Step 7: Create a new database and user
Create a user account with access permissions and a fresh database for Zabbix.
sudo mysql -u root -p
CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
CREATE USER 'zabbixuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbixuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Observation: Change “password” to a strong password of your choice.
Step 8: Import the Zabbix Database Schema
Create a new database and import the Zabbix database schema.
sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | sudo mysql -u zabbixuser -p zabbixdb
Step 9: Edit the Zabbix Server Configuration File
To specify the database connection information, edit the Zabbix server configuration file.
sudo nano /etc/zabbix/zabbix_server.conf
Uncomment the following lines (remove the # symbol) and edit them to reflect your database settings by finding them:
DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password
Note: Substitute “password” with the zabbixuser account password you created in step 7.
Step 10: Start and enable Zabbix Server and Agent
The Zabbix server and agent services should be started and enabled.
sudo systemctl start zabbix-server zabbix-agent httpd
sudo systemctl enable zabbix-server zabbix-agent httpd
Step 11: Configure the firewall
Zabbix communicates using ports 80, 443, and 10050. The firewall needs to have these ports opened.
sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --reload
Step 12: Access the Zabbix Web Interface
Open a web browser and enter “/zabbix” after your server’s IP address or domain name. Using “http://your_server_ip/zabbix” as an example.
A prompt to log into the Zabbix web interface will appear. Use the password “zabbix” and the username “Admin”.
The Zabbix web interface, where you can set up hosts, templates, triggers, and other things, ought to now be accessible.
Conclusion
You can monitor the performance and availability of your network equipment, servers, and applications with Zabbix monitoring, a powerful server management tool. You can make sure your system is operating efficiently and spot any potential issues before they become a problem by installing Zabbix on an Almalinux server. This will enable you to keep your server stable and secure while also enhancing your general server management techniques.
In this article, our server support team described the steps to Install Zabbix monitoring on the Almalinux server.