Configure and work with Zabbix Monitoring tool version 6 in Docker Containers
Zabbix is an open-source monitoring software that provides tools for tracking, monitoring, and managing the health and performance of networks, servers, applications, and other IT resources. It is designed to gather and display a wide range of metrics in real-time, helping system administrators and IT professionals to detect issues, troubleshoot problems, and ensure the smooth operation of their infrastructure.
Key features of Zabbix include:
Monitoring: Zabbix can monitor various aspects of IT infrastructure, such as server health, network performance, application availability, and more.
Alerting: It provides flexible alerting mechanisms, allowing users to set up triggers and receive notifications when predefined thresholds are breached.
Visualization: Zabbix offers a web-based interface with customizable dashboards and graphs, providing a visual representation of performance data.
Automation: Zabbix supports automation through the use of templates, allowing for the streamlined configuration and management of monitoring tasks.
Scalability: It is scalable and can handle large-scale environments, making it suitable for both small businesses and large enterprises.
Extensibility: Zabbix supports a wide range of plugins and integrations, allowing users to extend its functionality and integrate it with other tools.
Historical Data Storage: Zabbix stores historical data, enabling users to analyze trends, forecast future resource needs, and maintain a historical record of system performance.
Security: It provides security features such as user authentication, access control, and encryption to ensure the confidentiality and integrity of monitoring data.
Zabbix uses a client-server architecture where agents are installed on monitored devices, and the Zabbix server collects and processes data from these agents. The collected data is then presented through the web interface, allowing users to analyze and manage their IT infrastructure effectively. Zabbix has gained popularity in the IT industry as a robust and feature-rich monitoring solution.
Now let’s dive into the nub and see how we can run the Zabbix Server 6.0 in Docker Containers.
Step 1: Install Docker Runtime on the System
For this guide, we need the Docker Engine installed. If you already have it installed, then you can skip this step. Otherwise, install docker Engine using the below commands that best work for your system.
The quickest way to install docker is by using the below commands:
Alternatively, use the below methods as per the OS flavor:
On Debian:
On Ubuntu:
On RHEL/CentOS 8/Rocky Linux 8/Alma Linux 8:
Once Docker has been installed, you need to verify the installation using the command:
Start and enable the Docker service.
Add your system user to the docker group.
On macOS:
On Rhel-based systems, Before proceeding to install, we need to disable SELinux or set it in permissive mode as below:
Method 1:- Install Zabbix Server 6.0 in Docker Containers
In this Article, I am showing that how will we run Zabbix with MySQL database, although one can still run with PostgreSQL.
We will have the following containers:
MySQL server
Zabbix server – with MySQL database support
Zabbix web interface – based on Nginx web server with MySQL database support
Zabbix proxy – with MySQL database support
Zabbix Java Gateway
Using docker, you can just run the containers as below:
Now create the MySQL database container for Zabbix:
2. The next container to be deployed is the Zabbix Java gateway.
3. Deploy the Zabbix server with MySQL database support and link it with the created MySQL instance. Remember to keep proper and the correct details:
4. Create the Zabbix web interface and link it to the created Zabbix server and MySQL.
Verify if the containers are running:
This service is exposed on port 80/TCP to the host machine. You can now access the Zabbix web interface by navigating to port 80.
Method 2:- Install and setup Zabbix Server using Docker Compose
First we need to have it Install Docker compose on your system using the below command.
2. Give the execute permissions to the docker compose installed file and move to your local binary file path.
3. Now verify whether its installed or not
4. Create a dedicated network for all the Zabbix components:
5. Check whether the network is created by checking with below command
6. Now, create a docker-compose file for the containers and its yml file.
Note: Remove current containers if you already have it installed in the method 1. With this command it stops the container and delete it
7. Once check the docker containers and start composing it for creating the containers
8. Verify if the containers are running or not:
9. Now install the firewalld service and allow the required ports
10. The Zabbix 6.0 web UI is now accessible through port 80 and can be reached using the URL http://IP_address or http://domain_name
Provide the default credentials for logging into the Zabbix web interface.
username: Admin & Password: zabbix
Upon successful login, you should be able to view the following dashboard.
Proceed to change the admin password by navigating to Administration > Users > Admin > Password > Change Password.
After setting your preferred password, click on the "Update" button to confirm the changes.
Step 2 – Configure the Zabbix Monitoring Target host or clients
Now, let's configure this server for monitoring by installing the Zabbix agent package on a client machine. The Zabbix agent package can be installed using the following steps:
After installing the Zabbix agent on the host you wish to monitor, edit the configuration file to include the Zabbix server details.
Edit the file as below:
Now, Start and enable the zabbix-agent service:
Additionally, you need to allow the port through the firewall:
Install the firewalld service and start it if it requires
Step 3: Add the Zabbix Agent (client host) to the Zabbix Server
The Zabbix agent can now be added to the server by navigating to Configuration > Hosts > Create host.
You need to provide the following details:
The hostname of the Zabbix agent to be monitored, which should match the one entered in the agent config file.
A visible name for the Zabbix agent.
Select the group or add a new group from the “Groups” field.
The IP address of the Zabbix agent.
Zabbix agent service port, where the default port is 10050.
Fill in the details as shown below:
Don't forget to add the monitoring templates depending on what you want to monitor on the agent. Then click "Add" to add the agent. Once added, the agent will be available as shown below:
After adding the agent, go to Monitoring > Hosts, and choose the desired host for monitoring. Then, select graphs to view the data.
Explore the various options available in Zabbix for monitoring purposes. This concludes the guide on installing and running Zabbix Server 6.0 in Docker Containers. Additionally, we've covered the process of adding Zabbix agents to the server. I trust this information is valuable.
IT
4moalma9?!
Student At Beltei International University
5mocan you lab , How to deploy zabbix and grafana using docker swarm on ubuntu and HA database uisng PostgreSQL for zabbix install on RedHat?