Zabbix Documentation 1.8

2.23.03.4In development:4.0Unsupported versions:1.82.02.43.2

User Tools

Site Tools


Sidebar


Ask questions to Zabbix Dev Team in person at the Zabbix Summit 2018!
manual:processes

3 Zabbix Processes

1 Logging

For logging configuration of Zabbix daemons “LogFile” configuration parameter is used. If this parameter is left empty (LogFile=), syslog logging facilities are used. All Zabbix daemons on Unix-like platforms log their messages from “Daemon” environment. The mapping between Zabbix logging levels and syslog levels is as follows:

Zabbix log levelsyslog log levelComments
0 - empty
(LOG_LEVEL_EMPTY)
syslog is not used. All messages are skipped.
1 - critical information
(LOG_LEVEL_CRIT)
critical conditions
(LOG_CRIT)
2 - error information
(LOG_LEVEL_ERR)
error conditions
(LOG_ERR)
3 - warnings
(LOG_LEVEL_WARNING)
warning conditions
(LOG_WARNING)
4 - for debugging
(LOG_LEVEL_DEBUG)
debug-level messages
(LOG_DEBUG)

For syslog configuration consult the corresponding literature.


Zabbix agent under Windows uses Event Log if “LogFile” configuration parameter is provided empty. Mapping between Zabbix log levels (messages of corresponding type) and Windows Event Log entries type is provided below:

Zabbix log levelWindows Event Log entry typeComments
0 - empty
(LOG_LEVEL_EMPTY)
Event Log is not used. All messages are skipped.
1 - critical information
(LOG_LEVEL_CRIT)
2 - error information
(LOG_LEVEL_ERR)
EVENTLOG_ERROR_TYPE Error
3 - warnings
(LOG_LEVEL_WARNING)
EVENTLOG_WARNING_TYPE Warning
4 - for debugging
(LOG_LEVEL_DEBUG)
EVENTLOG_INFORMATION_TYPE Information

2 Individual processes

1 Zabbix Server

Zabbix server is the central process of Zabbix software. Zabbix server can be started by executing:

shell> cd sbin
shell> ./zabbix_server

Zabbix server runs as a daemon process.

Zabbix server accepts the following command line parameters:

-c --config <file>              absolute path to the configuration file (default is /etc/zabbix/zabbix_server.conf)
-n --new-nodeid <nodeid>        convert database data to new nodeid
-R --runtime-control <option>   perform administrative functions
-h --help                       give this help
-V --version                    display version number

-R or --runtime-control option is supported since Zabbix 1.8.6.
Runtime control is not supported on OpenBSD and NetBSD.

In order to get more help run:

shell> zabbix_server -h

Example of command line parameters:

shell> zabbix_server -c /usr/local/etc/zabbix_server.conf
shell> zabbix_server --help
shell> zabbix_server -V

Runtime control

Runtime control options:

OptionDescription
config_cache_reloadReload configuration cache. Ignored if cache is being currently loaded.

Example of using runtime control to reload the server configuration cache:

shell> zabbix_server -c /usr/local/etc/zabbix_server.conf -R config_cache_reload

Configuration file

The configuration file contains parameters for zabbix_server. The file must exist and it should have read permissions for user 'zabbix'. Supported parameters:

