Install Zabbix Agent on Windows Server

Download Zabbix Agent:

1
2
3
cd c:\
Invoke-WebRequest -Uri " https://cdn.zabbix.com/zabbix/binaries/stable/5.2/5.2.6/zabbix_agent-5.2.6-windows-amd64.zip" -OutFile "zabbix_agent-5.2.6-windows-amd64.zip"
Expand-Archive "c:\zabbix_agent-5.2.6-windows-amd64.zip" -DestinationPath "c:\zabbix"

Set Configuration Parameters:

1
2
3
4
5
del "c:\zabbix\conf\zabbix_agentd.win.conf"
"Server=<$ZABBIX_SERVER>" | Out-File -FilePath "c:\zabbix\conf\zabbix_agentd.conf" -Encoding ASCII
"ServerActive=<$ZABBIX_SERVER>" | Out-File -FilePath "c:\zabbix\conf\zabbix_agentd.conf" -Encoding ASCII -Append
"Hostname=<$ZABBIX_AGENT>" | Out-File -FilePath "c:\zabbix\conf\zabbix_agentd.conf" -Encoding ASCII -Append
"LogFile=c:\zabbix\zabbix_agentd.log" | Out-File -FilePath "c:\zabbix\conf\zabbix_agentd.conf" -Encoding ASCII -Append

Install Service & Start Zabbix Agent:

1
2
c:\zabbix\bin\zabbix_agentd.exe --config "c:\zabbix\conf\zabbix_agentd.conf" --install
c:\zabbix\bin\zabbix_agentd.exe --start

Open Zabbix Ports in Firewall:

1
2
3
4
netsh advfirewall firewall add rule name="Open Zabbix agentd port 10050 inbound" dir=in action=allow protocol=TCP localport=10050
netsh advfirewall firewall add rule name="Open Zabbix agentd port 10050 outbound" dir=out action=allow protocol=TCP localport=10050
netsh advfirewall firewall add rule name="Open Zabbix trapper port 10051 inbound" dir=in action=allow protocol=TCP localport=10051
netsh advfirewall firewall add rule name="Open Zabbix trapper port 10051 outbound" dir=out action=allow protocol=TCP localport=10051