Advertising:

0

From Zabbix-ES
Revision as of 16:46, 17 July 2024 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Pre requisitos para instalar Zabbix 7.X en RHEL9 o OL9

Requerimientos             : https://www.zabbix.com/documentation/7.0/en/manual/installation/requirements
PostgreSQL                 : 13.0-16.X
TimescaleDB for PostgreSQL : 2.13.0-2.15.X
Apache                     : 2.4 or later o Nginx: 1.20 or later
PHP                        : 8.0.0 - 8.3.X

Despliegue de la infraestructura

[Infraestructura via Vagrant - Laboratorio]

Instalacion de Zabbix Server, Zabbix Frontend y Zabbix Agent2

-- SI instalamos EPEL tenemos que desahabilitar la paqueteria de Zabbix y php que nos trae EPEL
[root@zbxserver01 ~]# echo excludepkgs=php* zabbix* >>/etc/yum.repos.d/oracle-epel-ol9.repo 
[root@zbxserver01 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-7.0-3.el9.noarch.rpm
[root@zbxserver01 ~]# dnf clean all 
[root@zbxserver01 ~]# dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-java-gateway zabbix-agent2 zabbix-agent2-plugin-*

[root@zbxserver01 ~]# dnf install httpd httpd-devel
[root@zbxserver01 ~]# dnf install php php-*
[root@zbxserver01 ~]# dnf install gd gettext openssl curl libevent libpq libssh libcurl libxml2 net-snmp fping

Instalacion y configuracion de Postgres 16

[root@zbxserver01 ~]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
[root@zbxserver01 ~]# dnf -qy module disable postgresql
[root@zbxserver01 ~]# dnf install -y postgresql16-server
[root@zbxserver01 ~]# /usr/pgsql-16/bin/postgresql-16-setup initdb
[root@zbxserver01 ~]# systemctl enable postgresql-16
[root@zbxserver01 ~]# systemctl start postgresql-16
[root@zbxserver01 ~]# dnf config-manager --set-disabled pgdg12 pgdg13 pgdg14 pgdg15
[root@zbxserver01 ~]#  sudo -u zabbix createuser --pwprompt zabbix
[root@zbxserver01 ~]#  sudo -u zabbix createdb -O zabbix zabbix
[root@zbxserver01 ~]# zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix 
[root@zbxserver01 ~]# vi /etc/zabbix/zabbix_server.conf
DBPassword=Z4bb1x

Instalacion de TimeScaleDB

[root@zbxserver01 ~]# tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/$(rpm -E %{rhel})/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL

[root@zbxserver01 ~]# dnf update
[root@zbxserver01 ~]# dnf install timescaledb-2-postgresql-16

Configuracion de TimeScaleDB 2.15 + PostgreSQL 16

Notas: https://www.zabbix.com/documentation/7.0/en/manual/appendix/install/timescaledb?hl=usr%2Fshare%2Fzabbix%2Csql%2Cscripts%2Fpostgresql%2Ftimescaledb

[root@zbxserver01 postgresql]# echo "shared_preload_libraries = 'timescaledb'" >> /var/lib/pgsql/16/data/postgresql.conf
[root@zbxserver01 postgresql]# systemctl restart postgresql-16.service 
[root@zbxserver01 postgresql]# echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
CREATE EXTENSION

-- Creación de Hipertablas
[root@zbxserver01 postgresql]# cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix
--- Verificamos las Hipertablas creadas 
[root@zbxserver01 postgresql]# echo "SELECT * FROM timescaledb_information.hypertables;" | sudo -u postgres psql zabbix


Configuracion Zabbix Frontend

[root@zbxserver01 ~]# systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
[root@zbxserver01 ~]# systemctl enable zabbix-server zabbix-agent2 httpd php-fpm

[root@zbxserver01 ~]# vi /etc/php.ini
date.timezone = "Europe/Madrid"

[root@zbxserver01 ~]# vi /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Europe/Madrid

[root@zbxserver01 ~]# cat <<"EOF" >/var/www/html/index.html
<html>
<head>
<title>Zabbix Server</title>
<meta http-equiv="refresh" content="0; URL=http://10.1.100.100/zabbix">
<meta name="keywords" content="automatic redirection">
</head>
<body>
</body>
</html>
EOF

[root@zbxserver01 ~]# systemctl restart httpd php-fpm zabbix-server

[Zabbix Server]


---- ANALIZAR LA INSTALACION DE TimeScaleDB


https://www.zabbix-es.com.es/index.php/Upgrade_de_Zabbix_4.4.5_a_5.0.0_PostgreSQL_11_a_12_e_Instalaci%C3%B3n_de_TSDB
https://www.zabbix-es.com.es/index.php/Upgrade_de_Zabbix_5.0.3_a_6.0.0_PostgreSQL_12_a_13_y_TimescaleDB_de_1.7.1_a_2.3.1

[root@zbxserver01 postgresql]# sudo -u postgres psql -U postgres -X -d zabbix
zabbix=# \dx timescaledb

[postgres@ec2prozbx01 ~]$ psql -U postgres -X -d zabbix
psql (16.3)
Type "help" for help.