ParameterMandatoryRangeDefaultDescription
AlertScriptsPath no /home/zabbix/bin/ Location of custom alert scripts
CacheSize no 128K-1G 8M Size of configuration cache, in bytes.
Shared memory size for storing hosts and items data.
CacheUpdateFrequency no 1-3600 60 How often Zabbix will perform update of configuration cache, in seconds.
DBHost no Based on the underlying library implementation used. Database host name.
If set to localhost, socket is used for MySQL.
DBName yes Database name.
For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
DBPassword no Database password. Ignored for SQLite.
Comment this line if no password is used.
DBPort no 1024-65535 3306 Database port when not using local socket. Ignored for SQLite.
DBSocket no /tmp/mysql.sock Path to MySQL socket.
DBUser no Database user. Ignored for SQLite.
DebugLevel no 0-4 3 Specifies debug level
0 - no debug
1 - critical information
2 - error information
3 - warnings
4 - for debugging (produces lots of information)
DisableHousekeeping no 0-1 0 If set to 1, disables housekeeping.
ExternalScripts no /etc/zabbix/externalscripts Location of external scripts
Fping6Location no /usr/sbin/fping6 Location of fping6.
Make sure that fping6 binary has root ownership and SUID flag set.
Make empty (“Fping6Location=”) if your fping utility is capable to process IPv6 addresses.
FpingLocation no /usr/sbin/fping Location of fping.
Make sure that fping binary has root ownership and SUID flag set!
HistoryCacheSize no 128K-1G 8M Size of history cache, in bytes.
Shared memory size for storing history data.
HistoryTextCacheSize no 128K-1G 16M Size of text history cache, in bytes.
Shared memory size for storing character, text or log history data.
HousekeepingFrequency no 1-24 1 How often Zabbix will perform housekeeping procedure (in hours).
Housekeeping is removing unnecessary information from history, alert, and alarms tables.
Note: To prevent housekeeper from being overloaded (for example, when history and trend periods are greatly reduced), no more than 4xHousekeepingFrequency hours of outdated history are deleted in one housekeeping cycle, for each item. Thus, if HousekeepingFrequency is 1, no more than 4 hours of outdated history (starting from the oldest entry) will be deleted per cycle.
Include no You may include individual files or all files in a directory in the configuration file. See special notes about limitations.
ListenIP no 0.0.0.0 List of comma delimited IP addresses that the trapper should listen on.
Trapper will listen on all network interfaces if this parameter is missing.
Multiple IP addresses are supported in version 1.8.3 and higher.
ListenPort no 1024-32767 10051 Listen port for trapper.
LogFileSize no 0-1024 1 Maximum size of log file in MB.
0 - disable automatic log rotation.
LogFile no Name of log file.
LogSlowQueries no 0-3600000 0 How long a database query may take before being logged (in milliseconds).
0 - don't log slow queries.
This option becomes enabled starting with DebugLevel=3.
This option is supported in version 1.8.2 and higher.
MaxHousekeeperDelete no 0-1000000 500 No more than 'MaxHousekeeperDelete' rows (corresponding to [tablename], [field], [value]) will be deleted per one task in one housekeeping cycle.
SQLite3 does not use this parameter, deletes all corresponding rows without a limit.
If set to 0 then no limit is used at all. In this case you must know what you are doing!
This parameter is supported since Zabbix 1.8.2 and applies only to deleting history and trends of already deleted items.
NodeID no 0-999 0 Unique NodeID in distributed setup.
0 - standalone server
NodeNoEvents no 0-1 0 If set to '1' local events won't be sent to master node.
This won't impact ability of this node to propagate events from its child nodes.
NodeNoHistory no 0-1 0 If set to '1' local history won't be sent to master node.
This won't impact ability of this node to propagate history from its child nodes.
PidFile no /tmp/zabbix_server.pid Name of PID file.
ProxyConfigFrequency no 1-604800 3600 How often Zabbix Server sends configuration data to a Zabbix Proxy in seconds. Used only for proxies in a passive mode.
This option is supported in version 1.8.3 and higher.
ProxyDataFrequency no 1-3600 1 How often Zabbix Server requests history data from a Zabbix Proxy in seconds. Used only for proxies in a passive mode.
This option is supported in version 1.8.3 and higher.
SSHKeyLocation no Location of public and private keys for SSH checks
SenderFrequency no 5-3600 30 How often Zabbix will try to send unsent alerts (in seconds).
SourceIP no Source IP address for outgoing connections.
StartDBSyncers no 1-100 4 Number of pre-forked instances of DB Syncers.
The upper limit used to be 64 before version 1.8.5.
This option is supported in version 1.8.3 and higher.
StartDiscoverers no 0-250 1 Number of pre-forked instances of discoverers.
The upper limit used to be 255 before version 1.8.5.
StartHTTPPollers no 0-1000 1 Number of pre-forked instances of HTTP pollers.
The upper limit used to be 255 before version 1.8.5.
StartIPMIPollers no 0-1000 0 Number of pre-forked instances of IPMI pollers.
The upper limit used to be 255 before version 1.8.5.
StartPingers no 0-1000 1 Number of pre-forked instances of ICMP pingers.
The upper limit used to be 255 before version 1.8.5.
StartPollersUnreachable no 0-1000 1 Number of pre-forked instances of pollers for unreachable hosts (including IPMI).
The upper limit used to be 255 before version 1.8.5.
This option is missing in version 1.8.3.
StartPollers no 0-1000 5 Number of pre-forked instances of pollers.
The upper limit used to be 255 before version 1.8.5.
StartProxyPollers no 0-250 1 Number of pre-forked instances of pollers for passive proxies.
The upper limit used to be 255 before version 1.8.5.
This option is supported in version 1.8.3 and higher.
StartTrappers no 0-1000 5 Number of pre-forked instances of trappers.
The upper limit used to be 255 before version 1.8.5.
Timeout no 1-30 3 Specifies how long we wait for agent, SNMP device or external check (in seconds).
TmpDir no /tmp Temporary directory.
TrapperTimeout no 1-300 300 Specifies how many seconds trapper may spend processing new data.
TrendCacheSize no 128K-1G 4M Size of trend cache, in bytes.
Shared memory size for storing trends data.
UnavailableDelay no 1-3600 60 How often host is checked for availability during the unavailability period, in seconds.
UnreachableDelay no 1-3600 15 How often host is checked for availability during the unreachability period, in seconds.
UnreachablePeriod no 1-3600 45 After how many seconds of unreachability treat a host as unavailable.

