Set up Zabbix proxy for distributed network monitoring

Intermediate 45 min Apr 24, 2026 19 views
Ubuntu 24.04 Debian 12 AlmaLinux 9 Rocky Linux 9

Configure Zabbix proxy servers to distribute monitoring load across multiple network segments, reduce server load, and monitor remote locations through secure proxy connections.

Prerequisites

  • Running Zabbix server installation
  • Separate server for proxy deployment
  • Network connectivity between proxy and server
  • Root or sudo access on proxy server

What this solves

Zabbix proxy servers act as data collectors that forward monitoring information to your main Zabbix server. This setup reduces network traffic, allows monitoring of remote locations behind firewalls, and distributes the monitoring load across multiple servers. You need proxies when monitoring devices across different network segments, remote offices, or when your main server can't directly reach all monitored hosts.

Prerequisites

You need a running Zabbix server installation and a separate server for the proxy. The proxy server should have network access to both the monitored devices and the main Zabbix server. For database requirements, you can use either SQLite (for smaller deployments) or PostgreSQL/MySQL for larger environments.

Step-by-step configuration

Update system packages

Start by updating your package manager to ensure you have the latest security patches and package information.

sudo apt update && sudo apt upgrade -y
sudo dnf update -y

Add Zabbix repository

Add the official Zabbix repository to get the latest stable version of Zabbix proxy. This ensures you get security updates and bug fixes directly from the Zabbix team.

wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
sudo apt update
sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-7.0-2.el9.noarch.rpm
sudo dnf clean all
sudo dnf update

Install Zabbix proxy with database

Install the Zabbix proxy package along with your chosen database backend. SQLite is simpler for smaller deployments, while PostgreSQL offers better performance for larger environments.

# For SQLite backend (recommended for smaller deployments)
sudo apt install -y zabbix-proxy-sqlite3

For PostgreSQL backend (recommended for larger deployments)

sudo apt install -y zabbix-proxy-pgsql postgresql postgresql-contrib

# For SQLite backend
sudo dnf install -y zabbix-proxy-sqlite3

For PostgreSQL backend

sudo dnf install -y zabbix-proxy-pgsql postgresql postgresql-server postgresql-contrib

Configure database for PostgreSQL (optional)

If you chose PostgreSQL, set up the database and user for the Zabbix proxy. Skip this step if you're using SQLite.

sudo systemctl enable --now postgresql
sudo -u postgres createuser --pwprompt zabbix_proxy
sudo -u postgres createdb -O zabbix_proxy zabbix_proxy

Import the initial schema for PostgreSQL:

zcat /usr/share/zabbix-sql-scripts/postgresql/proxy.sql.gz | sudo -u zabbix_proxy psql zabbix_proxy

Configure Zabbix proxy settings

Edit the main proxy configuration file to set up database connection, server details, and proxy-specific settings. The proxy needs to know how to connect to your Zabbix server and which database to use.

# Proxy mode (0 = active proxy, 1 = passive proxy)
ProxyMode=0

Zabbix server IP address

Server=203.0.113.10

Proxy hostname (must match the name configured in Zabbix server frontend)

Hostname=proxy-office-london

Listen port for passive proxies

ListenPort=10051

Database configuration for SQLite

DBName=/var/lib/zabbix/zabbix_proxy.db

Database configuration for PostgreSQL (uncomment if using PostgreSQL)

DBHost=localhost

DBName=zabbix_proxy

DBUser=zabbix_proxy

DBPassword=your_secure_password

How often proxy retrieves configuration data from server (seconds)

ConfigFrequency=3600

How often proxy sends collected data to server (seconds)

DataSenderFrequency=1

Proxy will keep data for N hours in case of no connectivity with Zabbix server

ProxyOfflineBuffer=1

Enable remote commands from Zabbix server

EnableRemoteCommands=1

Log file location

LogFile=/var/log/zabbix/zabbix_proxy.log LogFileSize=10 DebugLevel=3

PID file

PIDFile=/run/zabbix/zabbix_proxy.pid

Cache settings for better performance

CacheSize=8M HistoryCacheSize=16M HistoryIndexCacheSize=4M TrendCacheSize=4M ValueCacheSize=8M

Set correct file permissions

Create the SQLite database directory and set appropriate ownership for the zabbix user. This ensures the proxy can read configuration files and write to the database.

sudo mkdir -p /var/lib/zabbix
sudo chown -R zabbix:zabbix /var/lib/zabbix
sudo chown -R zabbix:zabbix /var/log/zabbix
sudo chmod 755 /var/lib/zabbix
sudo chmod 644 /etc/zabbix/zabbix_proxy.conf
Never use chmod 777. It gives every user on the system full access to your files. The zabbix user needs specific access to its directories, not world-writable permissions.

Configure firewall rules

Open the necessary ports for Zabbix proxy communication. Port 10051 is for passive proxy mode, and port 10050 is for agent communication.

sudo ufw allow 10051/tcp comment "Zabbix proxy"
sudo ufw allow 10050/tcp comment "Zabbix agent"
sudo ufw reload
sudo firewall-cmd --permanent --add-port=10051/tcp
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --reload

