Added timescale support

This commit is contained in:
root 2019-04-12 13:22:41 +03:00
parent 8681a5e08b
commit c747a44303
38 changed files with 480 additions and 34 deletions

View File

@ -7,3 +7,4 @@ POSTGRES_PASSWORD=zabbix
# POSTGRES_DB=zabbix
POSTGRES_DB=zabbix
# DB_SERVER_SCHEMA=public
# ENABLE_TIMESCALEDB=true

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -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 && \
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}/timescaledb.sql /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
apk del ${APK_FLAGS_COMMON} --purge \

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -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}/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}/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
RUN groupadd --system zabbix && \

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -142,6 +142,7 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \
cat database/${ZBX_DB_TYPE}/data.sql >> 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}/timescaledb.sql /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
apt-get ${APT_FLAGS_COMMON} purge \

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi

View File

@ -30,6 +30,9 @@ ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
# Default timezone for web interface
PHP_TZ=${PHP_TZ:-"Europe/Riga"}
#Enable PostgreSQL timescaleDB feature:
ENABLE_TIMESCALEDB=${ENABLE_TIMESCALEDB:-"false"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
@ -439,7 +442,7 @@ create_db_schema_postgresql() {
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 =
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
echo "** Table '${DB_SERVER_DBNAME}.dbversion' already exists."
@ -449,6 +452,10 @@ create_db_schema_postgresql() {
if [ -z "${ZBX_DB_VERSION}" ]; then
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
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
fi
@ -462,6 +469,12 @@ create_db_schema_postgresql() {
-h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
-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 PGOPTIONS
fi