This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

4 Zabbix agent 2 (UNIX)

Overview

Zabbix agent 2 is a new generation of Zabbix agent and may be used in place of Zabbix agent.

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

  • The default values reflect process defaults, not the values in the shipped configuration files;
  • Zabbix supports configuration files only in UTF-8 encoding without BOM;
  • 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.
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 parameters.

Examples:

1. Retrieving the ID of user 'zabbix'.
Alias=zabbix.userid:vfs.file.regexp[/etc/passwd,"^zabbix:.:([0-9]+)",,,,\1]
Now shorthand key zabbix.userid may be used to retrieve data.

2. Getting CPU utilization with default and custom parameters.
Alias=cpu.util:system.cpu.util
Alias=cpu.util[*]:system.cpu.util[*]
This allows use cpu.util key to get CPU utilisation percentage with default parameters as well as use cpu.util[all, idle, avg15] to get specific data about CPU utilisation.

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.
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.
ControlSocket no /tmp/agent.sock The control socket, used to send runtime commands with '-R' option.
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)
EnableRemoteCommands no 0 Whether remote commands from Zabbix server are allowed.
0 - not allowed
1 - allowed

Note that this parameter has been replaced by the Plugins.SystemRun.EnableRemoteCommands parameter in 4.4.2.
HostMetadata no 0-255 characters Optional parameter that defines host metadata. Host metadata is used at host auto-registration process.
An agent will issue an error and not start if the specified value is over the limit or a non-UTF-8 string.
If not defined, the value will be acquired from HostMetadataItem.
HostMetadataItem no Optional parameter that defines an item used for getting host metadata. Host metadata item value is retrieved on each auto-registration attempt for host auto-registration process.
During an auto-registration request an agent will log a warning message if the value returned by the specified item is over the limit of 255 characters.
This option is only used when HostMetadata is not defined.
Supports UserParameters and aliases. Supports system.run[] regardless of EnableRemoteCommands value.
The value returned by the item must be a UTF-8 string otherwise it will be ignored.
Hostname no Set by HostnameItem Unique, case sensitive hostname.
Required for active checks and must match hostname as configured on the server.
Allowed characters: alphanumeric, '.', ' ', '_' and '-'.
Maximum length: 128
HostnameItem no system.hostname Item used for generating Hostname if it is not defined. Ignored if Hostname is defined.
Does not support UserParameters or aliases, but does support system.run[] regardless of EnableRemoteCommands value.
Include no You may include individual files or all files in a directory in the configuration file.
During installation Zabbix will create the include directory in /usr/local/etc, unless modified during the compile time.
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.
See special notes about limitations.
ListenIP no 0.0.0.0 List of comma-delimited IP addresses that the agent should listen on.
The first IP address is sent to Zabbix server, if connecting to it, to retrieve the list of active checks.
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
/tmp/zabbix_agentd.log Log file name if LogType is '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.
LogRemoteCommands no 0 Enable logging of executed shell commands as warnings.
0 - disabled
1 - enabled

Note that this parameter has been replaced by the Plugins.SystemRun.LogRemoteCommands parameter in 4.4.2.
LogType no file Specifies where log messages are written to:
system - syslog,
file - file specified by LogFile parameter,
console - standard output.
MaxLinesPerSecond no 1-1000 20 Maximum number of new lines the agent will send per second to Zabbix server or proxy when processing 'log' and 'eventlog' active checks.
The provided value will be overridden by the parameter 'maxlines',
provided in 'log' or 'eventlog' item key.
Note: Zabbix will process 10 times more new lines than set in MaxLinesPerSecond to seek the required string in log items.