Starting from version 1.8.6 Zabbix Server will not start up if invalid (not following parameter=value notation) or unknown parameter entry is present in configuration file.

Zabbix supports configuration files only in UTF-8 encoding without BOM.

2016/01/14 11:30
2 Zabbix Proxy

Zabbix proxy is a process which collects performance and availability data from one or more monitored devices and sends the information to a Zabbix server. Zabbix proxy can be started by:

shell> cd sbin
shell> ./zabbix_proxy

Zabbix proxy runs as a daemon process.

Zabbix proxy accepts the following command line parameters:

-c --config <file>              absolute path to the configuration file
-R --runtime-control <option>   perform administrative functions
-h --help                       give this help
-V --version                    display version number

-R or --runtime-control option is supported since Zabbix 1.8.6.
Runtime control is not supported on OpenBSD and NetBSD.

In order to get more help run:

shell> zabbix_proxy -h

Example of command line parameters:

shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf
shell> zabbix_proxy --help
shell> zabbix_proxy -V

Runtime control

Runtime control options:

OptionDescription
config_cache_reloadReload configuration cache. Ignored if cache is being currently loaded.
Active Zabbix proxy will connect to the Zabbix server and request configuration data.

Example of using runtime control to reload the proxy configuration cache:

shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R config_cache_reload

Configuration file

The configuration file contains parameters for zabbix_proxy. The file must exist and it should have read permissions for user 'zabbix'. Supported parameters:

