Zabbix agent windows commands

Zabbix Documentation 5.2

Table of Contents

5 Windows agent installation from MSI

Overview

Zabbix Windows agent can be installed from Windows MSI installer packages (32-bit or 64-bit) available for download:

32-bit package cannot be installed on a 64-bit Windows.

All packages come with TLS support, however, configuring TLS is optional.

Both UI and command-line based installation is supported.

Installation steps

To install, double-click the downloaded MSI file.

Accept the license to proceed to the next step.

Specify the following parameters.

Parameter Description
Host name Specify host name.
Zabbix server IP/DNS Specify IP/DNS of Zabbix server.
Agent listen port Specify agent listen port (10050 by default).
Server or Proxy for active checks Specify IP/DNS of Zabbix server/proxy for active agent checks.
Remote commands Mark the checkbox to enable remote commands.
Enable PSK Mark the checkbox to enable TLS support via pre-shared keys.
Add agent location to the PATH Add agent location to the PATH variable.

Enter pre-shared key identity and value. This step is only available if you checked Enable PSK in the previous step.

Zabbix components along with the configuration file will be installed in a Zabbix Agent folder in Program Files. zabbix_agentd.exe will be set up as Windows service with automatic startup.

Command-line based installation

Supported parameters

The following set of parameters is supported by created MSIs:

Zabbix Documentation 5.2

Table of Contents

5 Zabbix agent (Windows)

Overview

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

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.
Multiple Alias parameters may be present. Multiple parameters with the same Alias key are allowed.
Different Alias keys may reference the same item key.
Aliases can be used in HostMetadataItem but not in HostnameItem or PerfCounter parameters.

1. Retrieving paging file usage in percents from the server.
Alias=pg_usage:perf_counter[\Paging File(_Total)\% Usage]
Now shorthand key pg_usage may be used to retrieve data.

2. Getting CPU load with default and custom parameters.
Alias=cpu.load:system.cpu.load
Alias=cpu.load[*]:system.cpu.load[*]
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.

3. Running multiple low-level discovery rules processing the same discovery items.
Alias=vfs.fs.discovery[*]:vfs.fs.discovery
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.
Multiple key matching rules may be defined in combination with DenyKey. The parameters are processed one by one according to their appearance order.
This parameter is supported since Zabbix 5.0.0.
See also: Restricting agent 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
all collected data to Zabbix server or proxy if the buffer is full. DebugLevel no 0-5 3 Specifies debug level:
0 — basic information about starting and stopping of Zabbix processes
1 — critical information
2 — error information
3 — warnings
4 — for debugging (produces lots of information)
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.
Multiple key matching rules may be defined in combination with AllowKey. The parameters are processed one by one according to their appearance order.
This parameter is supported since Zabbix 5.0.0.
See also: Restricting agent 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
It is internal alias for AllowKey/DenyKey parameters depending on value: 0 — DenyKey=system.run[*]
1 — AllowKey=system.run[*]. HostInterface no 0-255 characters Optional parameter that defines host interface.
Host interface is used at host autoregistration process.
An agent will issue an error and not start if the value is over the limit of 255 characters.
If not defined, value will be acquired from HostInterfaceItem.
Supported since Zabbix 4.4.0. HostInterfaceItem no Optional parameter that defines an item used for getting host interface.
Host interface is used at host autoregistration process.
During an autoregistration request an agent will log a warning message if the value returned by specified item is over limit of 255 characters.
This option is only used when HostInterface is not defined.
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).
If not defined, the value will be acquired from HostMetadataItem.
An agent will issue an error and not start if the specified value is over the limit or a non-UTF-8 string.
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.
Supports UserParameters, performance counters and aliases. Supports system.run[] regardless of EnableRemoteCommands value.
HostMetadataItem value is retrieved on each autoregistration attempt and is used only at host autoregistration process (active agent).
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.
The value returned by the item must be a UTF-8 string otherwise it will be ignored.
This option is supported in version 2.2.0 and higher. Hostname no Set by HostnameItem List of comma-delimited unique, case-sensitive hostnames.
Required for active checks and must match hostnames as configured on the server. Value is acquired from HostnameItem if undefined.
Allowed characters: alphanumeric, ‘.’, ‘ ‘, ‘_’ and ‘-‘.
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.
Does not support UserParameters, performance counters or aliases, but does support system.run[] regardless of EnableRemoteCommands value.
The output length is limited to 512KB.
See also a more detailed description. Include no You may include individual files or all files in a directory in the configuration file.
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.
See special notes about limitations. ListenIP no 0.0.0.0 List of comma-delimited IP addresses that the agent should listen on.
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
no C:\zabbix_agentd.log Name of the agent log file. LogFileSize no 0-1024 1 Maximum size of log file in MB .
0 — disable automatic log rotation.
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:
file — write log to file specified by LogFile parameter,
system — write log Windows Event Log,
console — write log to standard output.
This parameter is supported since Zabbix 3.0.0. LogRemoteCommands no 0 Enable logging of executed shell commands as warnings.
0 — disabled
1 — enabled MaxLinesPerSecond no 1-1000 20 Maximum number of new lines the agent will send per second to Zabbix server
or proxy processing ‘log’, ‘logrt’ and ‘eventlog’ active checks.
The provided value will be overridden by the parameter ‘maxlines’,
provided in ‘log’, ‘logrt’ or ‘eventlog’ item keys.
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

