# Zabbix Proxy

In Zabbix, a **proxy** is an intermediary server that collects monitoring data from monitored devices (hosts) and sends it to the Zabbix server. The proxy helps distribute the load, especially in large environments, and can also be used to monitor devices in remote locations where a direct connection to the Zabbix server is not feasible.

<details>

<summary>Proxy types</summary>

In Zabbix, **active** and **passive proxies** refer to different ways a proxy communicates with the Zabbix server.

#### 1. **Active Proxy**:

* The **proxy initiates communication** with the Zabbix server.
* It sends collected data to the server and also fetches configuration updates.
* Useful when the proxy is behind a firewall or in a remote location where the server cannot initiate connections.
* **Pros**: No need for the Zabbix server to reach the proxy, making it ideal for networks with restricted inbound access.
* **Cons**: Slightly more complex to configure in some environments with strict firewalls.

#### 2. **Passive Proxy**:

* The **Zabbix server initiates communication** with the proxy.
* The proxy waits for the server to request data from it.
* Useful when the Zabbix server has access to the proxy, but the proxy cannot easily initiate communication with the server (e.g., due to NAT or firewall restrictions).
* **Pros**: Simpler to set up when the server can reach the proxy directly.
* **Cons**: Requires the server to be able to pull data from the proxy.

#### Summary:

* **Active Proxy**: Proxy pushes data to the server.
* **Passive Proxy**: Server pulls data from the proxy.

In practice, active proxies are more commonly used, as they are more flexible in various network environments.

</details>

## Installating Zabbix Proxy

We can follow the documentation on the official zabbix page to install the lastest zabbix proxy packages and intrgrate it with zabbix sever.

{% hint style="info" %}
[https://www.zabbix.com/download](https://www.zabbix.com/download)
{% endhint %}

Once zabbix proxy is installed we will make the following configuration changes :&#x20;

```bash
sudo nano /etc/zabbix/zabbix_proxy.conf
```

> Note : Proxy has its own database server which is configured while installation.

We will change the following parameters :&#x20;

```bash
# Proxy Mode (0=Active 1=Passive)
ProxyMode = 0
# Connectivity
Server = <zabbix_server_ip>
Server Active = <zabbix_server_ip>
ListenPort = 10051 # CHANGE THIS IF MULTIPLE PROXY
# Hostname 
Hostname = <hostname>
# DB Configuration 
DBHost = <database_ip>
DBName = <database_name>
DBUser = <database_user>
DBPassword = <database_password>
```

Once done we will restart the zabbix proxies and add the zabbix proxies on the zabbix server dashboard.

```bash
sudo systemctl enable zabbix-proxy
sudo systemctl start zabbix-proxy
```

***

On the Zabbix dashboard we will add the proxies inside `Administration > Proxies` on the zabbix dashboard.

<figure><img src="https://2332860236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq6mjlFfyDOi3mV0lemKE%2Fuploads%2FqMpguwXJkb4qcE2akONn%2Fimage.png?alt=media&#x26;token=4ab20b78-e9f5-4738-9f71-17c8833cdac1" alt=""><figcaption></figcaption></figure>

After some time the proxies will enabled and start getting data throught the proxy.

***

## Proxy Groups&#x20;

Once proxies are deployed we can add them into groups which will act as the HA and load balancer for the zabbix hosts.
