{"id":28861,"date":"2026-12-06T22:06:11","date_gmt":"2026-12-06T22:06:11","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=28861"},"modified":"2026-12-06T22:06:11","modified_gmt":"2026-12-06T22:06:11","slug":"understanding-zabbix-agent-configuration","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/understanding-zabbix-agent-configuration\/","title":{"rendered":"Understanding Zabbix Agent Configuration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Zabbix agent configuration file controls which Zabbix servers may query the agent, where it sends active checks, how it identifies itself, and which custom checks and security rules it uses. This page explains the parameters that matter most in zabbix_agentd.conf and zabbix_agent2.conf, then adds a working minimal configuration, testing commands, PSK encryption and fixes for common agent errors.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Location of Zabbix Agent Configuration file<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Linux &#8211; Zabbix Agent Version 1 &#8211; \/etc\/zabbix\/zabbix_agentd.conf<\/li><li>Linux &#8211; Zabbix Agent Version 2 &#8211; \/etc\/zabbix\/zabbix_agent2.conf<\/li><li>Windows &#8211; Zabbix Agent Version 1 &#8211; zabbix_agent.conf<\/li><li>Windows &#8211; Zabbix Agent Version 2 &#8211; zabbix_agent2.win.conf<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Zabbix Agent Config Parameters Details<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.zabbix.com\/documentation\/current\/en\/manual\/appendix\/config\/zabbix_agentd\" target=\"_blank\" rel=\"noreferrer noopener\">Zabbix Agent (UNIX) Configuration parameters Details<\/a><\/li><li><a href=\"https:\/\/www.zabbix.com\/documentation\/current\/en\/manual\/appendix\/config\/zabbix_agent2\" target=\"_blank\" rel=\"noreferrer noopener\">Zabbix Agent 2 (UNIX) Configuration parameters Details<\/a><\/li><li><a href=\"https:\/\/www.zabbix.com\/documentation\/current\/en\/manual\/appendix\/config\/zabbix_agentd_win\" target=\"_blank\" rel=\"noreferrer noopener\">Zabbix Agent (Windows) Configuration parameters Details<\/a><\/li><li><a href=\"https:\/\/www.zabbix.com\/documentation\/current\/en\/manual\/appendix\/config\/zabbix_agent2_win\" target=\"_blank\" rel=\"noreferrer noopener\">Zabbix Agent 2 (Windows) Configuration parameters Details<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Example of Zabbix Agent Configuration file<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/64a6b4a8aca5461c48d11d11fbfa901c.js\"><\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Corrected file locations and how to reload changes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Linux paths above are correct for official Zabbix packages. The Windows names need fixing. <code>zabbix_agentd.win.conf<\/code> and <code>zabbix_agent2.win.conf<\/code> are the names of the sample files in the Zabbix source tree. When you install with the MSI package, the file on disk has a different name.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Agent<\/th><th>OS<\/th><th>Default config file (package\/MSI install)<\/th><th>Service name<\/th><\/tr><\/thead><tbody><tr><td>Zabbix agent<\/td><td>Linux<\/td><td><code>\/etc\/zabbix\/zabbix_agentd.conf<\/code><\/td><td><code>zabbix-agent<\/code><\/td><\/tr><tr><td>Zabbix agent 2<\/td><td>Linux<\/td><td><code>\/etc\/zabbix\/zabbix_agent2.conf<\/code><\/td><td><code>zabbix-agent2<\/code><\/td><\/tr><tr><td>Zabbix agent<\/td><td>Windows<\/td><td><code>C:\\Program Files\\Zabbix Agent\\zabbix_agentd.conf<\/code><\/td><td><code>Zabbix Agent<\/code><\/td><\/tr><tr><td>Zabbix agent 2<\/td><td>Windows<\/td><td><code>C:\\Program Files\\Zabbix Agent 2\\zabbix_agent2.conf<\/code><\/td><td><code>Zabbix Agent 2<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The agent reads its configuration only when it starts. Restart it after every change:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Linux<\/span>\nsudo systemctl restart zabbix-agent      <span class=\"hljs-comment\"># agent 1<\/span>\nsudo systemctl restart zabbix-agent2     <span class=\"hljs-comment\"># agent 2<\/span>\nsudo systemctl status zabbix-agent --no-pager\n\n<span class=\"hljs-comment\"># Windows (PowerShell as Administrator)<\/span>\nRestart-Service <span class=\"hljs-string\">\"Zabbix Agent\"<\/span>\nRestart-Service <span class=\"hljs-string\">\"Zabbix Agent 2\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Passive and active checks: the parameters that matter most<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most of the file above is commented-out defaults. Only a handful of lines decide whether monitoring works, and they belong to two modes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Passive checks:<\/strong> the server or proxy connects to the agent on TCP 10050 and asks for a value. This is controlled by <code>Server<\/code>, <code>ListenPort<\/code>, <code>ListenIP<\/code> and <code>StartAgents<\/code>.<\/li>\n\n\n<li><strong>Active checks:<\/strong> the agent connects to the server or proxy on TCP 10051, downloads its list of items and pushes the results. This is controlled by <code>ServerActive<\/code>, <code>Hostname<\/code>, <code>RefreshActiveChecks<\/code>, <code>BufferSend<\/code> and <code>BufferSize<\/code>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>What it does<\/th><th>Typical value<\/th><\/tr><\/thead><tbody><tr><td><code>Server<\/code><\/td><td>IPs, CIDRs or DNS names allowed to connect for passive checks. Connections from anywhere else are rejected.<\/td><td><code>192.168.1.5<\/code><\/td><\/tr><tr><td><code>ServerActive<\/code><\/td><td>Server or proxy address the agent connects to for active checks. If empty, active checks are disabled.<\/td><td><code>192.168.1.5<\/code> or <code>zbx.example.com:10051<\/code><\/td><\/tr><tr><td><code>Hostname<\/code><\/td><td>Must match the <strong>Host name<\/strong> in the frontend exactly (case-sensitive). Needed for active checks and auto-registration.<\/td><td><code>web01<\/code><\/td><\/tr><tr><td><code>HostMetadata<\/code><\/td><td>Free text the server uses in auto-registration action conditions.<\/td><td><code>Linux web<\/code><\/td><\/tr><tr><td><code>Timeout<\/code><\/td><td>Maximum seconds the agent spends on one check.<\/td><td><code>3<\/code> to <code>10<\/code><\/td><\/tr><tr><td><code>Include<\/code><\/td><td>Loads extra <code>.conf<\/code> files, usually user parameters.<\/td><td><code>\/etc\/zabbix\/zabbix_agentd.d\/*.conf<\/code><\/td><\/tr><tr><td><code>LogFileSize<\/code><\/td><td>Built-in log rotation in MB. <code>0<\/code> turns it off.<\/td><td><code>0<\/code> with logrotate, otherwise <code>10<\/code><\/td><\/tr><tr><td><code>DebugLevel<\/code><\/td><td>Log detail from 0 to 5. Use 4 only while troubleshooting.<\/td><td><code>3<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The example file above ships with <code>Server=127.0.0.1<\/code>, <code>ServerActive=127.0.0.1<\/code> and <code>Hostname=Zabbix server<\/code>. Those values are only right for the agent installed on the Zabbix server itself. On every other host, change all three, or the agent will reject the server and active checks will fail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A minimal working configuration for a monitored Linux host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#039;t need to edit hundreds of lines. Keep the packaged file and make sure these lines are set and not commented out. In this example the Zabbix server is <code>192.168.1.5<\/code> and the host is called <code>web01<\/code> in the frontend.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">PidFile=<span class=\"hljs-regexp\">\/run\/<\/span>zabbix\/zabbix_agentd.pid\nLogFile=<span class=\"hljs-regexp\">\/var\/<\/span>log\/zabbix\/zabbix_agentd.log\nLogFileSize=<span class=\"hljs-number\">0<\/span>\nServer=<span class=\"hljs-number\">192.168<\/span><span class=\"hljs-number\">.1<\/span><span class=\"hljs-number\">.5<\/span>\nServerActive=<span class=\"hljs-number\">192.168<\/span><span class=\"hljs-number\">.1<\/span><span class=\"hljs-number\">.5<\/span>\nHostname=web01\nHostMetadata=Linux\nTimeout=<span class=\"hljs-number\">5<\/span>\nInclude=<span class=\"hljs-regexp\">\/etc\/<\/span>zabbix\/zabbix_agentd.d<span class=\"hljs-comment\">\/*.conf<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If a proxy monitors the host, put the proxy&#039;s address in <code>Server<\/code> and <code>ServerActive<\/code>, not the server&#039;s. You can list more than one entry, separated by commas, for example <code>Server=192.168.1.5,192.168.1.6<\/code>. Packaged installs set <code>LogFileSize=0<\/code> because logrotate handles rotation. Set it to <code>10<\/code> or similar if logrotate is not set up for the agent log.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the firewall for passive checks, then restart the agent:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># firewalld (RHEL, Rocky, Alma)<\/span>\nsudo firewall-cmd --permanent --add-port=<span class=\"hljs-number\">10050<\/span>\/tcp\nsudo firewall-cmd --reload\n\n<span class=\"hljs-comment\"># ufw (Ubuntu)<\/span>\nsudo ufw allow from <span class=\"hljs-number\">192.168<\/span><span class=\"hljs-number\">.1<\/span><span class=\"hljs-number\">.5<\/span> to any port <span class=\"hljs-number\">10050<\/span> proto tcp\n\nsudo systemctl restart zabbix-agent<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Active checks only need outbound access from the agent to port 10051 on the server or proxy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing the configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check the agent locally first, then from the server. On recent versions, <code>-T<\/code> validates the config file without starting the agent. <code>-t<\/code> tests a single item key, and <code>-p<\/code> prints every built-in key with its current value.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># On the agent host<\/span>\nsudo zabbix_agentd -T -c \/etc\/zabbix\/zabbix_agentd.conf   <span class=\"hljs-comment\"># validate syntax<\/span>\nzabbix_agentd -t agent.ping\nzabbix_agentd -t system.cpu.load&#91;all,avg1]\n\n<span class=\"hljs-comment\"># Expected output<\/span>\nagent.ping                                    &#91;u|<span class=\"hljs-number\">1<\/span>]\nsystem.cpu.load&#91;all,avg1]                     &#91;d|<span class=\"hljs-number\">0.120000<\/span>]\n\n<span class=\"hljs-comment\"># On the Zabbix server or proxy (package zabbix-get)<\/span>\nzabbix_get -s <span class=\"hljs-number\">192.168<\/span><span class=\"hljs-number\">.1<\/span><span class=\"hljs-number\">.20<\/span> -p <span class=\"hljs-number\">10050<\/span> -k agent.ping\n<span class=\"hljs-number\">1<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If <code>zabbix_get<\/code> returns <code>1<\/code>, passive checks work end to end. For agent 2, use <code>zabbix_agent2 -t &lt;key&gt;<\/code> in the same way. Then confirm active checks in the agent log with <code>sudo tail -f \/var\/log\/zabbix\/zabbix_agentd.log<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding custom metrics with UserParameter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Put custom checks in their own files under the <code>Include<\/code> directory rather than editing the main file. Package upgrades then won&#039;t overwrite them, and tools such as Ansible can manage them easily.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># \/etc\/zabbix\/zabbix_agentd.d\/custom.conf<\/span>\n\n<span class=\"hljs-comment\"># Simple key: number of nginx processes<\/span>\nUserParameter=custom.nginx.procs,pgrep -c nginx\n\n<span class=\"hljs-comment\"># Flexible key: count processes for any name, e.g. custom.proc.count&#91;sshd]<\/span>\nUserParameter=custom.proc.count&#91;*],pgrep -c <span class=\"hljs-string\">\"$1\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">sudo<\/span> <span class=\"hljs-selector-tag\">systemctl<\/span> <span class=\"hljs-selector-tag\">restart<\/span> <span class=\"hljs-selector-tag\">zabbix-agent<\/span>\n<span class=\"hljs-selector-tag\">zabbix_agentd<\/span> <span class=\"hljs-selector-tag\">-t<\/span> <span class=\"hljs-selector-tag\">custom<\/span><span class=\"hljs-selector-class\">.proc<\/span><span class=\"hljs-selector-class\">.count<\/span><span class=\"hljs-selector-attr\">&#91;sshd]<\/span>\n# <span class=\"hljs-selector-tag\">custom<\/span><span class=\"hljs-selector-class\">.proc<\/span><span class=\"hljs-selector-class\">.count<\/span><span class=\"hljs-selector-attr\">&#91;sshd]<\/span>                     <span class=\"hljs-selector-attr\">&#91;t|2]<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li>Commands run as the <code>zabbix<\/code> user, so that user must be able to run them and read any files they use.<\/li>\n\n\n<li>In flexible (<code>[*]<\/code>) keys, <code>$1<\/code> to <code>$9<\/code> are the key arguments. Write <code>$$<\/code> when you need a literal <code>$<\/code> in the command, for example in awk.<\/li>\n\n\n<li>Keep <code>UnsafeUserParameters=0<\/code> unless you really need special characters in arguments. Enabling it lets callers pass shell metacharacters into your commands.<\/li>\n\n\n<li>Keep each command under the <code>Timeout<\/code> value. For slow commands, cache the result with a cron job and read the file with <code>vfs.file.contents<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Securing the agent<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Restrict remote commands.<\/strong> <code>system.run[*]<\/code> is denied by default. If you need it, allow only specific commands. Rules are checked in the order they appear and the first match wins, so put the specific <code>AllowKey<\/code> before the broad <code>DenyKey<\/code>. <code>EnableRemoteCommands<\/code> is deprecated, as the comment above says. Use <code>AllowKey<\/code> and <code>DenyKey<\/code> instead.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">AllowKey=system.run&#91;<span class=\"hljs-regexp\">\/usr\/<\/span>bin\/uptime]\nDenyKey=system.run&#91;*]\nLogRemoteCommands=<span class=\"hljs-number\">1<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Encrypt traffic with a pre-shared key (PSK).<\/strong> By default, agent traffic is plain text. Generate a key on the agent host:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">openssl rand -hex 32 | sudo tee \/etc\/zabbix\/zabbix_agentd.psk\nsudo chown zabbix:zabbix \/etc\/zabbix\/zabbix_agentd.psk\nsudo chmod 600 \/etc\/zabbix\/zabbix_agentd.psk<\/code><\/span><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">TLSConnect=psk\nTLSAccept=psk\nTLSPSKIdentity=PSK-web01\nTLSPSKFile=<span class=\"hljs-regexp\">\/etc\/<\/span>zabbix\/zabbix_agentd.psk<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Restart the agent. Then, in the frontend, open the host, go to the <strong>Encryption<\/strong> tab, select PSK for connections to and from the host, and enter the same identity and key. Until both sides match, checks fail with TLS errors. To test with <code>zabbix_get<\/code>, add <code>--tls-connect psk --tls-psk-identity PSK-web01 --tls-psk-file &lt;file&gt;<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Leave <code>AllowRoot=0<\/code> so the agent runs as the unprivileged <code>zabbix<\/code> user. On systemd hosts, the service unit decides the user, as the comment in the file says.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Zabbix agent vs agent 2 configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Agent 2 is written in Go and shares most core parameters with agent 1: <code>Server<\/code>, <code>ServerActive<\/code>, <code>Hostname<\/code>, <code>HostMetadata<\/code>, <code>Timeout<\/code>, <code>Include<\/code>, <code>UserParameter<\/code>, <code>AllowKey<\/code>\/<code>DenyKey<\/code> and the TLS options. The main differences:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Agent 2 extends itself through plugins configured with <code>Plugins.&lt;Name&gt;.*<\/code> parameters, for example for PostgreSQL, MySQL, Redis or Docker. It has no <code>LoadModule<\/code>.<\/li>\n\n\n<li>Agent 2 doesn&#039;t pre-fork worker processes the way <code>StartAgents<\/code> does in agent 1.<\/li>\n\n\n<li>Agent 2 has a <code>ControlSocket<\/code> for runtime commands, and its include directory is <code>\/etc\/zabbix\/zabbix_agent2.d\/<\/code>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">When you move from agent 1 to agent 2, don&#039;t copy the old file across unchanged. Start from the packaged <code>zabbix_agent2.conf<\/code> and transfer your <code>Server<\/code>, <code>ServerActive<\/code>, <code>Hostname<\/code>, metadata, TLS settings and user parameters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>zabbix_get<\/code> returns <code>Connection refused<\/code><\/td><td>Agent is not running, is listening on another IP or port, or a firewall blocks 10050<\/td><td>Check <code>systemctl status<\/code>, <code>ss -tlnp | grep 10050<\/code>, <code>ListenIP<\/code> and firewall rules<\/td><\/tr><tr><td>Agent log shows <code>connection from &quot;x&quot; rejected, allowed hosts: &quot;127.0.0.1&quot;<\/code><\/td><td>The server or proxy IP is missing from <code>Server<\/code><\/td><td>Add the real source IP of the server or proxy to <code>Server<\/code>, then restart<\/td><\/tr><tr><td>Log shows <code>no active checks on server ... host [web01] not found<\/code><\/td><td><code>Hostname<\/code> does not match the frontend host name<\/td><td>Make them identical, including case<\/td><\/tr><tr><td>Item shows <code>Timeout while executing a shell script<\/code><\/td><td>A UserParameter or check runs longer than <code>Timeout<\/code><\/td><td>Speed up the command or raise <code>Timeout<\/code> (maximum 30)<\/td><\/tr><tr><td>Host interface shows a TLS or PSK error<\/td><td>PSK identity or key differs between agent and frontend, or the key file can&#039;t be read<\/td><td>Compare both values and check that the file is owned by <code>zabbix<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> For more detail while troubleshooting, set <code>DebugLevel=4<\/code> temporarily, or run <code>zabbix_agentd -R log_level_increase<\/code> on a running agent 1. Set it back afterwards, because level 4 fills the log quickly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Where is the Zabbix agent configuration file on Linux?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With official packages, agent 1 uses <code>\/etc\/zabbix\/zabbix_agentd.conf<\/code> and agent 2 uses <code>\/etc\/zabbix\/zabbix_agent2.conf<\/code>. Extra files are loaded from <code>\/etc\/zabbix\/zabbix_agentd.d\/<\/code> or <code>\/etc\/zabbix\/zabbix_agent2.d\/<\/code> through the <code>Include<\/code> parameter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between Server and ServerActive in zabbix_agentd.conf?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Server<\/code> lists the hosts allowed to connect to the agent for passive checks on port 10050. <code>ServerActive<\/code> is the address the agent connects to on port 10051 to fetch and send active checks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need to restart the Zabbix agent after changing the configuration?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. The agent reads its configuration only at startup, so restart the service after any change. On recent versions you can reload user parameters with <code>zabbix_agentd -R userparameter_reload<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does my host show active checks as unavailable?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Usually <code>Hostname<\/code> in the agent config doesn&#039;t exactly match the host name in the frontend, or <code>ServerActive<\/code> points to the wrong address. It can also be a firewall blocking outbound traffic to port 10051.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I test a Zabbix agent from the server?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Install the <code>zabbix-get<\/code> package on the server or proxy and run <code>zabbix_get -s &lt;agent-ip&gt; -k agent.ping<\/code>. A result of <code>1<\/code> means the agent accepts passive checks from that server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/zabbix-tutorials-example-of-zabbix_agentd-conf\/\">Zabbix Tutorials: Example of zabbix_agentd.conf<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/zabbix-tutorials-example-of-zabbix_agent2-win-conf\/\">Zabbix Tutorials: Example of zabbix_agent2.win.conf<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/ansible-playbook-for-zabbix-agent-deployment\/\">Ansible Playbook for Zabbix Agent Deployment<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/monitoring-observability\/zabbix\/\">More Zabbix tutorials<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Zabbix agent configuration file controls which Zabbix servers may query the agent, where it sends active checks, how it identifies itself, and which custom checks and&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4897],"tags":[26273],"class_list":["post-28861","post","type-post","status-publish","format-standard","hentry","category-zabbix","tag-zabbix-agent"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/28861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=28861"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/28861\/revisions"}],"predecessor-version":[{"id":80718,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/28861\/revisions\/80718"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=28861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=28861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=28861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}