which is an average value for system performance counter

for the specified time period

(in seconds).
Syntax:

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:
PerfCounter = interrupts,“\Processor(0)\Interrupts/sec”,60
Please note double quotes around performance counter path.
The parameter name (interrupts) is to be used as the item key when creating an item.
Samples for calculating average value will be taken every second.
You may run “typeperf -qx” to get list of all performance counters available in Windows. PerfCounterEn no Defines a new parameter

which is an average value for system performance counter

Zabbix Documentation 5.2

Table of Contents

10 Zabbix agent 2 on Microsoft Windows

Configuring agent

Zabbix agent 2 runs as a Windows service.

You can run a single instance of Zabbix agent 2 or multiple instances of the agent on a Microsoft Windows host. A single instance can use the default configuration file C:\zabbix_agent2.conf or a configuration file specified in the command line. 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 Zabbix source archive as conf/zabbix_agent2.win.conf .

See the configuration file options for details on configuring Zabbix Windows agent 2.

Hostname parameter

To perform active checks on a host Zabbix agent 2 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 and for Windows platform it returns the NetBIOS host name.

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 2 will use NetBIOS host name to retrieve the list of active checks from Zabbix server and send results to it.

So, to simplify the configuration of zabbix_agent2.conf file and make it unified, two different approaches could 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 2 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.

Installing agent as Windows service

To install a single instance of Zabbix agent 2 with the default configuration file c:\zabbix_agent2.conf :

If you wish to use a configuration file other than c:\zabbix_agent2.conf , you should use the following command for service installation:

A full path to the configuration file should be specified.

Multiple instances of Zabbix agent 2 can be installed as services like this:

The installed service should now be visible in Control Panel.

Starting agent

To start the agent service, you can use Control Panel or do it from command line.

To start a single instance of Zabbix agent 2 with the default configuration file:

To start a single instance of Zabbix agent 2 with another configuration file:

To start one of multiple instances of Zabbix agent 2:

Stopping 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 2 started with the default configuration file:

To stop a single instance of Zabbix agent 2 started with another configuration file:

To stop one of multiple instances of Zabbix agent 2:

Uninstalling agent Windows service

To uninstall a single instance of Zabbix agent 2 using the default configuration file:

To uninstall a single instance of Zabbix agent 2 using a non-default configuration file:

To uninstall multiple instances of Zabbix agent 2 from Windows services:

Читайте также:  Windows powershell list windows updates
Оцените статью