1 Red Hat Enterprise Linux
Overview
Official Zabbix 6.3 PRE-RELEASE packages for Red Hat Enterprise Linux and Oracle Linux are available on Zabbix website. Packages for Zabbix 6.4 will be available upon its release.
Packages are available with either MySQL/PostgreSQL database and Apache/Nginx web server support.
Zabbix agent packages and utilities Zabbix get and Zabbix sender are available on Zabbix Official Repository for RHEL 9, RHEL 8, RHEL 7, and RHEL 6.
Zabbix Official Repository provides fping, iksemel and libssh2 packages as well. These packages are located in the non-supported directory.
Notes on installation
See installation instructions per platform in the download page for:
- installing the repository
- installing server/agent/frontend
- creating initial database, importing initial data
- configuring database for Zabbix server
- configuring PHP for Zabbix frontend
- starting server/agent processes
- configuring Zabbix frontend
If you want to run Zabbix agent as root, see Running agent as root.
Zabbix web service process, which is used for scheduled report generation, requires Google Chrome browser. The browser is not included into packages and has to be installed manually.
Importazione dati con Timescale DB
Con TimescaleDB, oltre al comando import per PostgreSQL, eseguire anche:
# cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql | sudo -u zabbix psql zabbix
::: nota avviso TimescaleDB è supportato con il server Zabbix solo. :::
Configurazione di SELinux
Zabbix utilizza la comunicazione tra processi basata su socket. Sui sistemi in cui SELinux è abilitato, potrebbe essere necessario aggiungere regole SELinux per consentire a Zabbix di creare/utilizzare socket di dominio UNIX nella directory SocketDir. Attualmente i file socket sono utilizzati dal server (segnalatore, preelaborazione, IPMI) e dal proxy (IPMI). I file socket sono persistenti, nel senso che sono presenti mentre il processo è in esecuzione.
Avendo abilitato lo stato di SELinux in modalità di applicazione, è necessario eseguire il file seguenti comandi per abilitare la comunicazione tra il frontend Zabbix e server:
RHEL 7 e versioni successive:
# setsebool -P httpd_can_connect_zabbix attivo
Se il database è accessibile tramite rete (incluso 'localhost' nel caso di PostgreSQL), è necessario consentire anche al frontend Zabbix di connettersi al database:
# setsebool -P httpd_can_network_connect_db attivo
RHEL prima del 7:
# setsebool -P httpd_can_network_connect attivo
# setsebool -P zabbix_can_network attivo
Al termine della configurazione del frontend e di SELinux, riavvia Apache server web:
# riavvio del servizio httpd
In addition, Zabbix provides the zabbix-selinux-policy package as part of source RPM packages for RHEL 8 and RHEL 7. This package provides a basic default policy for SELinux and makes zabbix components work out-of-the-box by allowing Zabbix to create and use sockets and enabling httpd connection to PostgreSQL (used by frontend).
The source zabbix_policy.te file contains the following rules:
module zabbix_policy 1.2;
require {
type zabbix_t;
type zabbix_port_t;
type zabbix_var_run_t;
type postgresql_port_t;
type httpd_t;
class tcp_socket name_connect;
class sock_file { create unlink };
class unix_stream_socket connectto;
}
#============= zabbix_t ==============
allow zabbix_t self:unix_stream_socket connectto;
allow zabbix_t zabbix_port_t:tcp_socket name_connect;
allow zabbix_t zabbix_var_run_t:sock_file create;
allow zabbix_t zabbix_var_run_t:sock_file unlink;
allow httpd_t zabbix_port_t:tcp_socket name_connect;
#============= httpd_t ==============
allow httpd_t postgresql_port_t:tcp_socket name_connect;
This package has been created to prevent users from turning off SELinux because of the configuration complexity. It contains the default policy that is sufficient to speed up Zabbix deployment and configuration. For maximum security level, it is recommended to set custom SELinux settings.
Installazione proxy
Una volta aggiunto il repository richiesto, puoi installare il proxy Zabbix tramite il comando:
# dnf install zabbix-proxy-mysql zabbix-sql-script
Sostituisci 'mysql' nei comandi con 'pgsql' per usare PostgreSQL, oppure con 'sqlite3' per usare SQLite3 (solo proxy).
Il pacchetto "zabbix-sql-scripts" contiene schemi di database per tutti i sistemi di gestione di database supportati sia per il server Zabbix che per il proxy Zabbix e verrà utilizzato per l'importazione dei dati.
Creazione database
Crea un database separato per il Proxy Zabbix.
Il server Zabbix e il proxy Zabbix non possono utilizzare lo stesso database. Se sono installati sullo stesso host, il database proxy deve avere un file diverso nome.
Importazione dati
Importa schema iniziale:
# cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql -uzabbix -p zabbix
Per proxy con PostgreSQL (o SQLite):
# cat /usr/share/zabbix-sql-scripts/postgresql/proxy.sql | sudo -u zabbix psql zabbix
# cat /usr/share/zabbix-sql-scripts/sqlite3/proxy.sql | sqlite3 zabbix.db
Configura il database per il proxy Zabbix
Modifica zabbix_proxy.conf:
# vi /etc/zabbix/zabbix_proxy.conf
DBHost=host locale
DBName=zabbix
DBUser=zabbix
DBPassword=<password>
In DBName per il proxy Zabbix utilizzare un database separato dal server Zabbix.
In DBPassword usa la password del database Zabbix per MySQL; Utente PostgreSQL password per PostgreSQL.
Usa DBHost= con PostgreSQL. Potresti voler mantenere l'impostazione predefinita
impostando DBHost=localhost (o un indirizzo IP), ma questo farebbe
PostgreSQL usa un socket di rete per connettersi a Zabbix. Vedere SELinux
configurazione
per le istruzioni.
Avvio processo proxy Zabbix
Per avviare un processo proxy Zabbix e farlo partire all'avvio del sistema:
# service zabbix-proxy start
# systemctl enable zabbix-proxy
Configurazione del front-end
Un proxy Zabbix non ha un frontend; comunica solamente con il server Zabbix.
Installazione del gateway Java
È necessario installare Java gateway solo se si desidera monitorare le applicazioni JMX. Il gateway Java è leggero e non richiede un database.
Una volta aggiunto il repository richiesto, puoi installare Zabbix Java gateway eseguendo:
# dnf install zabbix-java-gateway
Procedi a setup per ulteriori informazioni dettagliate sulla configurazione e l'esecuzione del gateway Java.
Installing debuginfo packages
Debuginfo packages are currently available for RHEL versions 9, 7, 6 and 5.
To enable debuginfo repository, edit
/etc/yum.repos.d/zabbix.repo file. Change enabled=0 to enabled=1
for zabbix-debuginfo repository.
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/6.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
This will allow you to install the zabbix-debuginfo package.
# yum install zabbix-debuginfo
This single package contains debug information for all binary Zabbix components.