ParameterMandatoryRangeDefaultDescription
CacheSize no 128K-1G 8M Size of configuration cache, in bytes.
Shared memory size, for storing hosts and items data.
ConfigFrequency no 1-604800 3600 How often proxy retrieves configuration data from Zabbix Server in seconds.
For a proxy in the passive mode this parameter will be ignored.
DBHost no Based on the underlying library implementation used. Database host name.
If set to localhost, socket is used for MySQL.
DBName yes Database name.
For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
DBPassword no Database password. Ignored for SQLite.
Comment this line if no password is used.
DBSocket no 3306 Path to MySQL socket.
Database port when not using local socket. Ignored for SQLite.
DBUser Database user. Ignored for SQLite.
DataSenderFrequency no 1-3600 1 Proxy will send collected data to the Server every N seconds.
DebugLevel no 0-4 3 Specifies debug level
0 - no debug
1 - critical information
2 - error information
3 - warnings
4 - for debugging (produces lots of information)
DisableHousekeeping no 0-1 0 If set to 1, disables housekeeping.
ExternalScripts no /etc/zabbix/externalscripts Location of external scripts
Fping6Location no /usr/sbin/fping6 Location of fping6.
Make sure that fping6 binary has root ownership and SUID flag set.
Make empty (“Fping6Location=”) if your fping utility is capable to process IPv6 addresses.
FpingLocation no /usr/sbin/fping Location of fping.
Make sure that fping binary has root ownership and SUID flag set!
HeartbeatFrequency no 0-3600 60 Frequency of heartbeat messages in seconds.
Used for monitoring availability of Proxy on server side.
0 - heartbeat messages disabled.
For a proxy in the passive mode this parameter will be ignored.
HistoryCacheSize no 128K-1G 8M Size of history cache, in bytes.
Shared memory size for storing history data.
HistoryTextCacheSize no 128K-1G 16M Size of text history cache, in bytes.
Shared memory size for storing character, text or log history data.
Hostname no Set by HostnameItem Unique, case sensitive Proxy name. Make sure the Proxy name is known to the server!
Allowed characters: alphanumeric, '.', ' ', '_' and '-'.
Maximum length: 64
HostnameItem no system.hostname Item used for setting Hostname if it is undefined (this will be run on the proxy similarly as on an agent).
Does not support UserParameters, performance counters or aliases, but does support system.run[].

Ignored if Hostname is set.

This option is supported in version 1.8.6 and higher.
HousekeepingFrequency no 1-24 1 How often Zabbix will perform housekeeping procedure (in hours).
Housekeeping is removing unnecessary information from history, alert, and alarms tables.
Note: To prevent housekeeper from being overloaded (for example, when history and trend periods are greatly reduced), no more than 4xHousekeepingFrequency hours of outdated history are deleted in one housekeeping cycle, for each item. Thus, if HousekeepingFrequency is 1, no more than 4 hours of outdated history (starting from the oldest entry) will be deleted per cycle.
Include no You may include individual files or all files in a directory in the configuration file. See special notes about limitations.
ListenIP no 0.0.0.0 List of comma delimited IP addresses that the trapper should listen on.
Trapper will listen on all network interfaces if this parameter is missing.
Multiple IP addresses are supported in version 1.8.3 and higher.
ListenPort no 1024-32767 10051 Listen port for trapper.
LogFileSize no 0-1024 1 Maximum size of log file in MB.
0 - disable automatic log rotation.
LogFile no Name of log file.
If not set, syslog is used.
LogSlowQueries no 0-3600000 0 How long a database query may take before being logged (in milliseconds).
0 - don't log slow queries.
This option becomes enabled starting with DebugLevel=3.
This option is supported in version 1.8.2 and higher.
PidFile no /tmp/zabbix_proxy.pid Name of PID file.
ProxyLocalBuffer no 0-720 0 Proxy will keep data locally for N hours.
This parameter may be used if local data will be used by third party applications.
ProxyMode no 0-1 0 Proxy operating mode.
0 - proxy in the active mode
1 - proxy in the passive mode
This option is supported in version 1.8.3 and higher.
ProxyOfflineBuffer no 1-720 1 Proxy will keep data for N hours in case of no connectivity with Zabbix Server.
Older data will be lost.
SSHKeyLocation no Location of public and private keys for SSH checks
ServerPort no 1024-32767 10051 Port of Zabbix trapper on Zabbix server.
For a proxy in the passive mode this parameter will be ignored.
Server yes IP address (or hostname) of Zabbix server.
Active Proxy will get configuration data from the server.
For a proxy in the passive mode this parameter will be ignored.
SourceIP no Source IP address for outgoing connections.
StartDBSyncers no 1-100 4 Number of pre-forked instances of DB Syncers.
The upper limit used to be 64 before version 1.8.5.
This option is supported in version 1.8.3 and higher.
StartDiscoverers no 0-250 1 Number of pre-forked instances of discoverers.
The upper limit used to be 255 before version 1.8.5.
StartIPMIPollers no 0-1000 0 Number of pre-forked instances of IPMI pollers.
The upper limit used to be 255 before version 1.8.5.
StartPingers no 0-1000 1 Number of pre-forked instances of ICMP pingers.
The upper limit used to be 255 before version 1.8.5.
StartPollersUnreachable no 0-1000 1 Number of pre-forked instances of pollers for unreachable hosts (including IPMI).
The upper limit used to be 255 before version 1.8.5.
This option is missing in version 1.8.3.
StartPollers no 0-1000 5 Number of pre-forked instances of pollers.
The upper limit used to be 255 before version 1.8.5.
StartTrappers no 0-1000 5 Number of pre-forked instances of trappers.
The upper limit used to be 255 before version 1.8.5.
Timeout no 1-30 3 Specifies how long we wait for agent, SNMP device or external check (in seconds).
TmpDir no /tmp Temporary directory.
TrapperTimeout no 1-300 300 Specifies how many seconds trapper may spend processing new data.
UnavailableDelay no 1-3600 60 How often host is checked for availability during the unavailability period, in seconds.
UnreachableDelay no 1-3600 15 How often host is checked for availability during the unreachability period, in seconds.
UnreachablePeriod no 1-3600 45 After how many seconds of unreachability treat a host as unavailable.

