zabbix_agent2
Monitors host metrics for Zabbix
TLDR
Start the agent with the default configuration file
Start the agent with a custom configuration file
Test the configuration file and exit
Test a specific item with verbose output
Reload user parameters from the configuration file (runtime control)
Increase or decrease log level (runtime control)
Display help
SYNOPSIS
zabbix_agent2 [-c config_file] [-d] [-f] [-h] [-p pid_file] [-R command] [-s] [-t item] [-V]
PARAMETERS
-c, --config <file>
Set path to configuration file (default: /etc/zabbix/zabbix_agent2.conf)
-d, --daemon
Start as a daemon process
-f, --foreground
Run in foreground (do not daemonize)
-h, --help
Display help and exit
-p, --pidfile <file>
Name and path of PID file (default: /run/zabbix/zabbix_agent2.pid)
-R, --runtime-control <cmd[,param]>
Perform runtime control action like agent reload or plugin load
-s, --start-plugins
Start plugins on agent startup (default behavior)
-t, --test <item>
Test specified item and exit
-V, --version
Display version number and exit
DESCRIPTION
Zabbix Agent 2 is the next-generation monitoring agent for the Zabbix open-source monitoring platform, introduced to replace the legacy C-based zabbix_agentd. Written in Go, it offers superior performance, multi-threading, and extensibility through a plugin architecture. The agent collects system and application metrics from hosts, such as CPU, memory, disk usage, network stats, and custom items via plugins (e.g., for databases like PostgreSQL, MySQL, or Oracle).
It supports both passive checks (server polls agent) and active checks (agent pushes data). Key advantages include native TLS support, better resource efficiency, and runtime plugin loading without restart. Ideal for large-scale environments, it runs as a daemon, in foreground for testing, or with runtime controls for dynamic management.
Configuration is via INI-style files, defining servers, hostnames, items, and plugins. Security features include PSK encryption and userparameter scripts. Zabbix Agent 2 coexists with the legacy agent during transitions, ensuring smooth upgrades.
CAVEATS
Requires Zabbix server/proxy 6.0+; plugins need separate installation; high load may require tuning via config (e.g., StartAgents). Not compatible with legacy agent configs without migration.
CONFIGURATION HIGHLIGHTS
Key config options: Server=IP/DNS of Zabbix servers,
ServerActive=servers for active checks,
Hostname=agent host name,
Plugins=enabled plugins list,
ListenPort=10050 (default).
PLUGINS SYSTEM
Extensible via Go plugins (.so files) for custom monitoring (e.g., mongodb, promtail). Load/unload at runtime with -R plugin.load[...].
HISTORY
Developed by Zabbix SIA, first released in Zabbix 5.4 as experimental (2021), became default in Zabbix 6.0 (2022). Shifted to Go for cross-platform plugins, outperforming legacy agent in scalability and maintenance.
SEE ALSO
zabbix_agentd(8), zabbix_sender(1), zabbix_get(1), zabbix_proxy(8)


