mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-04-18 16:29:21 +02:00
Added timescale support
This commit is contained in:
parent
8681a5e08b
commit
c747a44303
@ -7,3 +7,4 @@ POSTGRES_PASSWORD=zabbix
|
|||||||
# POSTGRES_DB=zabbix
|
# POSTGRES_DB=zabbix
|
||||||
POSTGRES_DB=zabbix
|
POSTGRES_DB=zabbix
|
||||||
# DB_SERVER_SCHEMA=public
|
# DB_SERVER_SCHEMA=public
|
||||||
|
# ENABLE_TIMESCALEDB=true
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -126,6 +126,7 @@ RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
|
|||||||
cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \
|
cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \
|
||||||
gzip database/${ZBX_DB_TYPE}/create.sql && \
|
gzip database/${ZBX_DB_TYPE}/create.sql && \
|
||||||
cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
|
cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
|
||||||
|
cp database/${ZBX_DB_TYPE}/timescaledb.sql /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
|
||||||
cd /tmp/ && \
|
cd /tmp/ && \
|
||||||
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
|
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
|
||||||
apk del ${APK_FLAGS_COMMON} --purge \
|
apk del ${APK_FLAGS_COMMON} --purge \
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -97,6 +97,7 @@ COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bi
|
|||||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender
|
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender
|
||||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf
|
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf
|
||||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz
|
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz
|
||||||
|
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/timescaledb.sql /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/timescaledb.sql
|
||||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
|
|
||||||
RUN groupadd --system zabbix && \
|
RUN groupadd --system zabbix && \
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -142,6 +142,7 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
|
|||||||
cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \
|
cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \
|
||||||
gzip database/${ZBX_DB_TYPE}/create.sql && \
|
gzip database/${ZBX_DB_TYPE}/create.sql && \
|
||||||
cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
|
cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
|
||||||
|
cp database/${ZBX_DB_TYPE}/timescaledb.sql /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
|
||||||
cd /tmp/ && \
|
cd /tmp/ && \
|
||||||
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
|
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
|
||||||
apt-get ${APT_FLAGS_COMMON} purge \
|
apt-get ${APT_FLAGS_COMMON} purge \
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
|
||||||
|
|
||||||
|
#Enable PostgreSQL timescaleDB feature:
|
||||||
|
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# User 'zabbix' home directory
|
# User 'zabbix' home directory
|
||||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||||
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
|
|||||||
local type=$1
|
local type=$1
|
||||||
|
|
||||||
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
|
||||||
c.relnamespace WHERE n.nspname = '{$DB_SERVER_SCHEMA}' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")
|
||||||
|
|
||||||
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
|
||||||
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
|
||||||
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
|
|||||||
if [ -z "${ZBX_DB_VERSION}" ]; then
|
if [ -z "${ZBX_DB_VERSION}" ]; then
|
||||||
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
echo "** Creating '${DB_SERVER_DBNAME}' schema in PostgreSQL"
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
psql_query "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||||
fi
|
fi
|
||||||
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
|
|||||||
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
|
||||||
|
if [ "${ENABLE_TIMESCALEDB}" == "true" ]; then
|
||||||
|
cat /usr/share/doc/zabbix-$type-postgresql/timescaledb.sql | psql -q \
|
||||||
|
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||||
|
-U ${DB_SERVER_ZBX_USER} ${DB_SERVER_DBNAME} 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
unset PGPASSWORD
|
unset PGPASSWORD
|
||||||
unset PGOPTIONS
|
unset PGOPTIONS
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user