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

228 lines
14 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 server?</h2>
<p>Zabbix server is the central process of Zabbix software.</p>
<p>The server performs the polling and trapping of data, it calculates triggers, sends notifications to users. It is the central component to which Zabbix agents and proxies report data on availability and integrity of systems. The server can itself remotely check networked services (such as web servers and mail servers) using simple service checks.</p>
<h2>Zabbix server images</h2>
<p>Images are updated when new releases are published.</p>
<p>The image uses PostgreSQL database. It uses the next procedure to start:</p>
<ul>
<li>Checking database availability</li>
<li>Checking of having <code>POSTGRES_DB</code> database. Creating <code>POSTGRES_DB</code> database name if it does not exist</li>
<li>Checking of having <code>dbversion</code> table. Creating Zabbix server database schema and upload initial data sample if no <code>dbversion</code> table</li>
</ul>
<h2>How to use this image</h2>
<h3>Start <code>zabbix-server-pgsql</code></h3>
<p>Start a Zabbix server container as follows:</p>
<pre><code>podman run \
--name some-zabbix-server-pgsql \
-e DB_SERVER_HOST="some-postgres-server" \
-e POSTGRES_USER="some-user" \
-e POSTGRES_PASSWORD="some-password" \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-server-pgsql-74:tag
</code></pre>
<p>Where <code>some-zabbix-server-pgsql</code> is the name you want to assign to your container, <code>some-postgres-server</code> is IP or DNS name of PostgreSQL server, <code>some-user</code> is user to connect to Zabbix database on PostgreSQL server, <code>some-password</code> is the password to connect to PostgreSQL server and <code>tag</code> is the tag specifying the version you want.</p>
<blockquote>
<p><strong>Note:</strong>
Zabbix server has possibility to execute <code>fping</code> utility to perform ICMP checks. When containers are running in rootless mode or with specific restrictions environment, you may face errors related to fping:
<code>fping: Operation not permitted</code>
or
lost all packets to all resources
in this case add <code>--cap-add=net_raw</code> to <code>podman run</code> commands.
Additionally fping executing in non-root environments can require sysctl modification:
<code>net.ipv4.ping_group_range=0 1995</code>
where 1995 is <code>zabbix</code> GID.</p>
</blockquote>
<h3>Container shell access and viewing Zabbix server 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-server-pgsql</code> container:</p>
<pre><code>$ podman exec -ti some-zabbix-server-pgsql /bin/bash
</code></pre>
<p>The Zabbix server log is available through Podman's container log:</p>
<pre><code>$ podman logs some-zabbix-server-pgsql
</code></pre>
<h3>Environment Variables</h3>
<p>When you start the <code>zabbix-server-pgsql</code> image, you can adjust the configuration of the Zabbix server by passing one or more environment variables on the <code>podman run</code> command line.</p>
<h4><code>DB_SERVER_HOST</code></h4>
<p>This variable is IP or DNS name of PostgreSQL server. By default, value is 'postgres-server'</p>
<h4><code>DB_SERVER_PORT</code></h4>
<p>This variable is port of PostgreSQL server. By default, value is '5432'.</p>
<h4><code>POSTGRES_USER</code>, <code>POSTGRES_PASSWORD</code>, <code>POSTGRES_USER_FILE</code>, <code>POSTGRES_PASSWORD_FILE</code></h4>
<p>These variables are used by Zabbix server to connect to Zabbix database. With the <code>_FILE</code> variables you can instead provide the path to a file which contains the user / the password instead. When secrets are not managed by an orchestrator, you also have to mount the files. Those are exclusive so you can just provide one type - either <code>POSTGRES_USER</code> or <code>POSTGRES_USER_FILE</code>!</p>
<pre><code>podman run \
--name some-zabbix-server-pgsql \
-e DB_SERVER_HOST=&quot;some-postgres-server&quot; \
-v ./.POSTGRES_USER:/run/secrets/POSTGRES_USER \
-e POSTGRES_USER_FILE=/run/secrets/POSTGRES_USER \
-v ./.POSTGRES_PASSWORD:/run/secrets/POSTGRES_PASSWORD \
-e POSTGRES_PASSWORD_FILE=/var/run/secrets/POSTGRES_PASSWORD \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-server-pgsql-74:tag
</code></pre>
<p>Podman secrets can be used to avoid exposing credentials in the command line:</p>
<pre><code>printf &quot;zabbix&quot; | podman secret create POSTGRES_USER -
printf &quot;zabbix&quot; | podman secret create POSTGRES_PASSWORD -
podman run \
--name some-zabbix-server-pgsql \
-e DB_SERVER_HOST=&quot;some-postgres-server&quot; \
-e POSTGRES_USER_FILE=/run/secrets/POSTGRES_USER \
-e POSTGRES_PASSWORD_FILE=/run/secrets/POSTGRES_PASSWORD \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-server-pgsql-74:tag
</code></pre>
<p>By default, values for <code>POSTGRES_USER</code> and <code>POSTGRES_PASSWORD</code> are <code>zabbix</code>, <code>zabbix</code>.</p>
<h4><code>POSTGRES_DB</code></h4>
<p>The variable is Zabbix database name. By default, value is <code>zabbix</code>.</p>
<h4><code>POSTGRES_USE_IMPLICIT_SEARCH_PATH</code></h4>
<p>In some setups, for example including <a href="https://www.pgbouncer.org">PgBouncer</a>, setting the <code>search_path</code> via connection parameters fails. If this variable is set to <code>"true"</code>, the image skips setting the <code>search_path</code> and trusts that the <code>search_path</code> of the Zabbix user is setup correctly in PostgreSQL database.</p>
<h4><code>ZBX_LOADMODULE</code></h4>
<p>The variable is list of comma separated loadable Zabbix modules. It works with volume <code>/var/lib/zabbix/modules</code>. The syntax of the variable is <code>dummy1.so,dummy2.so</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_server.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>4</code>.</p>
<h4>Other variables</h4>
<p>Additionally the image allows to specify many other environment variables listed below:</p>
<pre><code>ZBX_ALLOWUNSUPPORTEDDBVERSIONS=0 # Available since 6.0.0
ZBX_DBTLSCONNECT= # Available since 5.0.0
ZBX_DBTLSCAFILE= # Available since 5.0.0
ZBX_DBTLSCERTFILE= # Available since 5.0.0
ZBX_DBTLSKEYFILE= # Available since 5.0.0
ZBX_DBTLSCIPHER= # Available since 5.0.0
ZBX_DBTLSCIPHER13= # Available since 5.0.0
ZBX_VAULT=HashiCorp # Allowed values: HashiCorp, CyberArk. Required when Vault is used. Available since 6.2.0
ZBX_VAULTDBPATH= # Available since 5.2.0
ZBX_VAULTPREFIX= # Available since 7.0.0
ZBX_VAULTURL=https://127.0.0.1:8200 # Available since 5.2.0
VAULT_TOKEN= # Available since 5.2.0
ZBX_VAULTTLSCERTFILE= # Available since 6.2.0
ZBX_VAULTTLSKEYFILE= # Available since 6.2.0
ZBX_LISTENIP=
ZBX_LISTENPORT=10051
ZBX_LISTENBACKLOG=
ZBX_STARTREPORTWRITERS=0 # Available since 5.4.0
ZBX_WEBSERVICEURL=http://zabbix-web-service:10053/report # Available since 5.4.0
ZBX_SERVICEMANAGERSYNCFREQUENCY=60 # Available since 6.0.0
ZBX_HISTORYSTORAGEURL= # Available since 3.4.0
ZBX_HISTORYSTORAGETYPES=uint,dbl,str,log,text # Available since 3.4.0
ZBX_ENABLEGLOBALSCRIPTS=0 # Available since 7.0.0
ZBX_ALLOWSOFTWAREUPDATECHECK=1 # Available since 7.0.0
ZBX_MAXCONCURRENTCHECKSPERPOLLER=1000 # Available since 7.0.0
ZBX_STARTAGENTPOLLERS=1 # Available since 7.0.0
ZBX_STARTHTTPAGENTPOLLERS=1 # Available since 7.0.0
ZBX_STARTPOLLERS=5
ZBX_STARTIPMIPOLLERS=0
ZBX_STARTCONNECTORS=0 # Available since 6.4.0
ZBX_STARTPREPROCESSORS=16 # Available since 3.4.0
ZBX_STARTPOLLERSUNREACHABLE=1
ZBX_STARTTRAPPERS=5
ZBX_STARTPINGERS=1
ZBX_STARTDISCOVERERS=5
ZBX_STARTHISTORYPOLLERS=5 # Available since 5.4.0
ZBX_STARTHTTPPOLLERS=1
ZBX_STARTODBCPOLLERS=1 # Available since 6.0.0
ZBX_STARTTIMERS=1
ZBX_STARTESCALATORS=1
ZBX_STARTALERTERS=3 # Available since 3.4.0
ZBX_JAVAGATEWAY=zabbix-java-gateway
ZBX_JAVAGATEWAYPORT=10052
ZBX_STARTJAVAPOLLERS=5
ZBX_STARTLLDPROCESSORS=2 # Available since 4.2.0
ZBX_STATSALLOWEDIP= # Available since 4.0.5
ZBX_STARTVMWARECOLLECTORS=0
ZBX_VMWAREFREQUENCY=60
ZBX_VMWAREPERFFREQUENCY=60
ZBX_VMWARECACHESIZE=8M
ZBX_VMWARETIMEOUT=10
ZBX_ENABLE_SNMP_TRAPS=false
ZBX_SOURCEIP=
ZBX_SMSDEVICES=
ZBX_HOUSEKEEPINGFREQUENCY=1
ZBX_MAXHOUSEKEEPERDELETE=5000
ZBX_PROBLEMHOUSEKEEPINGFREQUENCY=60 # Available since 6.0.0
ZBX_CACHESIZE=32M
ZBX_CACHEUPDATEFREQUENCY=10
ZBX_STARTDBSYNCERS=4
ZBX_EXPORTFILESIZE=1G # Available since 4.0.0
ZBX_EXPORTTYPE= # Available since 5.0.10 and 5.2.6
ZBX_AUTOHANODENAME=fqdn # Allowed values: fqdn, hostname. Available since 6.0.0
ZBX_HANODENAME= # Available since 6.0.0
ZBX_AUTONODEADDRESS=fqdn # Allowed values: fqdn, hostname. Available since 6.0.0
ZBX_NODEADDRESSPORT=10051 # Allowed to use with ZBX_AUTONODEADDRESS variable only. Available since 6.0.0
ZBX_NODEADDRESS=localhost # Available since 6.0.0
ZBX_HISTORYCACHESIZE=16M
ZBX_HISTORYINDEXCACHESIZE=4M
ZBX_HISTORYSTORAGEDATEINDEX=0 # Available since 4.0.0
ZBX_TRENDCACHESIZE=4M
ZBX_TRENDFUNCTIONCACHESIZE=4M
ZBX_VALUECACHESIZE=8M
ZBX_TRAPPERTIMEOUT=300
ZBX_UNREACHABLEPERIOD=45
ZBX_UNAVAILABLEDELAY=60
ZBX_UNREACHABLEDELAY=15
ZBX_LOGSLOWQUERIES=3000
ZBX_STARTPROXYPOLLERS=1
ZBX_PROXYCONFIGFREQUENCY=10
ZBX_PROXYDATAFREQUENCY=1
ZBX_TLSLISTEN= # Available since 7.4.0
ZBX_TLSCAFILE=
ZBX_TLSCA=
ZBX_TLSCRLFILE=
ZBX_TLSCRL=
ZBX_TLSCERTFILE=
ZBX_TLSCERT=
ZBX_TLSKEYFILE=
ZBX_TLSKEY=
ZBX_TLSCIPHERALL= # Available since 4.4.7
ZBX_TLSCIPHERALL13= # Available since 4.4.7
ZBX_TLSCIPHERCERT= # Available since 4.4.7
ZBX_TLSCIPHERCERT13= # Available since 4.4.7
ZBX_TLSCIPHERPSK= # Available since 4.4.7
ZBX_TLSCIPHERPSK13= # Available since 4.4.7
ZBX_TLS_FRONTENDACCEPT= # Available since 7.4.0
ZBX_FRONTENDALLOWEDIP= # Available since 7.4.0
ZBX_TLSFRONTENDCERTISSUER= # Available since 7.4.0
ZBX_TLSFRONTENDCERTSUBJECT= # Available since 7.4.0
ZBX_WEBDRIVERURL= # Available since 7.0.0
ZBX_STARTBROWSERPOLLERS=1 # Available since 7.0.0
ZBX_STARTSNMPPOLLERS=1 # Available since 7.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_server.conf</code>. For example, <code>ZBX_LOGSLOWQUERIES</code> = <code>LogSlowQueries</code>.</p>
<p>Please use official documentation for <a href="https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_server"><code>zabbix_server.conf</code></a> to get more information about the variables.</p>
<h3>Allowed volumes for the Zabbix server container</h3>
<h4><code>/usr/lib/zabbix/alertscripts</code></h4>
<p>The volume is used for custom alert scripts. It is <code>AlertScriptsPath</code> parameter in <code>zabbix_server.conf</code>.</p>
<h4><code>/usr/lib/zabbix/externalscripts</code></h4>
<p>The volume is used by External checks (type of items). It is <code>ExternalScripts</code> parameter in <code>zabbix_server.conf</code>.</p>
<h4><code>/var/lib/zabbix/modules</code></h4>
<p>The volume allows load additional modules and extend Zabbix server using <code>LoadModule</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> and <code>ZBX_TLSKEYFILE</code> variables. Additionally it is possible to use environment variables <code>ZBX_TLSCA</code>, <code>ZBX_TLSCRL</code>, <code>ZBX_TLSCERT</code> and <code>ZBX_TLSKEY</code> with plaintext values.</p>
<h4><code>/var/lib/zabbix/ssh_keys</code></h4>
<p>The volume is used as location of public and private keys for SSH checks and actions. It is <code>SSHKeyLocation</code> parameter in <code>zabbix_server.conf</code>.</p>
<h4><code>/var/lib/zabbix/ssl/certs</code></h4>
<p>The volume is used as location of SSL client certificate files for client authentication. It is <code>SSLCertLocation</code> parameter in <code>zabbix_server.conf</code>.</p>
<h4><code>/var/lib/zabbix/ssl/keys</code></h4>
<p>The volume is used as location of SSL private key files for client authentication. It is <code>SSLKeyLocation</code> parameter in <code>zabbix_server.conf</code>.</p>
<h4><code>/var/lib/zabbix/ssl/ssl_ca</code></h4>
<p>The volume is used as location of certificate authority (CA) files for SSL server certificate verification. It is <code>SSLCALocation</code> parameter in <code>zabbix_server.conf</code>.</p>
<h4><code>/var/lib/zabbix/snmptraps</code></h4>
<p>The volume is used as location of <code>snmptraps.log</code> file. It could be shared by <code>zabbix-snmptraps</code> container and inherited using <code>volumes_from</code> Podman option while creating new instance of Zabbix server.
SNMP traps processing feature could be enabled using shared volume and switched <code>ZBX_ENABLE_SNMP_TRAPS</code> environment variable to <code>true</code>.</p>
<h4><code>/var/lib/zabbix/mibs</code></h4>
<p>The volume allows to add new MIB files. It does not support subdirectories, all MIBs must be placed in <code>/var/lib/zabbix/mibs</code>.</p>
<h4><code>/var/lib/zabbix/export</code></h4>
<p>Directory for real-time export of events, history and trends in newline-delimited JSON format. Could be enabled using <code>ZBX_EXPORTFILESIZE</code> environment variable.</p>