installation and configuration of Zabbix Proxy on Ubuntu - Hammadiqbal02/Installation-of-Zabbix-on-Ubuntu- GitHub Wiki

image

Zabbix proxy is a service that can collect performance and availability data from the end devices on behalf of the Zabbix server. You can use a Zabbix proxy to monitor remote locations behind the firewall or locations that have unreliable communication and to offload the Zabbix server in large environments.

image

install Zabbix according to your requirement from Zabbix official site

https://www.zabbix.com/download?zabbix=6.4&os_distribution=alma_linux&os_version=9&components=proxy&db=mysql&ws=

image

on Docker Proxy , Agnet and other services files/containers is also here

https://www.zabbix.com/container_images

image

you can install zabbix proxy fromm zabbix offical site by docker pull commadnd

👍 docker pull zabbix/zabbix-proxy-mysql

https://hub.docker.com/r/zabbix/zabbix-proxy-mysql

image

Step 1: Install Zabbix Proxy on Ubuntu

Before you install proxy, keep in mind that your proxy version must match the Zabbix server version!

You can check Zabbix server version with the command “zabbix_server -V“:

root@zabbix-server-ubuntu:~$ zabbix_server -V zabbix_server (Zabbix) 6.0.0

Setup Zabbix 6 .deb package and install proxy server:

Zabbix 6.0 LTS version (supported until February, 2027) wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-3+ubuntu$(lsb_release -rs)_all.deb sudo dpkg -i zabbix-release_6.0-3+ubuntu$(lsb_release -rs)_all.deb sudo apt update sudo apt -y install zabbix-proxy-mysql zabbix-sql-scripts

                ---  OR ----

Zabbix 6.4 standard version (supported until November, 2023) wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu$(lsb_release -rs)_all.deb sudo dpkg -i zabbix-release_6.4-1+ubuntu$(lsb_release -rs)_all.deb sudo apt update sudo apt -y install zabbix-proxy-mysql zabbix-sql-scripts

Step 2: Configure the database

#use Apache2 Mysql

**already install while installing Zabbix server if you don't know click on below page **

https://github.com/Hammadiqbal02/Installation-of-Zabbix-on-Ubuntu-/wiki/installation-of-Zabbix-&-Monitoring-window-machine-on-Zabbix

Use Maria DB Mysql

In this installation, I will use password rootDBpass as root database password and zabbixDBpass as Zabbix proxy database password. Consider changing your password for security reasons.

sudo apt install software-properties-common -y curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup sudo bash mariadb_repo_setup --mariadb-server-version=10.6

sudo apt update sudo apt -y install mariadb-common mariadb-server-10.6 mariadb-client-10.6

Once the installation is complete, start the MariaDB service and enable it to start on boot using the following commands:

sudo systemctl start mariadb sudo systemctl enable mariadb

---- OR ----

sudo systemctl start apache2 sudo systemctl enable apache2

---- OR ----

sudo systemctl start mysql sudo systemctl enable mysql

b. Reset root password for database

Secure MySQL/MariaDB by changing the default password for MySQL root:

sudo mysql_secure_installation

Enter current password for root (enter for none): Press Enter Switch to unix_socket authentication [Y/n] y Change the root password? [Y/n] y New password: Re-enter new password: Remove anonymous users? [Y/n]: y Disallow root login remotely? [Y/n]: y Remove test database and access to it? [Y/n]: y Reload privilege tables now? [Y/n]: y

Create database

sudo mysql -uroot -p'rootDBpass' -e "create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin;" sudo mysql -uroot -p'rootDBpass' -e "grant all privileges on zabbix_proxy.* to zabbix@localhost identified by 'zabbixDBpass';"

d. Import initial schema and data.

Import database shema for Zabbix server (could last up to 5 minutes):

sudo cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -uzabbix -p'zabbixDBpass' zabbix_proxy

Step 3: Zabbix proxy configuration

In my setup, I will name proxy as Zabbix proxy and configure it to communicate with the Zabbix server that has IP address "zabbix server " where zabbix is running – please change those accordingly to match your environment.

Open file zabbix_proxy.conf with the command:

sudo nano /etc/zabbix/zabbix_proxy.conf

and add database password and configuration frequency in this format anywhere in the file:

DBPassword=zabbixDBpass ConfigFrequency=100 #optional

“ConfigFrequency” parameter defines how often proxy retrieves configuration data from the Zabbix server in seconds

Server=zabbix server ip Hostname=Zabbix proxy DBName=zabbix_proxy DBUser=zabbix

image

in zabbix_proxy.conf

Proxy Mode

ucommment it

Active and Passive 👍 0 is Proxy active mode 1 is Proxy Passive mode


Problem 👍

if your PID KILL due to enable or restart both the proxy and Zabbix server use the below method

you will simply change the type=forking to simple as per mention file
image


Step 4: Start and enable proxy service

sudo systemctl restart zabbix-proxy sudo systemctl enable zabbix-proxy

sudo systemctl restart zabbix-server sudo systemctl enable zabbix-server

Step 5: Register proxy server in the Zabbix frontend

Now that your proxy server is running, you need to register it in the Zabbix frontend using “Proxies” option under the “Administration” section. Click on the “Create proxy” button on the right, then set “Proxy name” to Zabbix proxy and “Proxy mode” to “Active”.

Note that for a proxy to work in active mode “Proxy name” must be the same as the “hostname” parameter in “zabbix_proxy.conf” file.

image Immediately after adding a proxy to the frontend, you will be informed that the proxy has never been seen.

image

However, if you wait for 100 seconds “Last seen (age)” status will display seconds instead of “Never” which means that the proxy is communicating with the Zabbix server.

image

Step 6: Configure hosts in Zabbix to be monitored by a proxy

Zabbix proxy is running and communicating with the Zabbix server, but it is not gathering any data because we didn’t do the last crucial step! We need to configure hosts in Zabbix to be monitored by the proxy server.

Let’s do that together, go to the “Host” option under the “Configuration” section and select hosts that need to monitored by the proxy server. image

After you have select hosts click on the “Mass update” button, then under the “Host” options select our newly added proxy in the “Monitored by proxy” dropdown and finally click the “Update” button just as shown in the image below.

image