Both generations of Zabbix agents run as a Windows service. For Zabbix agent 2, replace agentd with agent2 in the instructions below.
You can run a single instance of Zabbix agent or multiple instances of the agent on a Microsoft Windows host. A single instance may use either:
In case of multiple instances each agent instance must have its own configuration file (one of the instances can use the default configuration file).
An example configuration file is available in the Zabbix source archive as:
conf/zabbix_agentd.conf
for Zabbix agent;conf/zabbix_agent2.conf
for Zabbix agent2.If you want to install Zabbix agent/agent 2 for Windows as a service from an archive without specifying the configuration file explicitly, then, before installing the agent:
conf/zabbix_agentd.conf
should be copied manually to the directory where zabbix_agentd.exe will be installed;conf/zabbix_agent2.conf
and the conf/zabbix_agent2.d
directory should be copied manually to the directory where zabbix_agent2.exe will be installed.See the configuration file options for details on configuring Zabbix Windows agent.
To perform active checks on a host Zabbix agent needs to have the hostname defined. Moreover, the hostname value set on the agent side should exactly match the "Host name" configured for the host in the frontend.
The hostname value on the agent side can be defined by either the Hostname or HostnameItem parameter in the agent configuration file - or the default values are used if any of these parameters are not specified.
The default value for HostnameItem parameter is the value returned by the "system.hostname" agent key. For Windows, it returns result of the gethostname() function, which queries namespace providers to determine the local host name. If no namespace provider responds, the NetBIOS name is returned.
The default value for Hostname is the value returned by the HostnameItem parameter. So, in effect, if both these parameters are unspecified, the actual hostname will be the host NetBIOS name; Zabbix agent will use NetBIOS host name to retrieve the list of active checks from Zabbix server and send results to it.
The "system.hostname" key supports two optional parameters - type and transform.
Type determines the type of the name the item should return:
Transform allows to specify additional transformation rule for the hostname:
So, to simplify the configuration of zabbix_agentd.conf file and make it unified, three different approaches can be used:
Host name is also used as part of Windows service name which is used for installing, starting, stopping and uninstalling the Windows service. For example, if Zabbix agent configuration file specifies Hostname=Windows_db_server
, then the agent will be installed as a Windows service "Zabbix Agent [Windows_db_server]
". Therefore, to have a different Windows service name for each Zabbix agent instance, each instance must use a different host name.
Before installing the agent, copy conf/zabbix_agentd.conf
manually to the directory where zabbix_agentd.exe will be installed.
To install a single instance of Zabbix agent with the default configuration file:
On a 64-bit system, a 64-bit Zabbix agent version is required for all checks related to running 64-bit processes to work correctly.
If you wish to use a configuration file other than the default one, you should use the following command for service installation:
A full path to the configuration file should be specified.
Multiple instances of Zabbix agent can be installed as services like this:
zabbix_agentd.exe --config <configuration_file_for_instance_1> --install --multiple-agents
zabbix_agentd.exe --config <configuration_file_for_instance_2> --install --multiple-agents
...
zabbix_agentd.exe --config <configuration_file_for_instance_N> --install --multiple-agents
The installed service should now be visible in Control Panel.
To start the agent service, you can use Control Panel or do it from command line.
To start a single instance of Zabbix agent with the default configuration file:
To start a single instance of Zabbix agent with another configuration file:
To start one of multiple instances of Zabbix agent:
To stop the agent service, you can use Control Panel or do it from command line.
To stop a single instance of Zabbix agent started with the default configuration file:
To stop a single instance of Zabbix agent started with another configuration file:
To stop one of multiple instances of Zabbix agent:
To uninstall a single instance of Zabbix agent using the default configuration file:
To uninstall a single instance of Zabbix agent using a non-default configuration file:
To uninstall multiple instances of Zabbix agent from Windows services:
zabbix_agentd.exe --config <configuration_file_for_instance_1> --uninstall --multiple-agents
zabbix_agentd.exe --config <configuration_file_for_instance_2> --uninstall --multiple-agents
...
zabbix_agentd.exe --config <configuration_file_for_instance_N> --uninstall --multiple-agents
Zabbix agent for Windows does not support non-standard Windows configurations where CPUs are distributed non-uniformly across NUMA nodes. If logical CPUs are distributed non-uniformly, then CPU performance metrics may not be available for some CPUs. For example, if there are 72 logical CPUs with 2 NUMA nodes, both nodes must have 36 CPUs each.