In this tutorial, we will install Nano and review basic commands for navigating the text editor. Table of Contents Introduction For the newbie Linux user,
This blog post covers how to install and configure Zabbix version 7.0-2 on RHEL 9 in detail, including prerequisites, step-by-step instructions, and troubleshooting tips.
Zabbix is a powerful open-source monitoring solution that provides extensive capabilities for monitoring servers, networks, and applications. It offers real-time monitoring, alerting, and performance metrics, making it a popular choice for IT infrastructure management. This guide will walk you through the steps to install and configure Zabbix on RHEL 9.
Before you start, ensure you have the following:
Here’s our system configuration (used for this demonstration):
Hostname | node1.naijalabs.net |
IP address | 192.168.1.219 |
RAM | 8 GB |
Cores | 4 |
Operating System | Red Hat Enterprise Linux release 9.4 (Plow) |
Zabbix Release Version | 7.0-2 |
First, ensure your system is up-to-date:
$ sudo dnf update -y
To install Zabbix, you need to add the Zabbix repository to your system. Download and install the repository package using the following command:
sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-latest.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-latest.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.w31pic: Header V4 RSA/SHA512 Signature, key ID b5333005: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-7.0-2.el9 ################################# [100%]
Run this command to update your system’s repository:
sudo dnf clean all
Now, install the Zabbix server, web frontend, and Zabbix agent:
sudo dnf install zabbix-server-mysql zabbix-sql-scripts zabbix-web-mysql zabbix-apache-conf zabbix-agent -y
NOTE: Make sure EPEL is not enabled on your machine. Installing Zabbix with EPEL enabled can cause multiple package conflicts.
Zabbix requires a database to store its data. Install MySQL (or MariaDB) and set it up:
sudo dnf -y install mysql-server
sudo systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
Secure the MySQL installation: MySQL comes with a script that helps secure your installation. Run it and follow the on-screen instructions.
sudo mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: [Press Enter]
Please set the password for root here.
New password:
Re-enter new password:
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : Y
Success.
By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : Y
Success.
All done!
Create a database and user for Zabbix: Run the following command to log into MySQL.
sudo mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.36 Source distribution
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Inside the MySQL shell, run the following commands:
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Replace 'your_actual_password'
with your preferred password for the zabbix user.
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'your_actual_password';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
Temporarily set the log_bin_trust_function_creators
variable to 1
for the current session:
SET GLOBAL log_bin_trust_function_creators = 1;
EXIT;
Import the initial schema and data for Zabbix server to the database (as the root user):
sudo -i
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -u zabbix -p zabbix
Enter Password:
Enter your Zabbix user password and press the [Enter]
key to continue. Allow a few minutes for the import process to complete.
Using your preferred text editor, modify the Zabbix server configuration file to set the database connection details:
sudo vim /etc/zabbix/zabbix_server.conf
Update the following parameters:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=your_actual_password
NodeAddress=localhost:10051
Edit the Zabbix Apache configuration file to set the correct timezone:
sudo nano /etc/zabbix/zabbix.conf.php
Uncomment and set your timezone. Here’s an example:
php_value date.timezone America/New_York
Start and Enable Apache to apply the changes:
sudo systemctl enable --now httpd
Enable and start the Zabbix server and agent services:
sudo systemctl enable --now zabbix-server zabbix-agent
Ensure the firewall allows traffic on HTTP and Zabbix ports:
sudo firewall-cmd --permanent --add-port=10051/tcp
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
If SELinux is enabled (it should be btw), enter the following command to allow the Zabbix frontend to connect to the server:
sudo setsebool -P httpd_can_network_connect on
Open a web browser and navigate to http://your_server_ip/zabbix
. Follow the on-screen instructions to complete the installation. You will need to enter the database details you configured earlier.
Parameter | Value |
---|---|
Database type | MySQL |
Database host | localhost |
Database name | zabbix |
User | zabbix |
Password | your_actual_password (or zabbix for this demonstration) |
Click the [Next Step]
button to proceed.
Photo by admingeek from Infotechys.com
Verify preliminary checks and click the [Next Step]
button to proceed.
Photo by admingeek from Infotechys.com
Enter your Zabbix user password and click the [Next Step]
button to proceed.
Photo by admingeek from Infotechys.com
Enter your Zabbix server name. You may also modify the default timezone and theme to your preference. Then, click the [Next Step]
button to proceed.
Photo by admingeek from Infotechys.com
Congratulations on completing the Zabbix frontend setup! You will now see a summary page. Click the [Next Step] button to finalize the installation. This will generate a configuration file located at /etc/zabbix/web/zabbix.conf.php
, which you can modify as needed to suit your environment.
Photo by admingeek from Infotechys.com
Finally, log into the Zabbix frontend using the default credentials:
Photo by admingeek from Infotechys.com
If you encounter any issues during installation, check the Zabbix server and agent logs for detailed error messages:
/var/log/zabbix/zabbix_server.log
/var/log/zabbix/zabbix_agentd.log
Make sure all services are running correctly:
sudo systemctl status zabbix-server zabbix-agent httpd mysqld
By following these steps, you ensure a robust setup for your monitoring needs. Zabbix is a versatile tool that, once configured correctly, can provide invaluable insights into your IT infrastructure. The Zabbix documentation is also a great resource to reference for troubleshooting.
Photo by admingeek from Infotechys.com
You have successfully installed and configured Zabbix on RHEL 9. Zabbix provides a comprehensive monitoring solution that can be tailored to fit your specific requirements. You can now start adding hosts and services to monitor, setting up alerts, and exploring the powerful features that Zabbix offers.
Pro Tip: Regularly update your Zabbix installation to benefit from the latest features and security updates. Additionally, consider setting up SSL for secure access to the Zabbix web interface.
Did you find this article useful? Your feedback is invaluable to us! Please feel free to share your thoughts in the comments section below.
Related Posts
In this tutorial, we will install Nano and review basic commands for navigating the text editor. Table of Contents Introduction For the newbie Linux user,
This guide aims to equip you with the knowledge needed to install ELK stack on RHEL9 | CentOS9 effortlessly. By following these steps, you can
In this article, we will review in detail how to install sublime text4 on CentOS8 or RHEL8 and also provide examples. Table of Contents Brief