Following previous tutorials concerning Zabbix series, this article describes how to install and setup an instance of Zabbix agent to run as a service on Microsoft Windows systems in order to monitor your infrastructure windows environments, especially server machines.
Step 1: Download and Install Zabbix Agent on Windows
1. The pre-compiled zip agents for Windows environments can be obtained from official Zabbix download page and manually installed and started on the system using windows Command Prompt as in the following example:
C:\Users\caezsar><full system path to zabbix_agentd.exe> --config <full system path to zabbix_agentd.win.conf> --install
Example, suppose you’ve downloaded and extracted the Zabbix agent zip archive to D:\Downloads\zabbix_agents_2.4.4.win\, run the following command to install the service:
C:\Users\caezsar>D:\Downloads\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --config D:\Downloads\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf --install
2. After the service has been installed on your windows host, open zabbix_agentd.win.conf file and manually edit the following parameters:
Server=IP of Zabbix Server ServerActive=IP of Zabbix Server Hostname=use the FQDN of your windows host
3. To start the service just type:
To stop the service run the same command as above with
--stop argument and to uninstall the service use the
C:\Users\caezsar>D:\Downloads\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --stop C:\Users\caezsar>D:\Downloads\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --uninstall
4. A second and more convenient method to install and automatically configure Zabbix agent on Windows environments is by downloading Zabbix Agent installer msi package specific for your system architecture by visiting the link: http://www.suiviperf.com/zabbix/index.php.
5. Once the Zabbix agent msi file has been downloaded on your system, run it and supply the required information in order to configure and install the agent on the target monitored host as it follows:
Hostname: use the FQDN of your windows host (the hostname value should match the “Full Computer name” configured for your machine) Zabbix server Name: use the IP of the Zabbix Server Agent Port: 10050 Remote Command: check this value Active Server: IP of Zabbix Server
If you need to modify Zabbix configuration file with other custom values at a later date, the conf file can be found on %programfiles%\Zabbix Agent\ path.
6. After you’ve finished the setup, open a windows Command Prompt with Administrator privileges, run services.msc command in order to open Windows Services utility and locate Zabbix Agent service to check if the service is running and automatically started after reboot.
From this console you can manage the service (start, stop, pause, resume, enable or disable).
Step 2: Configure Windows Firewall and Test Zabbix Agent
7. Almost all Windows based systems have Windows Firewall active and running, therefore zabbix agent port must be opened in firewall in order to communicate with zabbix server.
In order to open Zabbix agent port in windows firewall, open Control Panel -> System and Security – > Windows Firewall and hit on Allow an app through Windows Firewall.
8. Next, click on Allow another app button and a new window should open. Use the Browse button to navigate and add Zabbix agent executable file (usually found in %programfiles%\Zabbix Agent\ if you installed it using msi program), then hit on Add button to add the service.
9. Next, make sure you check and open the firewall rule on the network segment where zabbix server is located in your network and hit OK button to finish and apply configuration.
10. In order to test if Zabbix agent running on windows is reachable from Zabbix server side, use telnet or netcat command on zabbix server against windows agent IP-Port and a Connected message should appear. Hit Enter key to generate an error message and automatically disconnect from agent:
telnet <Windows_agent IP Address> 10050
Step 3: Add Zabbix Agent Monitored Windows Host to Zabbix Server
11. Once the windows agent has been tested from command line and everything looks fine, go to Zabbix Server web interface, move to Configuration tab -> Hosts and hit on Create Host button in order to add the Windows monitored host.
12. On Host window add the FQDN of your windows agent machine in Host name filed, add an arbitrary name to Visible name filed in order to easily identify the monitored machine on Zabbix panel, make sure the host is included into a Group Servers and add the IP Address of your windows host in Agent interfaces filed. The Port value leave it unchanged.
13. Next, go to Template tab and hit on Select button. A new window with Zabbix Templates should appear. Navigate through this window, check Template OS Windows and hit on Select button to add the template.
14. Once the Template OS Windows appears on Link new templates filed, hit on Add button in order to link this template to the windows host configuration.
Finally, after the Template OS Windows is visible in Linked Templates filed hit on below Add button to complete the process and add the entire Windows host configuration.
15. After your monitored windows machine has been added return to Configuration -> Hosts and the windows Host should now be present in this window as illustrated on below screenshot.
That’s all! Just assure that your windows host Status is set to Enabled and wait a few minutes in order for Zabbix server to contact the windows agent side and process the received remote data.
As an example, to get a graphical inside of the CPU load on the monitored Windows machine go to Zabbix web console Monitoring tab -> Graphs, select the windows machine host name and CPU load Graph and all the collected data so far should be presented into a nice graphical chart.