Introduction to Zabbix Agent on Windows Server 2019

Zabbix is a mature, open-source enterprise monitoring platform that supports agentless and agent-based monitoring for servers, network devices, applications, and cloud services. Installing the Zabbix Agent on Windows Server 2019 enables the Zabbix Server to collect system performance metrics, monitor services, execute remote commands, and trigger alerts based on configurable thresholds. The agent runs as a Windows service and communicates with the Zabbix Server (or Zabbix Proxy) over TCP. Zabbix provides a large library of pre-built templates for Windows Server that cover CPU, memory, disk, network, and Windows services out of the box, making it quick to achieve comprehensive monitoring coverage. This guide covers downloading, installing, and configuring the Zabbix Agent on Windows Server 2019, plus connecting it to a Zabbix Server.

Choosing Between Zabbix Agent and Zabbix Agent 2

Zabbix offers two agent versions: the classic Zabbix Agent (zabbix_agentd) written in C, and Zabbix Agent 2 (zabbix_agent2) written in Go. Zabbix Agent 2 is the recommended choice for new deployments on Windows Server 2019 because it supports a plugin architecture for extended monitoring capabilities (including native Windows Event Log monitoring, ODBC databases, and Docker), uses fewer system resources than running multiple agent instances, and supports active checks more efficiently. Both agents are compatible with Zabbix Server 6.x and later.

Downloading the Zabbix Agent

Download the Zabbix Agent 2 for Windows from the official Zabbix download page at zabbix.com/download_agents. Select the appropriate version matching your Zabbix Server version (for example, Zabbix 6.4), select Windows as the OS, and download the MSI installer for 64-bit. The MSI is the easiest installation method for Windows Server 2019 as it handles service registration automatically.

Alternatively, download and install via PowerShell:

$url = "https://cdn.zabbix.com/zabbix/binaries/stable/6.4/6.4.9/zabbix_agent2-6.4.9-windows-amd64-openssl.msi"
$output = "C:Tempzabbix_agent2.msi"
Invoke-WebRequest -Uri $url -OutFile $output

Installing Zabbix Agent 2 via MSI

Run the MSI installer with parameters to configure it during installation. Replace 192.168.1.100 with the IP address of your Zabbix Server, and set the Hostname to match the host name you will configure in the Zabbix Server frontend:

msiexec /i C:Tempzabbix_agent2.msi /quiet SERVER=192.168.1.100 SERVERACTIVE=192.168.1.100 HOSTNAME=WS2019-PROD-01 ENABLEPATH=1

The ENABLEPATH=1 parameter adds the Zabbix Agent 2 binary directory to the system PATH, making the zabbix_agent2 executable available from any command prompt. The installer creates the service, adds the configuration file at C:Program FilesZabbix Agent 2zabbix_agent2.conf, and starts the agent automatically.

Verify the agent is running:

Get-Service -Name "Zabbix Agent 2"

Configuring the Zabbix Agent Configuration File

The main configuration file is located at C:Program FilesZabbix Agent 2zabbix_agent2.conf. Open it with a text editor (run as Administrator) and review the key settings:

# Zabbix server IP or hostname - passive checks
Server=192.168.1.100

# Zabbix server for active checks
ServerActive=192.168.1.100

# This host's display name in Zabbix frontend
Hostname=WS2019-PROD-01

# Unique host metadata for auto-registration rules
HostMetadata=windows

# Log file location
LogFile=C:Program FilesZabbix Agent 2zabbix_agent2.log
LogFileSize=10

# Agent listens on this port (passive mode)
ListenPort=10050

# Timeout for agent checks in seconds
Timeout=10

# Allow execution of user parameters
AllowKey=system.run[*]

# Include additional configuration files
Include=C:Program FilesZabbix Agent 2zabbix_agent2.d*.conf

After editing the configuration file, restart the agent service for changes to take effect:

Restart-Service "Zabbix Agent 2"

Configuring Windows Firewall

The Zabbix Agent listens on TCP port 10050 (passive checks) and connects outbound to the Zabbix Server on TCP port 10051 (active checks). Create a firewall rule to allow inbound connections from the Zabbix Server for passive checks:

New-NetFirewallRule -DisplayName "Zabbix Agent Passive" -Direction Inbound -Protocol TCP -LocalPort 10050 -RemoteAddress 192.168.1.100 -Action Allow -Profile Any

Active checks (initiated by the agent) require outbound access to the Zabbix Server on port 10051. If your Windows Firewall is configured to block outbound traffic by default, add an outbound rule:

New-NetFirewallRule -DisplayName "Zabbix Agent Active" -Direction Outbound -Protocol TCP -RemotePort 10051 -RemoteAddress 192.168.1.100 -Action Allow -Profile Any

Adding the Host in the Zabbix Server Frontend

Log into the Zabbix Server web frontend. Navigate to Configuration > Hosts > Create Host. Fill in the following:

Host name: must match the Hostname setting in zabbix_agent2.conf exactly (e.g., WS2019-PROD-01). Visible name: a human-friendly name (e.g., Production Web Server 01). Groups: assign to a relevant host group such as Windows Servers. In the Interfaces section, click Add and select Agent. Enter the server’s IP address and confirm port 10050. Under Templates, click the Templates field and search for Windows by Zabbix agent — this is the standard Zabbix template for Windows monitoring that includes CPU, memory, filesystem, network, and service items. Click Add and then Update.

Zabbix will immediately begin collecting data from the agent. Within a few minutes, data should appear in Monitoring > Hosts > Latest Data for the new host.

Testing Agent Connectivity

From the Zabbix Server, test the agent connection and retrieve a metric value using the zabbix_get utility:

zabbix_get -s 192.168.1.10 -p 10050 -k "system.cpu.util[,user]"

This should return the current user-mode CPU utilization percentage. Other useful test keys:

zabbix_get -s 192.168.1.10 -p 10050 -k "vm.memory.util[pavailable]"
zabbix_get -s 192.168.1.10 -p 10050 -k "vfs.fs.size[C:,pfree]"
zabbix_get -s 192.168.1.10 -p 10050 -k "system.uptime"

Creating Custom User Parameters

User parameters extend the Zabbix Agent with custom metric collection scripts. For example, to monitor a specific application log for error counts, create a custom parameter in an include configuration file:

UserParameter=custom.app.errors,powershell -NoProfile -Command "(Get-Content 'C:Applogsapp.log' | Select-String 'ERROR').Count"

Create this in C:Program FilesZabbix Agent 2zabbix_agent2.dcustom.conf and restart the agent. In the Zabbix frontend, create a new Item on the host with Key=custom.app.errors and Type=Zabbix agent. The server will query the agent for this custom metric on each check interval.

Configuring Zabbix Auto-Registration for Automatic Onboarding

In large environments with many Windows servers, auto-registration allows new agents to automatically register themselves with the Zabbix Server without manual host creation. In the agent configuration, set HostMetadata to a value like windows-server-2019:

HostMetadata=windows-server-2019

In the Zabbix frontend, navigate to Configuration > Actions > Autoregistration Actions. Create an action that triggers when HostMetadata contains windows-server-2019. In the Operations, add operations to add the host to a Windows Servers group and link the Windows by Zabbix agent template automatically. New servers with this metadata value in their agent config will self-register and be immediately monitored without manual intervention.