<p>Zabbix is an enterprise-class open source distributed monitoring solution.</p>
<p>Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.</p>
<p>For more information and related downloads for Zabbix components, please visit <ahref="https://hub.docker.com/u/zabbix/">https://hub.docker.com/u/zabbix/</a> and <ahref="https://zabbix.com">https://zabbix.com</a></p>
<h1id="what-is-zabbix-agent-2-">What is Zabbix agent 2?</h1>
<p>Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).</p>
</code></pre><p>Where <code>some-zabbix-agent2</code> is the name you want to assign to your container, <code>some-hostname</code> is the hostname, it is Hostname parameter in Zabbix agent 2 configuration file, <code>some-zabbix-server</code> is IP or DNS name of Zabbix server or proxy and <code>tag</code> is the tag specifying the version you want.</p>
<h2id="connects-from-zabbix-server-or-zabbix-proxy-in-other-containers-passive-checks-">Connects from Zabbix server or Zabbix proxy in other containers (Passive checks)</h2>
<p>This image exposes the standard Zabbix agent 2 port (<code>10050</code>) to perform passive checks, so container linking makes Zabbix agent 2 instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent 2 container:</p>
<h2id="connect-to-zabbix-server-or-zabbix-proxy-containers-active-checks-">Connect to Zabbix server or Zabbix proxy containers (Active checks)</h2>
<p>This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent 2 instance. Start your application container like this in order to link Zabbix agent 2 to Zabbix server or Zabbix proxy containterns:</p>
<h2id="container-shell-access-and-viewing-zabbix-agent-2-logs">Container shell access and viewing Zabbix agent 2 logs</h2>
<p>The <code>podman exec</code> command allows you to run commands inside a Podman container. The following command line will give you a bash shell inside your <code>zabbix-agent2</code> container:</p>
<p>By default, Podman containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent 2 is designed to monitor system resources, to do that Zabbix agent 2 container must be privileged or you may mount some system-wide volumes. For example:</p>
<p>When you start the <code>zabbix-agent2</code> image, you can adjust the configuration of the Zabbix agent 2 by passing one or more environment variables on the <code>podman run</code> command line.</p>
<p>This variable is unique, case sensitive hostname. By default, value is <code>hostname</code> of the container. It is <code>Hostname</code> parameter in <code>zabbix_agent2.conf</code>.</p>
<p>This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is <code>zabbix-server</code>. It is <code>Server</code> parameter in <code>zabbix_agent2.conf</code>. It is allowed to specify Zabbix server or Zabbix proxy port number using <code>ZBX_SERVER_PORT</code> variable. It make sense in case of non-default port for active checks.</p>
<p>This variable is boolean (<code>true</code> or <code>false</code>) and enables or disables feature of passive checks. By default, value is <code>true</code>.</p>
<p>This variable is boolean (<code>true</code> or <code>false</code>) and enables or disables feature of active checks. By default, value is <code>true</code>.</p>
<p>The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent 2 container. You may specify port of Zabbix server or Zabbix proxy in such syntax: <code>zabbix-server:10061,zabbix-proxy:10072</code>.</p>
<p>The variable is used to specify debug level. By default, value is <code>3</code>. It is <code>DebugLevel</code> parameter in <code>zabbix_agent2.conf</code>. Allowed values are listed below:</p>
<ul>
<li><code>0</code> - basic information about starting and stopping of Zabbix processes;</li>
<li><code>1</code> - critical information</li>
<li><code>2</code> - error information</li>
<li><code>3</code> - warnings</li>
<li><code>4</code> - for debugging (produces lots of information)</li>
<li><code>5</code> - extended debugging (produces even more information)</li>
<p>The variable is used to specify timeout for processing checks. By default, value is <code>3</code>.</p>
<h3id="other-variables">Other variables</h3>
<p>Additionally the image allows to specify many other environment variables listed below:</p>
<pre><code><spanclass="hljs-attr">ZBX_ENABLEPERSISTENTBUFFER</span>=<spanclass="hljs-literal">false</span> # Available since <spanclass="hljs-number">5.0</span>.<spanclass="hljs-number">0</span>
<spanclass="hljs-attr">ZBX_PERSISTENTBUFFERPERIOD</span>=<spanclass="hljs-number">1</span>h # Available since <spanclass="hljs-number">5.0</span>.<spanclass="hljs-number">0</span>
<spanclass="hljs-attr">ZBX_HEARTBEAT_FREQUENCY</span>=<spanclass="hljs-number">60</span> # Available since <spanclass="hljs-number">6.2</span>.<spanclass="hljs-number">0</span>
<spanclass="hljs-attr">ZBX_ENABLEREMOTECOMMANDS</span>=<spanclass="hljs-number">0</span> # Deprecated since <spanclass="hljs-number">5.0</span>.<spanclass="hljs-number">0</span>
<spanclass="hljs-attr">ZBX_DENYKEY</span>=system.run[*] # Available since <spanclass="hljs-number">5.0</span>.<spanclass="hljs-number">0</span>
<spanclass="hljs-attr">ZBX_ALLOWKEY</span>= # Available since <spanclass="hljs-number">5.0</span>.<spanclass="hljs-number">0</span>
</code></pre><p>Default values of these variables are specified after equal sign.</p>
<p>The allowed variables are identical of parameters in official <code>zabbix_agent2.conf</code> configuration file. For example, <code>ZBX_REFRESHACTIVECHECKS</code> = <code>RefreshActiveChecks</code>.</p>
<p>Please use official documentation for <ahref="https://www.zabbix.com/documentation/6.0/manual/appendix/config/zabbix_agent2"><code>zabbix_agent2.conf</code></a> to get more information about the variables.</p>
<p>The volume is used to store TLS related files. These file names are specified using <code>ZBX_TLSCAFILE</code>, <code>ZBX_TLSCRLFILE</code>, <code>ZBX_TLSKEY_FILE</code> and <code>ZBX_TLSPSKFILE</code> variables.</p>
<p>The volume is used to store the file, where Zabbix Agent2 should keep SQLite database. To enable the feature specify <code>ZBX_ENABLEPERSISTENTBUFFER=true</code>. Available since 5.0.0.</p>
<p>Documentation for this image is stored in the <ahref="https://github.com/zabbix/zabbix-docker/tree/6.0/Dockerfiles/agent2"><code>agent2/</code> directory</a> of the <ahref="https://github.com/zabbix/zabbix-docker/"><code>zabbix/zabbix-docker</code> GitHub repo</a>. Be sure to familiarize yourself with the <ahref="https://github.com/zabbix/zabbix-docker/blob/6.0/README.md">repository's <code>README.md</code> file</a> before attempting a pull request.</p>
<p>If you have any problems with or questions about this image, please contact us through a <ahref="https://github.com/zabbix/zabbix-docker/issues">GitHub issue</a>.</p>
<h3id="known-issues">Known issues</h3>
<p>Currently it is not allowed to specify <code>ZBX_ALIAS</code> environment variable. Please use <code>/etc/zabbix/zabbix_agent.d</code> volume with additional configuration files with <code>Alias</code> options.</p>
<h2id="contributing">Contributing</h2>
<p>You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.</p>
<p>Before you start to code, we recommend discussing your plans through a <ahref="https://github.com/zabbix/zabbix-docker/issues">GitHub issue</a>, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.</p>