Starting from version 1.8.6 Zabbix Proxy will not start up if invalid (not following parameter=value notation) or unknown parameter entry is present in configuration file.

Zabbix supports configuration files only in UTF-8 encoding without BOM.

2009/08/12 13:11 · Alexei
3 Zabbix Agent (UNIX, Standalone daemon)

Zabbix UNIX agent daemon runs on a host being monitored. The agent provides host's performance and availability information for Zabbix Server. Zabbix agent processes items of type 'Zabbix agent' or 'Zabbix agent (active)'.

Zabbix agent can be started by executing:

shell> cd sbin
shell> ./zabbix_agentd

Zabbix agent runs as a daemon process.

Zabbix agent accepts the following command line parameters:

  -c --config <file>   specify configuration file, default is /etc/zabbix/zabbix_agentd.conf
  -h --help            give this help
  -V --version         display version number
  -p --print           print known items and exit
  -t --test <item key> test specified item and exit

In order to get this help run:

shell> zabbix_agentd -h

Example of command line parameters:

shell> zabbix_agentd -c /usr/local/etc/zabbix_agentd.conf
shell> zabbix_agentd --help
shell> zabbix_agentd --print
shell> zabbix_agentd -t "system.cpu.load[all,avg1]"

Configuration file

The configuration file contains configuration parameters for zabbix_agentd. The file must exist and it should have read permissions for user 'zabbix'. Supported parameters:

ParameterMandatoryRangeDefaultDescription
Alias no Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one.

Starting from version 1.8.6 Zabbix Agent will not start up in case incorrectly formatted Alias entry or duplicate Alias key is present in configuration file.
AllowRoot no 0 Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent will try to switch to user 'zabbix' instead. Has no effect if started under a regular user.
0 - do not allow
1 - allow
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-4 3 Specifies debug level
0 - no debug
1 - critical information
2 - error information
3 - warnings
4 - for debugging (produces lots of information)
DisableActive no 0 Disable active checks. The agent will work in passive mode listening for server.
DisablePassive no 0 Disable passive checks. The agent will not listen on any TCP port.
Only active checks will be processed.
0 - do not disable
1 - disable
EnableRemoteCommands no 0 Whether remote commands from Zabbix server are allowed.
0 - not allowed
1 - allowed
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: 64
HostnameItem no system.hostname Item used for setting Hostname if it is undefined.
Does not support UserParameters, performance counters or aliases, but does support system.run[] regardless of EnableRemoteCommands value.

Ignored if Hostname is set.

