Advertising:

0

From Zabbix-ES
Revision as of 15:14, 17 July 2024 by Admin (talk | contribs)
Jump to navigation Jump to search
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
PHP extensions             : 

# Instalacion de Zabbix Server, Zabbix Frontend y Zabbix Agent2
[root@ec2prozbx01 ]# rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-7.0-3.el9.noarch.rpm
[root@ec2prozbx01 ]# dnf clean all 
[root@ec2prozbx01 ]# 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@ec2prozbx01 ]# cat <<"EOF" >>/etc/yum.repos.d/zabbix.repo

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/7.0/rhel/7/$basearch/debuginfo/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
EOF

[root@ec2prozbx01 ]# dnf install zabbix-debuginfo


# Instalacion de paqueteria requerida por Zabbix Server, Frontend y Agent
[root@ec2prozbx01 ]# dnf install httpd httpd-devel
[root@ec2prozbx01 ]# dnf install php php-*
[root@ec2prozbx01 ]# dnf install gd gettext openssl curl libevent libpq5 libssh libcurl libxml2 net-snmp fping


# Instalacion de Postgres
[root@ec2prozbx01 ]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
[root@ec2prozbx01 ]# dnf -qy module disable postgresql
[root@ec2prozbx01 ]# dnf install -y postgresql16-server
[root@ec2prozbx01 ]# /usr/pgsql-16/bin/postgresql-16-setup initdb
[root@ec2prozbx01 ]# systemctl enable postgresql-16
[root@ec2prozbx01 ]# systemctl start postgresql-16

[root@ec2prozbx01 ]# dnf config-manager --set-disabled pgdg12
[root@ec2prozbx01 ]# dnf config-manager --set-disabled pgdg13
[root@ec2prozbx01 ]# dnf config-manager --set-disabled pgdg14
[root@ec2prozbx01 ]# dnf config-manager --set-disabled pgdg15

[postgres@ec2prozbx01 ~]$ createuser --pwprompt zabbix
[postgres@ec2prozbx01 ~]$ createdb -O zabbix zabbix

[root@ec2prozbx01 ]# zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix 

[root@ec2prozbx01 ]# vi /etc/zabbix/zabbix_server.conf 
DBPassword=Urgenc1a$

# Instalacion de TimeScaleDB
[root@ec2prozbx01 ]# 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@ec2prozbx01 ]# dnf update
[root@ec2prozbx01 ]# dnf install timescaledb-2-postgresql-16




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

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

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

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

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

http://10.120.98.11/zabbix/setup.php





# Configuracion de TimeScaleDB 2.15 + PostgreSQL 16

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

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

-- Creación de Hipertablas
[root@ec2prozbx01 postgresql]# cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix

---- 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@ec2prozbx01 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.

zabbix=# CREATE EXTENSION IF NOT EXISTS timescaledb;
FATAL:  extension "timescaledb" must be preloaded
HINT:  Please preload the timescaledb library via shared_preload_libraries.

This can be done by editing the config file at: /var/lib/pgsql/16/data/postgresql.conf
and adding 'timescaledb' to the list in the shared_preload_libraries config.
        # Modify postgresql.conf:
        shared_preload_libraries = 'timescaledb'

Another way to do this, if not preloading other libraries, is with the command:
        echo "shared_preload_libraries = 'timescaledb'" >> /var/lib/pgsql/16/data/postgresql.conf 

(Will require a database restart.)


server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.