billysoftacademy.com

Learn how to how to Install Zabbix Monitoring Tool on Fedora

Introduction

Zabbix is a monitoring solution that is available as an open-source tool. It enables system administrators to keep track of networks, servers, virtual machines and cloud services through a web-based interface. It comes with a wide range of pre-built templates – both official and community-developed – which can be used to integrate with different applications, networks and endpoints. Additionally, Zabbix has the ability to automate certain monitoring processes. It provides various automation capabilities such as packet loss rate, memory utilization, predictive bandwidth trends and downtime trends. In this article, you will learn how to install Zabbix on a Fedora Linux server.

Requirements

The following is a list of items needed to complete the installation successfully:
1) A computer or self hosted virtual machine with 4GB RAM, a dual core processor or 25GB of free disk space
2) An SSH client such as Putty or the MacOS terminal app
3) Fedora 38 or any newer version
4) Cloud Servers: A fully qualified domain name with an A record pointing to the IP address of the Fedora server
5) A stable internet connection.

Overview

The following is an overview of the steps covered in this tutorial:
1) Downloading and installing the LAMP stack.
2) Creating a database for Zabbix.
3) Installing Zabbix server.
4) Accessing Zabbix WebAdmin and completing the installation.
5) Conclusion and next steps.

Step 1: Downloading and installing the LAMP stack

To install LAMP server on your system, you can follow the steps given below:

Step 1: Update the server and install Apache and MariaDB servers using the following commands:

dnf update -y
dnf -y install httpd mariadb-server

Step 2: Add the PHP Remi repository and install the PHP 7.4 Remi module by running the below command:

dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module install php:remi-7.4

Step 3: Install PHP with other required extensions:

dnf install php php-fpm php-gd php-mysqlnd

Step 4: Edit the PHP-FPM configuration file by running:

nano /etc/php-fpm.d/www.conf

Then, modify the following lines:

listen = /run/php-fpm/zabbix.sock
listen.allowed_clients = 0.0.0.0

Step 5: Save and close the file, then create a new Zabbix file by running:

nano /etc/php-fpm.d/zabbix.conf

Define your date and time zone by adding:

php_value[date.timezone] = UTC

Step 6: Edit the PHP configuration file by running:

nano /etc/php.ini

Change the following values:

post_max_size = 16M
max_execution_time = 300
max_input_time = 300

Step 7: Save the file, then enable Apache, MariaDB, and PHP-FPM services by running:

systemctl start httpd mariadb php-fpm
systemctl enable httpd mariadb php-fpm

Step 2: Create a database for Zabbix

To proceed with the installation of Zabbix, you need to create a database and user for it. Follow the steps below to create the Zabbix database. Step 1: Connect to the MariaDB shell by running the following command:
mysql
Step 2: Once you are connected, create a database and user for Zabbix by running the following commands:
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';
Replace the ‘password’ with a strong password of your choice. Step 3: Next, grant all the privileges to the Zabbix database by running the following command:
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'password';
Again, replace the ‘password’ with the password you chose in the previous step. Step 4: Finally, flush the privileges and exit from the MariaDB shell by running the following commands:
FLUSH PRIVILEGES;
EXIT;
That’s it! Your Zabbix database is now ready to use.

Step 3: Installing Zabbix server

The Zabbix server package is not available in the default Fedora repository, so you will need to install the Zabbix repository to your server using the following command:
rpm -Uvh https://repo.zabbix.com/zabbix/5.5/rhel/8/x86_64/zabbix-release-5.5-1.el8.noarch.rpm

 Next, install the Zabbix server along with other required packages using the following command:
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

 After that, download the Zabbix source using the following command:
wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.37.tar.gz

 Extract the downloaded file using the following command:
tar zxvf zabbix-5.0.37.tar.gz

 Change the directory to the extracted directory using the following command:
cd zabbix-5.0.37/database/mysql/

 Import the database schema, images, and data using the following commands:
mysql -uzabbix -p zabbix < schema.sql
mysql -uzabbix -p zabbix < images.sql
mysql -uzabbix -p zabbix < data.sql

 Next, edit the Zabbix configuration using the following command:
nano /etc/zabbix_server.conf

 Change the following lines to specify your database:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password

 Save and close the file, then restart all the required services using the following command:
systemctl restart zabbix-server zabbix-agent httpd php-fpm

 Make sure to enable the Zabbix server, Zabbix agent, Apache, and PHP-FPM services using the following command:
systemctl enable zabbix-server zabbix-agent httpd php-fpm

Step 4: Accessing Zabbix WebAdmin and completing the installation

To access the Zabbix web installation, open your web browser and go to the URL http://your-server-ip/zabbix. This will take you to the Zabbix welcome screen. Click on Next step to proceed. You will then see the pre-requisites check screen. Click on Next step to continue. Next, you will see the database configuration screen. Enter your database settings and click on Next step. On the Zabbix server details screen, provide your Zabbix host, port, and name. Then, click on Next step to proceed. You will then see the installation summary screen. Click on Next step to proceed. On the next screen, click on Download the configuration file to download the zabbix.conf.php file to your local machine. After downloading the file, create a new directory on your server using the following command:
mkdir -p /usr/share/zabbix/etc/zabbix/web/
Next, copy the zabbix.conf.php file to /usr/share/zabbix/etc/zabbix/web/.Go back to the web installation screen and click on the Finish button. This will take you to the Zabbix login screen.Enter the default username and password as Admin / zabbix and click the Sign in button. You will then see the Zabbix dashboard.

Conclusion

In conclusion, this tutorial has guided you through the process of installing a Zabbix server on Fedora Linux. You have learned how to download and install the LAMP stack, create a database for Zabbix, install the Zabbix server package, and access the Zabbix WebAdmin to complete the installation. 

With Zabbix now up and running, you can begin monitoring your networks, servers, virtual machines, and cloud services. If you have any questions or encounter any difficulties during the installation process, feel free to consult the Zabbix documentation or online forums for further assistance.

Scroll to Top