This option is supported in version 1.8.6 and higher.
Include no You may include individual files or all files in a directory in the configuration file. 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 in version 1.8.3 and higher.
ListenPort no 1024-32767 10050 Agent will listen on this port for connections from the server.
LogFileSize no 0-1024 1 Maximum size of log file in MB.
0 - disable automatic log rotation.
LogFile no Name of log file.
If not set, syslog is used.
LogRemoteCommands no 0 Enable logging of executed shell commands as warnings.
0 - disabled
1 - enabled
MaxLinesPerSecond no 1-1000 100 Maximum number of new lines the agent will send per second to Zabbix server
or proxy 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 4 times more new lines than set in MaxLinesPerSecond to seek the required string in log items.
PidFile no /tmp/zabbix_agentd.pid Name of PID file.
RefreshActiveChecks no 60-3600 120 How often list of active checks is refreshed, in seconds.
Server yes List of comma delimited IP addresses (or hostnames) of Zabbix servers. No spaces allowed.
If ServerActive is not specified, the first entry is used for receiving list of and sending active checks.
Note that hostnames must resolve hostname→IP address and IP address→hostname.
If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
ServerActive no List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks. No spaces allowed.
If ServerActive is specified, first host in the Server option is not used for active checks, only for passive checks.
If the port is not specified, ServerPort port is used for that host. If ServerPort 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.
This option is supported in version 1.8.12 and higher.
ServerPort no 10051 Server port for retrieving list of and sending active checks.
SourceIP no Source IP address for outgoing connections.
StartAgents no 1-100 3 Number of pre-forked instances of zabbix_agentd that process passive checks.
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
UnsafeUserParameters no 0,1 0 Allow all characters to be passed in arguments to user-defined parameters. Supported since Zabbix 1.8.2.
UserParameter no User-defined parameter to monitor. There can be several user-defined parameters.
Format: UserParameter=<key>,<shell command>
Note that shell command must not return empty string or EOL only.
Example: UserParameter=system.test,who|wc -l

Starting from version 1.8.6 Zabbix Agent will not start up in case incorrectly formatted UserParameter entry or duplicate UserParameter key is present in configuration file.

Starting from version 1.8.6 Zabbix agent daemon will not start up if invalid (not following parameter=value notation) or unknown parameter entry is present in configuration file.

Zabbix supports configuration files only in UTF-8 encoding without BOM.

2011/07/06 10:18

4 Zabbix Agent (UNIX, Inetd version)

The file contains configuration parameters for zabbix_agent. The file must exist and it should have read permissions for user 'zabbix'. Supported parameters:

ParameterMandatoryDefault valueDescription
Alias no Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one.

Starting from version 1.8.6 Zabbix Agent will terminate in case incorrectly formatted Alias entry or duplicate Alias key is present in configuration file.
Include no You may include individual files or all files in a directory in the configuration file. See special notes about limitations.
Server yes -Comma-delimited list of IP addresses of ZABBIX Servers or Proxies. Connections from other IP addresses will be rejected.
Timeout no 3Do not spend more than Timeout seconds on getting requested value (1-255). The agent does not kill timeouted User Parameters processes!
UnsafeUserParameters no 0 Allow all characters to be passed in arguments to user-defined parameters
UserParameter no User-defined parameter to monitor. There can be several user-defined parameters.
Format: UserParameter=<key>,<shell command>
Note that shell command must not return empty string or EOL only.
Example: UserParameter=system.test,who|wc -l

Starting from version 1.8.6 Zabbix Agent will terminate in case incorrectly formatted UserParameter entry or duplicate UserParameter key is present in configuration file.

Starting from version 1.8.6 Zabbix Agent will terminate if invalid (not following parameter=value notation) or unknown parameter entry is present in configuration file.

Zabbix supports configuration files only in UTF-8 encoding without BOM.

2009/08/12 14:26 · Alexei
5 Zabbix Agent (Windows)
Installation

Installation is very simple and includes 3 steps:

Step 1

Create configuration file.