Enable and start Zabbix proxy

Start the Zabbix proxy service and enable it to start automatically on system boot. Check the status to ensure it's running properly.

sudo systemctl enable --now zabbix-proxy
sudo systemctl status zabbix-proxy

Register proxy with Zabbix server

Log into your Zabbix server web interface and add the new proxy. Go to Administration → Proxies → Create proxy and configure the following settings:

SettingValueDescription
Proxy nameproxy-office-londonMust match Hostname in proxy config
Proxy modeActiveProxy connects to server
Proxy addressLeave empty for active modeNot needed for active proxies
DescriptionLondon office monitoring proxyOptional description

Click Add to create the proxy registration.

Configure monitoring zones

Set up host groups and assign them to specific proxies for distributed monitoring. In your Zabbix server interface, go to Configuration → Host groups and create location-specific groups.

London-Office-Servers
London-Office-Network
London-Office-Workstations

When adding hosts to these groups, select the appropriate proxy in the "Monitored by proxy" field. This ensures traffic from those hosts flows through the designated proxy server.

Set up proxy load balancing

For high availability, configure multiple proxies for the same network zone. Create additional proxy servers following the same steps, then distribute hosts between them. Use different proxy names like "proxy-london-01" and "proxy-london-02".

You can also configure proxy failover by setting up backup proxies and switching host assignments when a primary proxy fails.

Verify your setup

Check that your proxy is properly communicating with the Zabbix server and collecting data from monitored hosts.

# Check proxy service status
sudo systemctl status zabbix-proxy

Check proxy logs for errors

sudo tail -f /var/log/zabbix/zabbix_proxy.log

Test database connectivity (SQLite)

sudo -u zabbix sqlite3 /var/lib/zabbix/zabbix_proxy.db ".tables"

Check proxy connectivity to Zabbix server

sudo -u zabbix zabbix_proxy -R config_cache_reload

Monitor proxy performance

sudo netstat -tulpn | grep :1005

In the Zabbix server web interface, go to Administration → Proxies to verify the proxy shows as "Active" with a recent "Last seen" timestamp. Check Reports → System information to see proxy statistics and performance metrics.

Configure proxy database connection

For production environments, properly configure database connections with connection pooling and timeout settings. Edit the proxy configuration to optimize database performance:

# Database connection timeout
DBSocket=/var/run/postgresql
Timeout=30

Connection pooling for PostgreSQL

DBMaxOpenFiles=100

Housekeeping settings

HousekeepingFrequency=1 MaxHousekeeperDelete=5000

Buffer settings for high load

ProxyLocalBuffer=0 ProxyOfflineBuffer=24

Set up distributed monitoring zones

Create logical monitoring zones based on network topology and geographical locations. This approach helps organize your infrastructure and improves monitoring efficiency.

Design monitoring zones

Plan your proxy deployment based on network segments, geographic locations, and security boundaries. Common zone patterns include:

  • Geographic zones: Europe-West, Asia-Pacific, Americas-East
  • Network zones: DMZ, Internal-LAN, Management-Network
  • Environment zones: Production, Staging, Development
  • Service zones: Database-Tier, Web-Tier, Application-Tier

Implement zone-based host assignment

Configure automatic host assignment to proxies based on network discovery rules. Set up network discovery to automatically assign newly discovered hosts to the appropriate proxy based on IP ranges or subnet masks.

# London office subnet: 10.1.0.0/24 → proxy-london

New York office subnet: 10.2.0.0/24 → proxy-newyork

DMZ subnet: 192.168.100.0/24 → proxy-dmz

Management subnet: 172.16.0.0/24 → proxy-mgmt

Common issues

SymptomCauseFix
Proxy shows as inactiveNetwork connectivity or firewallCheck port 10051 connectivity: telnet zabbix-server 10051
"Cannot connect to database"Database permission or path issueCheck ownership: sudo chown zabbix:zabbix /var/lib/zabbix/zabbix_proxy.db
High memory usageCache sizes too large for systemReduce CacheSize and HistoryCacheSize in config
Data not appearing in serverProxy hostname mismatchEnsure Hostname in config matches proxy name in web interface
"Permission denied" errorsIncorrect file ownershipFix ownership: sudo chown -R zabbix:zabbix /var/log/zabbix
Proxy stops respondingDatabase lock or corruptionRestart service: sudo systemctl restart zabbix-proxy

Performance optimization

For larger deployments, optimize proxy performance by tuning cache settings, database configuration, and system resources. Monitor proxy performance through the Zabbix server interface and adjust settings based on your specific load patterns.

Consider using Prometheus and Grafana monitoring to track proxy performance metrics and set up alerts for proxy health issues. You can also integrate with NGINX monitoring if you're using a reverse proxy in front of your Zabbix infrastructure.

Next steps

Running this in production?

Want this handled for you? Setting this up once is straightforward. Keeping it patched, monitored, backed up and performant across environments is the harder part. See how we run infrastructure like this for European teams.

Automated install script

Run this to automate the entire setup

Need help?

Don't want to manage this yourself?

We handle managed devops services for businesses that depend on uptime. From initial setup to ongoing operations.