Note that this parameter has been replaced by the Plugins.Log.MaxLinesPerSecond parameter in 4.4.2.
PidFile no /tmp/zabbix_agent2.pid Name of PID file.
Plugins no A plugin can have one or more plugin-specific configuration parameters in format:
Plugins.<PluginName>.<Parameter1>=<value1>
Plugins.<PluginName>.<Parameter2>=<value2>
Plugins.Redis.KeepAlive no 60-900 300 The maximum time of waiting (in seconds) before unused Redis connections are closed.
This parameter is supported since 4.4.5 and is used by the Redis plugin.
Plugins.Redis.Sessions.<sessionName>.<sessionParameter> no Named Redis session parameters.
E.g. Plugins.Redis.Sessions.<sessionName>.Uri=tcp://localhost:6380, Plugins.Redis.Sessions.<sessionName>.Password=secret where <sessionName> is the name of the session.
This parameter is supported since 4.4.5 and is used by the Redis plugin.
Plugins.Redis.Timeout no 1-30 Global timeout The maximum time of waiting (in seconds) for a Redis request to complete.
This parameter is supported since 4.4.5 and is used by the Redis plugin.
Plugins.Redis.Uri no tcp://localhost:6379 Redis connection string. Port can be omitted (default=6379). It ignores embedded credentials. Must match the URI format. Must contain a scheme (the only supported schemas: "tcp" and "unix" ). For example: tcp://localhost:6379, tcp://localhost, unix:/var/run/redis.sock
This parameter is supported since 4.4.5 and is used by the Redis plugin.
Plugins.SystemRun.EnableRemoteCommands no 0 Whether remote commands from Zabbix server are allowed.
0 - not allowed
1 - allowed
This parameter is supported since 4.4.2 and replaces EnableRemoteCommands.
Plugins.SystemRun.LogRemoteCommands no 0 Enable logging of executed shell commands as warnings.
0 - disabled
1 - enabled
This parameter is supported since 4.4.2 and replaces LogRemoteCommands.
Plugins.Log.MaxLinesPerSecond no 1-1000 20 Maximum number of new lines the agent will send per second to Zabbix server or proxy when processing 'log' and 'eventlog' active checks.
The provided value will be overridden by the parameter 'maxlines',
provided in 'log' or 'eventlog' item key.
Note: Zabbix will process 10 times more new lines than set in MaxLinesPerSecond to seek the required string in log items.
This parameter is supported since 4.4.2 and replaces MaxLinesPerSecond.
RefreshActiveChecks no 60-3600 120 How often the list of active checks is refreshed, in seconds.
Note that after failing to refresh active checks the next refresh will be attempted after 60 seconds.
Server yes List of comma-delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix servers and Zabbix proxies.
Incoming connections will be accepted only from the hosts listed here.
If IPv6 support is enabled then '127.0.0.1', '::ffff:127.0.0.1' are treated equally and '::/0' will allow any IPv4 or IPv6 address.
'0.0.0.0/0' can be used to allow any IPv4 address.
Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
Spaces are allowed.
ServerActive no List of comma-delimited IP:port (or DNS name:port) pairs of Zabbix servers and Zabbix proxies for active checks.
Multiple addresses can be provided to use several independent Zabbix servers in parallel. Spaces are allowed.
If port is not specified, default port is used.
IPv6 addresses must be enclosed in square brackets if port for that host is specified.
If port is not specified, square brackets for IPv6 addresses are optional.
If this parameter is not specified, active checks are disabled.
Example: ServerActive=127.0.0.1:20051,zabbix.example.com,[::1]:30051,::1,[12fc::1]
SourceIP no Source IP address for:
- outgoing connections to Zabbix server or Zabbix proxy;
- making connections while executing some items (web.page.get, net.tcp.port, etc.)
StatusPort no 1024-32767 If set, agent will listen on this port for HTTP status requests (http://localhost:<port>/status).
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:
unencrypted - accept connections without encryption (default)
psk - accept connections with TLS and a pre-shared key (PSK)
cert - accept connections with TLS and a certificate
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.
TLSCertFile no Full pathname of a file containing the agent certificate or certificate chain, used for encrypted communications with Zabbix components.
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:
unencrypted - connect without encryption (default)
psk - connect using TLS and a pre-shared key (PSK)
cert - connect using TLS and a certificate
TLSCRLFile no Full pathname of a file containing revoked certificates. This parameter is used for encrypted communications with Zabbix components.
TLSKeyFile no Full pathname of a file containing the agent private key used for encrypted communications with Zabbix components.
TLSPSKFile no Full pathname of a file containing the agent pre-shared key used for encrypted communications with Zabbix components.
TLSPSKIdentity no Pre-shared key identity string, used for encrypted communications with Zabbix server.
TLSServerCertIssuer no Allowed server (proxy) certificate issuer.
TLSServerCertSubject no Allowed server (proxy) certificate subject.
UnsafeUserParameters no 0,1 0 Allow all characters to be passed in arguments to user-defined parameters.
The following characters are not allowed:
\ ' " ` * ? [ ] { } ~ $ ! & ; ( ) < > | # @
Additionally, newline characters are not allowed.
UserParameter no User-defined parameter to monitor. There can be several user-defined parameters.
Format: UserParameter=<key>,<shell command>
Note that the shell command must not return empty string or EOL only.
Example: UserParameter=system.test,who|wc -l