Create configuration file c:/zabbix_agentd.conf in UTF8 encoding without BOM (it has similar syntax as the UNIX agent).

An example configuration file is available in Zabbix source archive as misc/confzabbix_agentd.win.conf.

Step 2

Install agent as a Windows service.

zabbix_agentd.exe --install

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

zabbix_agentd.exe --config <your_configuration_file> --install

Full path to configuration file should be specified.

Step 3

Run agent.

Now you can use Control Panel to start agent's service or run:

zabbix_agentd.exe --start

Windows NT 4.0 note. Zabbix_agentd.exe uses PDH (Performance Data Helper) API to gather various system information, so PDH.DLL is needed. This DLL is not supplied with Windows NT 4.0, so you need to download and install it by yourself. Microsoft Knowledge Base article number 284996 describes this in detail and contains a download link. You can find this article at http://support.microsoft.com/default.aspx?scid=kb;en-us;284996

Usage

Command line syntax:

zabbix_agentd.exe [-Vhp] [-idsx] [-c <file>] [-t <metric>]

Zabbix Windows agent accepts the following command line parameters:

Options:

  -c --config <file>   Specify alternate configuration file (default is c:\zabbix_agentd.conf).
  -h --help            Display help information.
  -V --version         Display version number.
  -p --print           Print known items and exit.
  -t --test <item key> Test single item and exit.

Functions:

  -i --install   Install Zabbix agent as a service.
  -d --uninstall Uninstall Zabbix agent service.
  -s --start     Start Zabbix agent service.
  -x --stop      Stop Zabbix agent service.
  -m --multiple-agents  Service name will include hostname

Configuration file

The configuration file (c:/zabbix_agentd.conf) contains configuration parameters for zabbix_agentd.exe. Supported parameters:

ParameterMandatoryRangeDefaultDescription
Alias no Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one.
For example, if you wish to retrieve paging file usage in percents from the server,
you may use parameter “perf_counter[\Paging File(_Total)\% Usage]”, or you may define an alias by adding the following line to configuration file
Alias = pg_usage:perf_counter[\Paging File(_Total)\% Usage]
After that you can use parameter name “pg_usage” to retrieve the same information.
You can specify as many “Alias” records as you wish.
Aliases cannot be used for parameters defined in “PerfCounter” configuration file records.

Starting from version 1.8.6 Zabbix Agent will not start up in case incorrectly formatted Alias entry or duplicate Alias key is present in configuration file.
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-4 3 Specifies debug level
0 - no debug
1 - critical information
2 - error information
3 - warnings
4 - for debugging (produces lots of information)
DisableActive no 0 Disable active checks. The agent will work in passive mode listening for server.
DisablePassive no 0 Disable passive checks. The agent will not listen on any TCP port.
Only active checks will be processed.
0 - do not disable
1 - disable
EnableRemoteCommands no 0 Whether remote commands from Zabbix server are allowed.
0 - not allowed
1 - allowed
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: 64
HostnameItem no system.hostname Item used for setting Hostname if it is undefined.
Does not support UserParameters, performance counters or aliases, but does support system.run[] regardless of EnableRemoteCommands value.

Ignored if Hostname is set.

This option is supported in version 1.8.6 and higher.
Include no You may include individual file in the configuration file.
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.
LogFileSize no 0-1024 1 Maximum size of log file in MB.
0 - disable automatic log rotation.
LogFile no Name of log file.
If not set, Windows Event Log is used.
LogRemoteCommands no 0 Enable logging of executed shell commands as warnings.
0 - disabled
1 - enabled
MaxLinesPerSecond no 1-1000 100 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.
PerfCounter no Syntax: <parameter_name>,“<perf_counter_path>”,<period>
Defines new parameter <parameter_name> which is an average value for system performance counter <perf_counter_path> for the specified time period <period> (in seconds).
For example, if you wish to receive average number of processor interrupts per second for last minute, you can define new parameter “interrupts” as 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.

