zabbix/Dockerfiles/agent2/rhel/README.html
2026-07-11 22:22:05 +09:00

143 lines
9 KiB
HTML

<h2>What is Zabbix?</h2>
<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 <a href="https://zabbix.com">zabbix.com</a></p>
<h2>What is Zabbix agent 2?</h2>
<p>Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).</p>
<h2>Zabbix agent 2 images</h2>
<p>Images are updated when new releases are published.</p>
<h2>How to use this image</h2>
<h3>Start <code>zabbix-agent2</code></h3>
<p>Start a Zabbix agent 2 container as follows:</p>
<pre><code>podman run \
--name some-zabbix-agent \
-e ZBX_HOSTNAME="some-hostname" \
-e ZBX_SERVER_HOST="some-zabbix-server" \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:tag
</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>
<h3>Connects from Zabbix server or Zabbix proxy in other containers (Passive checks)</h3>
<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>
<pre><code>$ podman run \
--name some-zabbix-server \
--link some-zabbix-agent:zabbix-agent2 \
--init \
-d zabbix/zabbix-server:latest
</code></pre>
<h3>Connect to Zabbix server or Zabbix proxy containers (Active checks)</h3>
<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 containers:</p>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:latest
</code></pre>
<h3>Container shell access and viewing Zabbix agent 2 logs</h3>
<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>
<pre><code>$ podman exec -ti some-zabbix-agent /bin/bash
</code></pre>
<p>The Zabbix agent 2 log is available through Podman's container log:</p>
<pre><code>$ podman logs some-zabbix-agent
</code></pre>
<h3>Privileged mode</h3>
<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>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
--privileged \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:latest
</code></pre>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
-v /dev/sdc:/dev/sdc \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:latest
</code></pre>
<h3>Environment Variables</h3>
<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>
<h4><code>ZBX_HOSTNAME</code></h4>
<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>
<h4><code>ZBX_SERVER_HOST</code></h4>
<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>
<h4><code>ZBX_PASSIVE_ALLOW</code></h4>
<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>
<h4><code>ZBX_PASSIVESERVERS</code></h4>
<p>The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent 2 container.</p>
<h4><code>ZBX_ACTIVE_ALLOW</code></h4>
<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>
<h4><code>ZBX_ACTIVESERVERS</code></h4>
<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>
<h4><code>ZBX_DEBUGLEVEL</code></h4>
<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>
</ul>
<h4><code>ZBX_TIMEOUT</code></h4>
<p>The variable is used to specify timeout for processing checks. By default, value is <code>3</code>.</p>
<h4>Other variables</h4>
<p>Additionally the image allows to specify many other environment variables listed below:</p>
<pre><code>ZBX_ENABLEPERSISTENTBUFFER=false # Available since 5.0.0
ZBX_PERSISTENTBUFFERPERIOD=1h # Available since 5.0.0
ZBX_ENABLESTATUSPORT=
ZBX_SOURCEIP=
ZBX_HEARTBEAT_FREQUENCY=60 # Available since 6.2.0
ZBX_ENABLEREMOTECOMMANDS=0 # Deprecated since 5.0.0
ZBX_LOGREMOTECOMMANDS=0
ZBX_FORCEACTIVECHECKSONSTART=0 # Available since 6.0.2
ZBX_HOSTINTERFACE= # Available since 4.4.0
ZBX_HOSTINTERFACEITEM= # Available since 4.4.0
ZBX_HOSTNAMEITEM=system.hostname
ZBX_METADATA=
ZBX_METADATAITEM=
ZBX_REFRESHACTIVECHECKS=5
ZBX_BUFFERSEND=5
ZBX_BUFFERSIZE=1000
ZBX_MAXLINESPERSECOND=20
ZBX_EVENTLOGMAXLINESPERSECOND=20 # Windows only
ZBX_LISTENIP=
ZBX_LISTENPORT=10050
ZBX_PLUGINTIMEOUT=
ZBX_UNSAFEUSERPARAMETERS=0
ZBX_TLSCONNECT=unencrypted
ZBX_TLSACCEPT=unencrypted
ZBX_TLSCAFILE=
ZBX_TLSCA=
ZBX_TLSCRLFILE=
ZBX_TLSCRL=
ZBX_TLSSERVERCERTISSUER=
ZBX_TLSSERVERCERTSUBJECT=
ZBX_TLSCERTFILE=
ZBX_TLSCERT=
ZBX_TLSKEYFILE=
ZBX_TLSKEY=
ZBX_TLSPSKIDENTITY=
ZBX_TLSPSKFILE=
ZBX_TLSPSK=
ZBX_TLSCIPHERALL=
ZBX_TLSCIPHERALL13=
ZBX_TLSCIPHERCERT=
ZBX_TLSCIPHERCERT13=
ZBX_TLSCIPHERPSK=
ZBX_TLSCIPHERPSK13=
ZBX_DENYKEY=system.run[*] # Available since 5.0.0
ZBX_ALLOWKEY= # Available since 5.0.0
</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 <a href="https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agent2"><code>zabbix_agent2.conf</code></a> to get more information about the variables.</p>
<h3>Allowed volumes for the Zabbix agent 2 container</h3>
<h4><code>/etc/zabbix/zabbix_agentd.d</code></h4>
<p>The volume allows include <code>*.conf</code> files and extend Zabbix agent 2 using <code>UserParameter</code> feature.</p>
<h4><code>/var/lib/zabbix/enc</code></h4>
<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_TLSCERTFILE</code>, <code>ZBX_TLSKEYFILE</code> and <code>ZBX_TLSPSKFILE</code> variables. Additionally it is possible to use environment variables <code>ZBX_TLSCA</code>, <code>ZBX_TLSCRL</code>, <code>ZBX_TLSCERT</code>, <code>ZBX_TLSKEY</code> and <code>ZBX_TLSPSK</code> with plaintext values.</p>
<h4><code>/var/lib/zabbix/buffer</code></h4>
<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>