Zabbix Proxy on a VPS: Distributed Monitoring for Remote Sites
Set up a Zabbix Proxy that collects monitoring data from remote hosts and forwards it to your central Zabbix server: configuration, database, web interface and tuning.
Zabbix Proxy is part of the Zabbix monitoring system. It collects data from hosts at a remote site or network and passes it on to your central Zabbix server.
A proxy takes load off the main server, makes it easier to monitor infrastructure spread across many locations, and keeps collecting data when the link to the server is slow or drops for a while. It supports every standard collection method: Zabbix agent, SNMP, IPMI, JMX, simple checks and external scripts. It has no web interface of its own: you manage it through its configuration file and your central Zabbix server.
- Operating system: Ubuntu 22.04
- Minimum server: 1 vCPU, 1 GB RAM and 15 GB of disk
- Management: the configuration file over SSH, and your Zabbix server’s web interface
Check what is installed
A ready Zabbix Proxy is running and starts automatically after a reboot. Its files are:
- Configuration: /etc/zabbix/zabbix_proxy.conf
- Local database (SQLite by default): /var/lib/zabbix/zabbix_proxy.db
- Log: /var/log/zabbix/zabbix_proxy.log
If Zabbix Proxy is not on your server yet, install the zabbix-proxy-sqlite3 package from the official Zabbix repository for Ubuntu 22.04; zabbix.com/download shows the exact commands for your Zabbix version.
systemctl status zabbix-proxyCheck the status and logs
Use these commands to see whether the proxy is running and to follow its log live:
systemctl status zabbix-proxy
journalctl -u zabbix-proxy -f
tail -f /var/log/zabbix/zabbix_proxy.logPoint the proxy at your Zabbix server
Open the configuration file and set two parameters:
- Server: the address or hostname of your central Zabbix server.
- Hostname: a unique name for this proxy. It must match exactly the proxy name you create in the Zabbix web interface (step 5).
The proxy reads its configuration only at start-up, so restart it after every change.
nano /etc/zabbix/zabbix_proxy.conf
# set these two lines
Server=zabbix.example.com
Hostname=my-proxy
systemctl restart zabbix-proxyUse MySQL or PostgreSQL instead of SQLite (optional)
SQLite is fine for most proxies. For a large proxy you can use MySQL or PostgreSQL instead: create the database and import the proxy schema as described in the Zabbix documentation, then set these parameters in the configuration file:
Restart the proxy afterwards.
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=YOUR_PASSWORD
DBHost=localhostAdd the proxy in the Zabbix web interface
On your central Zabbix server:
- Go to Administration > Proxies and click Create proxy.
- Proxy name: enter exactly the Hostname from zabbix_proxy.conf.
- Proxy mode: choose Active if the proxy connects to the server (the default), or Passive if the server should poll the proxy.
- Save, then open each remote host and set Monitored by to this proxy.
In Active mode the proxy needs to reach the Zabbix server on its port (10051 by default). In Passive mode the server must reach the proxy on its ListenPort.
Tune the proxy
These parameters in zabbix_proxy.conf control how the proxy works. The values below are examples:
- ListenPort: the port the proxy listens on in Passive mode.
- StartPollers, StartIPMIPollers, StartSNMPTrapper: how many collection processes of each kind to start.
- Timeout: how long a single check may take, in seconds (3 by default).
Restart the proxy after changing them. The Zabbix documentation lists every parameter.
ListenPort=10051
StartPollers=5
StartIPMIPollers=0
StartSNMPTrapper=0
Timeout=3
systemctl restart zabbix-proxyGet a server for this guide
Zabbix Proxy VPS plans run everything in this guide, from $7.50/mo billed yearly.
See Zabbix Proxy VPS plansExplore More VPS Hosting Options
Find the right server for your project.
Start Your NodexVPS Today
Save 50% with yearly billing. No contract, cancel any time.