From 821bfec19ec519fb04a40581f55a83572b499f51 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Wed, 4 Aug 2021 17:40:37 +0200 Subject: [PATCH 1/2] Allow custom DB name for Proxy SQLite3 variant --- proxy-sqlite3/alpine/Dockerfile | 1 + proxy-sqlite3/alpine/docker-entrypoint.sh | 2 +- proxy-sqlite3/centos/Dockerfile | 1 + proxy-sqlite3/centos/docker-entrypoint.sh | 2 +- proxy-sqlite3/ubuntu/Dockerfile | 1 + proxy-sqlite3/ubuntu/docker-entrypoint.sh | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/proxy-sqlite3/alpine/Dockerfile b/proxy-sqlite3/alpine/Dockerfile index 844f10654..99fae1181 100644 --- a/proxy-sqlite3/alpine/Dockerfile +++ b/proxy-sqlite3/alpine/Dockerfile @@ -22,6 +22,7 @@ RUN set -eux && \ adduser zabbix root && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/db_data && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/mibs && \ mkdir -p /var/lib/zabbix/modules && \ diff --git a/proxy-sqlite3/alpine/docker-entrypoint.sh b/proxy-sqlite3/alpine/docker-entrypoint.sh index d8be8580e..8c1ffeb3d 100755 --- a/proxy-sqlite3/alpine/docker-entrypoint.sh +++ b/proxy-sqlite3/alpine/docker-entrypoint.sh @@ -136,7 +136,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}" update_config_var $ZBX_CONFIG "DBHost" - update_config_var $ZBX_CONFIG "DBName" "/var/lib/zabbix/zabbix_proxy_db" + update_config_var $ZBX_CONFIG "DBName" "/var/lib/zabbix/db_data/${ZBX_HOSTNAME:-"zabbix-proxy-sqlite3"}.sqlite" update_config_var $ZBX_CONFIG "DBUser" update_config_var $ZBX_CONFIG "DBPort" update_config_var $ZBX_CONFIG "DBPassword" diff --git a/proxy-sqlite3/centos/Dockerfile b/proxy-sqlite3/centos/Dockerfile index 1570712c6..c32dbf083 100644 --- a/proxy-sqlite3/centos/Dockerfile +++ b/proxy-sqlite3/centos/Dockerfile @@ -32,6 +32,7 @@ RUN set -eux && \ zabbix && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/db_data && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/mibs && \ mkdir -p /var/lib/zabbix/modules && \ diff --git a/proxy-sqlite3/centos/docker-entrypoint.sh b/proxy-sqlite3/centos/docker-entrypoint.sh index d8be8580e..8c1ffeb3d 100755 --- a/proxy-sqlite3/centos/docker-entrypoint.sh +++ b/proxy-sqlite3/centos/docker-entrypoint.sh @@ -136,7 +136,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}" update_config_var $ZBX_CONFIG "DBHost" - update_config_var $ZBX_CONFIG "DBName" "/var/lib/zabbix/zabbix_proxy_db" + update_config_var $ZBX_CONFIG "DBName" "/var/lib/zabbix/db_data/${ZBX_HOSTNAME:-"zabbix-proxy-sqlite3"}.sqlite" update_config_var $ZBX_CONFIG "DBUser" update_config_var $ZBX_CONFIG "DBPort" update_config_var $ZBX_CONFIG "DBPassword" diff --git a/proxy-sqlite3/ubuntu/Dockerfile b/proxy-sqlite3/ubuntu/Dockerfile index e325bdd26..df684bafe 100644 --- a/proxy-sqlite3/ubuntu/Dockerfile +++ b/proxy-sqlite3/ubuntu/Dockerfile @@ -33,6 +33,7 @@ RUN set -eux && \ zabbix && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/db_data && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/mibs && \ mkdir -p /var/lib/zabbix/modules && \ diff --git a/proxy-sqlite3/ubuntu/docker-entrypoint.sh b/proxy-sqlite3/ubuntu/docker-entrypoint.sh index ab319d3e9..8d90f13a9 100755 --- a/proxy-sqlite3/ubuntu/docker-entrypoint.sh +++ b/proxy-sqlite3/ubuntu/docker-entrypoint.sh @@ -136,7 +136,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}" update_config_var $ZBX_CONFIG "DBHost" - update_config_var $ZBX_CONFIG "DBName" "/var/lib/zabbix/zabbix_proxy_db" + update_config_var $ZBX_CONFIG "DBName" "/var/lib/zabbix/db_data/${ZBX_HOSTNAME:-"zabbix-proxy-sqlite3"}.sqlite" update_config_var $ZBX_CONFIG "DBUser" update_config_var $ZBX_CONFIG "DBPort" update_config_var $ZBX_CONFIG "DBPassword" From 5f79463fcfad8dc151ab5788f2a3e514336d1d4f Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Wed, 4 Aug 2021 17:43:49 +0200 Subject: [PATCH 2/2] Allow custom DB name for Proxy SQLite3 variant --- proxy-sqlite3/alpine/README.md | 4 ++++ proxy-sqlite3/centos/README.md | 4 ++++ proxy-sqlite3/ubuntu/README.md | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/proxy-sqlite3/alpine/README.md b/proxy-sqlite3/alpine/README.md index 79b7319e4..72cce7e2d 100644 --- a/proxy-sqlite3/alpine/README.md +++ b/proxy-sqlite3/alpine/README.md @@ -199,6 +199,10 @@ Please use official documentation for [``zabbix_proxy.conf``](https://www.zabbix The volume is used by External checks (type of items). It is `ExternalScripts` parameter in ``zabbix_proxy.conf``. +### ``/var/lib/zabbix/db_data`` + +The volume stores SQLite3 database file and could be used for external database file storage. + ### ``/var/lib/zabbix/modules`` The volume allows load additional modules and extend Zabbix proxy using ``LoadModule`` feature. diff --git a/proxy-sqlite3/centos/README.md b/proxy-sqlite3/centos/README.md index 79b7319e4..72cce7e2d 100644 --- a/proxy-sqlite3/centos/README.md +++ b/proxy-sqlite3/centos/README.md @@ -199,6 +199,10 @@ Please use official documentation for [``zabbix_proxy.conf``](https://www.zabbix The volume is used by External checks (type of items). It is `ExternalScripts` parameter in ``zabbix_proxy.conf``. +### ``/var/lib/zabbix/db_data`` + +The volume stores SQLite3 database file and could be used for external database file storage. + ### ``/var/lib/zabbix/modules`` The volume allows load additional modules and extend Zabbix proxy using ``LoadModule`` feature. diff --git a/proxy-sqlite3/ubuntu/README.md b/proxy-sqlite3/ubuntu/README.md index 79b7319e4..72cce7e2d 100644 --- a/proxy-sqlite3/ubuntu/README.md +++ b/proxy-sqlite3/ubuntu/README.md @@ -199,6 +199,10 @@ Please use official documentation for [``zabbix_proxy.conf``](https://www.zabbix The volume is used by External checks (type of items). It is `ExternalScripts` parameter in ``zabbix_proxy.conf``. +### ``/var/lib/zabbix/db_data`` + +The volume stores SQLite3 database file and could be used for external database file storage. + ### ``/var/lib/zabbix/modules`` The volume allows load additional modules and extend Zabbix proxy using ``LoadModule`` feature.