# 5 Zabbix agent (Windows)

#### Overview

This section lists parameters supported in a Zabbix agent (Windows)
configuration file (zabbix\_agent.conf). Note that:

-   The default values reflect daemon defaults, not the values in the
    shipped configuration files;
-   Zabbix supports configuration files only in UTF-8 encoding without
    [BOM](https://en.wikipedia.org/wiki/Byte_order_mark);
-   Comments starting with "\#" are only supported in the beginning of
    the line.

#### Parameters

|Parameter|Mandatory|Range|Default|Description|
|---------|---------|-----|-------|-----------|
|Alias|no|<|<|Sets an alias for an item key. It can be used to substitute long and complex item key with a smaller and simpler one.<br>Multiple *Alias* parameters may be present. Multiple parameters with the same *Alias* key are allowed.<br>Different *Alias* keys may reference the same item key.<br>Aliases can be used in *HostMetadataItem* but not in *HostnameItem* or *PerfCounter* parameters.<br><br>Examples:<br><br>1. Retrieving paging file usage in percents from the server.<br>Alias=pg\_usage:perf\_counter\[\\Paging File(\_Total)\\% Usage\]<br>Now shorthand key **pg\_usage** may be used to retrieve data.<br><br>2. Getting CPU load with default and custom parameters.<br>Alias=cpu.load:system.cpu.load<br>Alias=cpu.load\[\*\]:system.cpu.load\[\*\]<br>This allows use **cpu.load** key to get CPU utilization percentage with default parameters as well as use **cpu.load\[percpu,avg15\]** to get specific data about CPU load.<br><br>3. Running multiple [low-level discovery](/manual/discovery/low_level_discovery) rules processing the same discovery items.<br>Alias=vfs.fs.discovery\[\*\]:vfs.fs.discovery<br>Now it is possible to set up several discovery rules using **vfs.fs.discovery** with different parameters for each rule, e.g., **vfs.fs.discovery\[foo\]**, **vfs.fs.discovery\[bar\]**, etc.|
|AllowKey|no|<|<|Allow execution of those item keys that match a pattern. Key pattern is a wildcard expression that supports "\*" character to match any number of any characters.<br>Multiple key matching rules may be defined in combination with DenyKey. The parameters are processed one by one according to their appearance order.<br>This parameter is supported since Zabbix 5.0.0.<br>See also: [Restricting agent checks](/manual/config/items/restrict_checks).|
|BufferSend|no|1-3600|5|Do not keep data longer than N seconds in buffer.|
|BufferSize|no|2-65535|100|Maximum number of values in a memory buffer. The agent will send<br>all collected data to Zabbix server or proxy if the buffer is full.|
|DebugLevel|no|0-5|3|Specifies debug level:<br>0 - basic information about starting and stopping of Zabbix processes<br>1 - critical information<br>2 - error information<br>3 - warnings<br>4 - for debugging (produces lots of information)<br>5 - extended debugging (produces even more information)|
|DenyKey|no|<|<|Deny execution of those item keys that match a pattern. Key pattern is a wildcard expression that supports "\*" character to match any number of any characters.<br>Multiple key matching rules may be defined in combination with AllowKey. The parameters are processed one by one according to their appearance order.<br>This parameter is supported since Zabbix 5.0.0.<br>See also: [Restricting agent checks](/manual/config/items/restrict_checks).|
|EnableRemoteCommands|no|<|0|Whether remote commands from Zabbix server are allowed. This parameter is **deprecated**, use AllowKey=system.run\[\*\] or DenyKey=system.run\[\*\] instead<br>It is internal alias for AllowKey/DenyKey parameters depending on value: 0 - DenyKey=system.run\[\*\]<br>1 - AllowKey=system.run\[\*\].|
|HostInterface|no|0-255 characters|<|Optional parameter that defines host interface.<br>Host interface is used at host autoregistration process.<br>An agent will issue an error and not start if the value is over the limit of 255 characters.<br>If not defined, value will be acquired from HostInterfaceItem.<br>Supported since Zabbix 4.4.0.|
|HostInterfaceItem|no|<|<|Optional parameter that defines an item used for getting host interface.<br>Host interface is used at host autoregistration process.<br>During an autoregistration request an agent will log a warning message if the value returned by specified item is over limit of 255 characters.<br>This option is only used when HostInterface is not defined.<br>Supported since Zabbix 4.4.0.|
|HostMetadata|no|0-255 characters|<|Optional parameter that defines host metadata. Host metadata is used only at host autoregistration process (active agent).<br>If not defined, the value will be acquired from HostMetadataItem.<br>An agent will issue an error and not start if the specified value is over the limit or a non-UTF-8 string.<br>This option is supported in version 2.2.0 and higher.|
|HostMetadataItem|no|<|<|Optional parameter that defines a *Zabbix agent* item used for getting host metadata. This option is only used when HostMetadata is not defined.<br>Supports UserParameters, performance counters and aliases. Supports *system.run\[\]* regardless of *EnableRemoteCommands* value.<br>HostMetadataItem value is retrieved on each autoregistration attempt and is used only at host autoregistration process (active agent).<br>During an autoregistration request an agent will log a warning message if the value returned by the specified item is over the limit of 255 characters.<br>The value returned by the item must be a UTF-8 string otherwise it will be ignored.<br>This option is supported in version 2.2.0 and higher.|
|Hostname|no|<|Set by HostnameItem|List of comma-delimited unique, case-sensitive hostnames.<br>Required for active checks and must match hostnames as configured on the server. Value is acquired from HostnameItem if undefined.<br>Allowed characters: alphanumeric, '.', ' ', '\_' and '-'.<br>Maximum length: 128 characters per hostname, 2048 characters for the entire line.|
|HostnameItem|no|<|system.hostname|Optional parameter that defines a *Zabbix agent* item used for getting host name. This option is only used when Hostname is not defined.<br>Does not support UserParameters, performance counters or aliases, but does support *system.run\[\]* regardless of *EnableRemoteCommands* value.<br>The output length is limited to 512KB.<br>See also a [more detailed description](/manual/appendix/install/windows_agent#configuration).|
|Include|no|<|<|You may include individual files or all files in a directory in the configuration file.<br>To only include relevant files in the specified directory, the asterisk wildcard character is supported for pattern matching. For example: `/absolute/path/to/config/files/*.conf`. Pattern matching is supported since Zabbix 2.4.0.<br>See [special notes](special_notes_include) about limitations.|
|ListenIP|no|<|0.0.0.0|List of comma-delimited IP addresses that the agent should listen on.<br>Multiple IP addresses are supported since Zabbix 1.8.3.|
|ListenPort|no|1024-32767|10050|Agent will listen on this port for connections from the server.|
|LogFile|yes, if LogType is set to *file*, otherwise<br>no|<|C:\\zabbix\_agentd.log|Name of the agent log file.|
|LogFileSize|no|0-1024|1|Maximum size of log file in MB.<br>0 - disable automatic log rotation.<br>*Note*: If the log file size limit is reached and file rotation fails, for whatever reason, the existing log file is truncated and started anew.|
|LogType|no|<|file|Log output type:<br>*file* - write log to file specified by LogFile parameter,<br>*system* - write log Windows Event Log,<br>*console* - write log to standard output.<br>This parameter is supported since Zabbix 3.0.0.|
|LogRemoteCommands|no|<|0|Enable logging of executed shell commands as warnings.<br>0 - disabled<br>1 - enabled|
|MaxLinesPerSecond|no|1-1000|20|Maximum number of new lines the agent will send per second to Zabbix server<br>or proxy processing 'log', 'logrt' and 'eventlog' active checks.<br>The provided value will be overridden by the parameter 'maxlines',<br>provided in 'log', 'logrt' or 'eventlog' item keys.<br>*Note*: Zabbix will process 10 times more new lines than set in *MaxLinesPerSecond* to seek the required string in log items.|
|PerfCounter|no|<|<|Defines a new parameter <parameter\_name> which is an average value for system performance counter <perf\_counter\_path> for the specified time period <period> (in seconds).<br>Syntax: <parameter\_name>,"<perf\_counter\_path>",<period><br>For example, if you wish to receive average number of processor interrupts per second for last minute, you can define a new parameter "interrupts" as the following:<br>PerfCounter = interrupts,"\\Processor(0)\\Interrupts/sec",60<br>Please note double quotes around performance counter path.<br>The parameter name (interrupts) is to be used as the item key when creating an item.<br>Samples for calculating average value will be taken every second.<br>You may run "typeperf -qx" to get list of all performance counters available in Windows.|
|PerfCounterEn|no|<|<|Defines a new parameter <parameter\_name> which is an average value for system performance counter <perf\_counter\_path> for the specified time period <period> (in seconds).<br>Syntax: <parameter\_name>,"<perf\_counter\_path>",<period><br>Compared to PerfCounter, perfcounter paths must be in English.<br>Supported only on **Windows Server 2008/Vista** and above.<br>For example, if you wish to receive average number of processor interrupts per second for last minute, you can define a new parameter "interrupts" as the following:<br>PerfCounterEn = interrupts,"\\Processor(0)\\Interrupts/sec",60<br>Please note double quotes around performance counter path.<br>The parameter name (interrupts) is to be used as the item key when creating an item.<br>Samples for calculating average value will be taken every second.<br>You can find the list of English strings by viewing the following registry key: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009`.<br>This parameter is supported since Zabbix 4.0.13 and 4.2.7.|
|RefreshActiveChecks|no|60-3600|120|How often list of active checks is refreshed, in seconds.<br>Note that after failing to refresh active checks the next refresh will be attempted after 60 seconds.|
|Server|yes, if StartAgents is not explicitly set to 0|<|<|List of comma delimited IP addresses, optionally in CIDR notation, or hostnames of Zabbix servers.<br>Incoming connections will be accepted only from the hosts listed here.<br>If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally and '::/0' will allow any IPv4 or IPv6 address.<br>'0.0.0.0/0' can be used to allow any IPv4 address.<br>Note, that "IPv4-compatible IPv6 addresses" (0000::/96 prefix) are supported but deprecated by [RFC4291](https://tools.ietf.org/html/rfc4291#section-2.5.5).<br>Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.domain<br>Spaces are allowed.|
|ServerActive|no|(\*)|<|IP:port (or hostname:port) of Zabbix server or Zabbix proxy for active checks.<br>Multiple comma-delimited addresses can be provided to use several independent Zabbix servers in parallel. Spaces are allowed.<br>If port is not specified, default port is used.<br>IPv6 addresses must be enclosed in square brackets if port for that host is specified.<br>If port is not specified, square brackets for IPv6 addresses are optional.<br>If this parameter is not specified, active checks are disabled.|
|SourceIP|no|<|<|Source IP address for:<br>- outgoing connections to Zabbix server or Zabbix proxy;<br>- making connections while executing some items (web.page.get, net.tcp.port, etc.)|
|StartAgents|no|0-63 (\*)|3|Number of pre-forked instances of zabbix\_agentd that process passive checks.<br>If set to 0, disables passive checks and the agent will not listen on any TCP port.<br>The upper limit used to be 16 before version 1.8.5.|
|Timeout|no|1-30|3|Spend no more than Timeout seconds on processing|
|TLSAccept|yes, if TLS certificate or PSK parameters are defined (even for *unencrypted* connection), otherwise no|<|<|What incoming connections to accept. Used for a passive checks. Multiple values can be specified, separated by comma:<br>*unencrypted* - accept connections without encryption (default)<br>*psk* - accept connections with TLS and a pre-shared key (PSK)<br>*cert* - accept connections with TLS and a certificate<br>This parameter is supported since Zabbix 3.0.0.|
|TLSCAFile|no|<|<|Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification, used for encrypted communications between Zabbix components.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSCertFile|no|<|<|Full pathname of a file containing the agent certificate or certificate chain, used for encrypted communications with Zabbix components.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSConnect|yes, if TLS certificate or PSK parameters are defined (even for *unencrypted* connection), otherwise no|<|<|How the agent should connect to Zabbix server or proxy. Used for active checks. Only one value can be specified:<br>*unencrypted* - connect without encryption (default)<br>*psk* - connect using TLS and a pre-shared key (PSK)<br>*cert* - connect using TLS and a certificate<br>This parameter is supported since Zabbix 3.0.0.|
|TLSCRLFile|no|<|<|Full pathname of a file containing revoked certificates. This parameter is used for encrypted communications with Zabbix components.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSKeyFile|no|<|<|Full pathname of a file containing the agent private key used for encrypted communications with Zabbix components.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSPSKFile|no|<|<|Full pathname of a file containing the agent pre-shared key used for encrypted communications with Zabbix components.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSPSKIdentity|no|<|<|Pre-shared key identity string, used for encrypted communications with Zabbix server.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSServerCertIssuer|no|<|<|Allowed server (proxy) certificate issuer.<br>This parameter is supported since Zabbix 3.0.0.|
|TLSServerCertSubject|no|<|<|Allowed server (proxy) certificate subject.<br>This parameter is supported since Zabbix 3.0.0.|
|UnsafeUserParameters|no|0-1|0|Allow all characters to be passed in arguments to user-defined parameters.<br>0 - do not allow<br>1 - allow<br>The following characters are not allowed:<br>\\ ' " \` \* ? \[ \] { } \~ $ ! & ; ( ) < > \| \# @<br>Additionally, newline characters are not allowed.|
|UserParameter|no|<|<|User-defined parameter to monitor. There can be several user-defined parameters.<br>Format: UserParameter=<key>,<shell command><br>Note that shell command must not return empty string or EOL only.<br>Shell commands may have relative paths, if UserParameterDir parameter is specified.<br>Examples:<br>UserParameter=system.test,who\|wc -l<br>UserParameter=check\_cpu,./custom\_script.sh|
|UserParameterDir|no|<|<|Default search path for UserParameter commands. If used, the agent will change its working directory to the one specified here before executing a command. Thereby, UserParameter commands can have a relative `./` prefix instead of a full path.<br>Only one entry is allowed.<br>Example: UserParameterDir=/opt/myscripts|

::: noteclassic
 (\*) The number of active servers listed in ServerActive
plus the number of pre-forked instances for passive checks specified in
StartAgents must be less than 64.
:::

### See also

1.  [Differences in the Zabbix agent configuration for active and
    passive checks starting from version
    2.0.0](http://blog.zabbix.com/multiple-servers-for-active-agent-sure/858).
