Skip to content

Install Zabbix agent 2 to Linux server

1. Add the Zabbix Repository

Run these commands to download and install the official Zabbix repository configuration.

# Download the 20.04 (Focal) version of the Zabbix 7.0 repo
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu20.04_all.deb

# Download the Zabbix 7.0 release package for Ubuntu 22.04
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu22.04_all.deb

# Install the configuration package
sudo dpkg -i zabbix-release_latest+ubuntu22.04_all.deb

# Update the local package index
sudo apt update

2. Install Zabbix Agent 2

Install the agent along with its standard plugins. Agent 2 is more efficient than the classic version because it uses a single-process architecture and is built in Go.

sudo apt install zabbix-agent2 zabbix-agent2-plugin-*

3. Configure Connectivity

Edit the configuration file to link the agent to your Zabbix Server.

sudo nano /etc/zabbix/zabbix_agent2.conf

Find and modify these specific parameters: * Server: The IP or DNS name of your Zabbix Server (for passive checks).

Server=35.228.137.189 * ServerActive: The IP or DNS name of your Zabbix Server (for active checks). ServerActive=35.228.137.189 * Hostname: Give this server a unique name. Note: This name must match exactly what you enter in the Zabbix Web UI later.

4. Start and Enable the Service

Use systemctl to ensure the agent is running and will start automatically if the server reboots.

# Restart the service to apply config changes
sudo systemctl restart zabbix-agent2

# Enable the service to start on boot
sudo systemctl enable zabbix-agent2

# Verify the service is "active (running)"
sudo systemctl status zabbix-agent2