In this configuration guide, you will learn how to install Zabbix monitoring tool on Rocky Linux 9.
Table of Contents:
- What is Zabbix?
- Environment Specification
- Installing Linux Software Updates
- Installing MariaDB Server
- Installing Zabbix Monitoring Tool
- Installing Zabbix Frontend
- Conclusion
What is Zabbix?:
Zabbix is an open-source software tool to monitor IT infrastructure such as networks, servers, virtual machines, and cloud services. Zabbix collects and displays basic metrics.
Zabbix is designed primarily as an IT infrastructure monitoring tool. New features are generally released every six months to major versions and every 1.5 years to LTS versions.
Released under the terms of GNU General Public License version 2, Zabbix is free software that does not require a license to use any of its features. Even though Zabbix is open-source software, it is a closed development software product, developed by Zabbix LLC based in Riga, Latvia.
Early in its history, Zabbix was described as simple to set up compared to other monitoring solutions. However, later it was considered by some to need a significant amount of manual configuration. As an open-source product however Zabbix focuses on the usage of existing tools and functionality as well as proprietary solutions to achieve a scalable monitoring solution. (Source: Wikipedia)
Environment Specification:
We are using a minimal Rocky Linux 9 virtual machine with following specifications.
- CPU - 3.4 Ghz (2 cores)
- Memory - 2 GB
- Storage - 20 GB
- Operating System - Rocky Linux release 9.0 (Blue Onyx)
- Hostname – postgres-01.centlinux.com
- IP Address - 192.168.116.131/24
We are using a Lenovo - 2022 - IdeaPad 3i - Essential Laptop Computer - Intel Core i5 12th Gen - 15.6" FHD Display - 8GB Memory - 512GB Storage. You can also use the following link to purchase the same at very reasonable price from Amazon.com.
Installing Linux Software Updates:
By using a ssh client, login to your Rocky Linux server as root user.
Set a FQDN (Fully Qualified Domain Name) for your network monitoring server by executing hostnamectl command.
# hostnamectl set-hostname zabbix-01.centlinux.com
Refresh your yum cache as follows.
# dnf makecache --refresh
Rocky Linux 9 - BaseOS 335 kB/s | 1.7 MB 00:05
Rocky Linux 9 - AppStream 430 kB/s | 6.0 MB 00:14
Rocky Linux 9 - Extras 1.7 kB/s | 6.6 kB 00:03
Metadata cache created.
Execute the following dnf command to install Linux software updates.
# dnf update -y
If the above command installs software updates related to Linux Kernel, then you should reboot your operating system with latest Kernel.
# reboot
After successful reboot, check the versions of Linux operating system and Kernel.
# cat /etc/rocky-release Rocky Linux release 9.0 (Blue Onyx) # uname -r 5.14.0-70.22.1.el9_0.x86_64
Installing MariaDB Server:
MariaDB 10.5 is available in standard yum repositories of Rocky Linux 9.0, which is supported by Zabbix 6.0.
Therefore, we are using MariaDB 10.5 in this server configuration guide. However, you can also install latest version of MariaDB Server.
# dnf install -y mariadb-server mariadb
Enable and start database Service.
# systemctl enable --now mariadb.service
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
Initialize database instance and set a password for super admin.
# mariadb-secure-installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! 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!
Verify the database version as follows.
# mysql -V
mysql Ver 15.1 Distrib 10.5.16-MariaDB, for Linux (x86_64) using EditLine wrapper
Installing Zabbix Monitoring Tool:
Zabbix official website provides the installation/configuration steps to install various available versions of Zabbix on your preferred platform.
You are only required to select your platform, Zabbix version, database and web server.
Although the version 6.2 of Zabbix is available, but we prefer to use a LTS (Long Term Support) version, therefore, we are installing Zabbix 6.0.
Use rpm command to install Zabbix 6.0 official yum repository.
# rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.TnPIni: Header V4 RSA/SHA512 Signature, key ID 08efa7dd: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-6.0-4.el9 ################################# [100%]
Build yum cache for newly installed yum repositories.
# dnf makecache
Rocky Linux 9 - BaseOS 323 kB/s | 1.7 MB 00:05
Rocky Linux 9 - AppStream 623 kB/s | 6.0 MB 00:09
Rocky Linux 9 - Extras 941 B/s | 6.6 kB 00:07
Zabbix Official Repository - x86_64 18 kB/s | 67 kB 00:03
Zabbix Official Repository (non-supported) - x8 353 B/s | 1.1 kB 00:03
Zabbix Official Repository (Agent2 Plugins) - x 393 B/s | 1.2 kB 00:03
Metadata cache created.
Install Zabbix server and relevant software packages by using dnf command.
# dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
Login to MariaDB by using mysql command and create a database to use as Zabbix back-end data store.
# 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.5.16-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 database zabbix character set utf8mb4 collate utf8mb4_bin; Query OK, 1 row affected (0.000 sec) MariaDB [(none)]> create user zabbix@localhost identified by '123'; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> quit; Bye
Zabbix software also shipped with a SQL script to create objects in it's back-end data store.
You can use zcat command to unzip and forward the output to mysql command for immediate execution.
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Enter password:
Edit Zabbix configuration file by using vim text editor.
# vi /etc/zabbix/zabbix_server.conf
Locate and set the following directive in this file.
DBPassword=123
Enable and start Zabbix server and agent along with Apache and PHP services.
# systemctl enable --now zabbix-server zabbix-agent httpd php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /usr/lib/systemd/system/zabbix-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
Allow the http service in Linux Firewall.
# firewall-cmd --permanent --add-service=http success # firewall-cmd --reload success
Installing Zabbix Frontend:
Open URL http://zabbix-01.centlinux.com/zabbix in a web browser.
It will show you the Zabbix Frontend welcome page.
Select the default language and click on "Next Step" button.
The installer will perform prerequisite check and display the status of the check.
If you exactly follow the above steps then all the prerequisites will be 'OK'.
Click on "Next Step" button.
Configure your database connection and press "Next Step" button.
Have a look at the Pre installation summary and click on "Next Step".
Provide a name for your Network monitoring server click on "Next Step".
Zabbix front-end installation has been completed. Press "Finish" button.
You have been redirected to Zabbix Web UI login. Login as default username/password i.e. Admin/zabbix.
After successful login, you will see the main dashboard of Zabbix frontend.
Before you start using Zabbix, we recommend that you should read Zabbix 6 IT Infrastructure Monitoring Cookbook by Nathan Liefting & Brian van Baekel.
Conclusion:
In this configuration guide, you have learned how to install Zabbix monitoring tool on Rocky Linux 9.
Good afternoon! This is not a complete instruction for installing zabbix. You need to install apache or nginx and php
ReplyDeleteNo need to separately install apache or php. It is the complete configuration guide of Zabbix server inclusive of all required packages.
Deleteon Minimal Servers you require to install "dnf install glibc-langpack-en" FYI
ReplyDeleteNot necessary. Because we are installing Zabbix from their official yum repository and yum will take care of all dependencies.
Delete