Starting from version 1.8.6 Zabbix Agent will not start up in case incorrectly formatted PerfCounter entry or duplicate PerfCounter key is present in configuration file.
RefreshActiveChecks no 60-3600 120 How often list of active checks is refreshed, in seconds.
Server yes List of comma delimited IP addresses (or hostnames) of Zabbix servers. No spaces allowed.
If ServerActive is not specified, the first entry is used for receiving list of and sending active checks.
Note that hostnames must resolve hostname→IP address and IP address→hostname.
If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
ServerActive no List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks. No spaces allowed.
If ServerActive is specified, first host in the Server option is not used for active checks, only for passive checks.
If the port is not specified, ServerPort port is used for that host. If ServerPort 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.
This option is supported in version 1.8.13 and higher.
ServerPort no 10051 Server port for retrieving list of and sending active checks.
SourceIP no Source IP address for outgoing connections.
StartAgents no 1-63 (*) 3 Number of pre-forked instances of zabbix_agentd that process passive checks.
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
UnsafeUserParameters no 0-1 0 Allow all characters to be passed in arguments to user-defined parameters.
0 - do not allow
1 - allow
UserParameter User-defined parameter to monitor. There can be several user-defined parameters.
Format: UserParameter=<key>,<shell command>
Note that shell command must not return empty string or EOL only.
Example: UserParameter=system.test,echo 1

Starting from version 1.8.6 Zabbix Agent will not start up in case incorrectly formatted UserParameter entry or duplicate UserParameter key is present in configuration file.

(*) 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.

Starting from version 1.8.6 Zabbix agent will not start up if invalid (not following parameter=value notation) or unknown parameter entry is present in configuration file.

Zabbix supports configuration files only in UTF-8 encoding without BOM.

2009/08/12 14:34 · Alexei

6 Zabbix Sender (UNIX)

Zabbix UNIX Sender is a command line utility which may be used to send performance data to Zabbix server for processing.

The utility is usually used in long running user scripts for periodical sending of availability and performance data. Zabbix Sender can be started by executing:

shell> cd bin
shell> ./zabbix_sender -z zabbix -s "Linux DB3" -k db.connections -o 43

Starting with Zabbix 1.8.2, objects with whitespaces can be passed using zabbix_sender. In this case, these objects must be quoted using double quotes.

Starting with Zabbix 1.8.4, zabbix_sender has been improved in realtime sending scenarios by gathering multiple values that are passed to it in close succession, and sending them to the server in single connection. Value that is not further apart from previous value than 0.2 seconds can be put in the same stack, but maximum pooling time still is 1 second.

If sending many values from an input file, Zabbix sender will batch them at 250 values in one go (all values will be processed), for example:

# zabbix_sender -z 127.0.0.1 -i /tmp/traptest.txt 
Info from server: "Processed 250 Failed 0 Total 250 Seconds spent 0.002668"
Info from server: "Processed 50 Failed 0 Total 50 Seconds spent 0.000540"
sent: 300; skipped: 0; total: 300

All entries from an input file are sent in a sequential order top-down.

If the target item has triggers referencing it, all timestamps in an input file must be in an increasing order, otherwise event calculation will not be correct.

Starting from version 1.8.6 Zabbix Sender will terminate if invalid (not following parameter=value notation) parameter entry is present in specified configuration file.

See Zabbix Sender manpage for more information.

2016/01/14 11:30

7 Zabbix Get (UNIX)

Zabbix get is a process which communicates with Zabbix agent and retrieves required information.

The utility is usually used for troubleshooting of Zabbix agents.

Zabbix get can be started by executing:

shell> cd bin
shell> ./zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg1]"

Zabbix get accepts the following command line parameters:

  -s --host <host name or IP>      Specify host name or IP address of a host.
  -p --port <port number>          Specify port number of agent running on the host. Default is 10050.
  -I --source-address <IP address> Specify source IP address.
  -k --key <item key>              Specify key of item to retrieve value for.
  -h --help                        Give this help.
  -V --version                     Display version number.

In order to get this help run:

shell> zabbix_get --help
2009/08/12 14:40 · Alexei