From 2e17c7710481195deffda57eee24b59120cf7c00 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Wed, 25 Aug 2021 14:57:37 +0200 Subject: [PATCH] Fixed persistent storage location for agent2 --- agent2/alpine/Dockerfile | 1 + agent2/alpine/docker-entrypoint.sh | 2 +- agent2/ol/Dockerfile | 1 + agent2/ol/docker-entrypoint.sh | 2 +- agent2/rhel/Dockerfile | 1 + agent2/rhel/docker-entrypoint.sh | 2 +- agent2/ubuntu/Dockerfile | 1 + agent2/ubuntu/docker-entrypoint.sh | 2 +- 8 files changed, 8 insertions(+), 4 deletions(-) diff --git a/agent2/alpine/Dockerfile b/agent2/alpine/Dockerfile index 7d61c849e..0c51dbd59 100644 --- a/agent2/alpine/Dockerfile +++ b/agent2/alpine/Dockerfile @@ -25,6 +25,7 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/buffer && \ apk add --no-cache --clean-protected \ tini \ tzdata \ diff --git a/agent2/alpine/docker-entrypoint.sh b/agent2/alpine/docker-entrypoint.sh index 1476e10a4..14229d7ab 100755 --- a/agent2/alpine/docker-entrypoint.sh +++ b/agent2/alpine/docker-entrypoint.sh @@ -156,7 +156,7 @@ prepare_zbx_agent_config() { if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1" - update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/" + update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db" update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}" else update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0" diff --git a/agent2/ol/Dockerfile b/agent2/ol/Dockerfile index 5a03a9bcc..1952c0b4f 100644 --- a/agent2/ol/Dockerfile +++ b/agent2/ol/Dockerfile @@ -35,6 +35,7 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/buffer && \ mkdir -p /etc/yum/vars/ && \ echo "" > /etc/yum/vars/ociregion && \ echo "oracle.com" > /etc/yum/vars/ocidomain && \ diff --git a/agent2/ol/docker-entrypoint.sh b/agent2/ol/docker-entrypoint.sh index 1476e10a4..14229d7ab 100755 --- a/agent2/ol/docker-entrypoint.sh +++ b/agent2/ol/docker-entrypoint.sh @@ -156,7 +156,7 @@ prepare_zbx_agent_config() { if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1" - update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/" + update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db" update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}" else update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0" diff --git a/agent2/rhel/Dockerfile b/agent2/rhel/Dockerfile index cd7525421..8956d7262 100644 --- a/agent2/rhel/Dockerfile +++ b/agent2/rhel/Dockerfile @@ -62,6 +62,7 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/buffer && \ curl -L https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -o /sbin/tini && \ curl -L https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc -o /tmp/tini.asc && \ export GNUPGHOME="$(mktemp -d)" && \ diff --git a/agent2/rhel/docker-entrypoint.sh b/agent2/rhel/docker-entrypoint.sh index 1476e10a4..14229d7ab 100755 --- a/agent2/rhel/docker-entrypoint.sh +++ b/agent2/rhel/docker-entrypoint.sh @@ -156,7 +156,7 @@ prepare_zbx_agent_config() { if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1" - update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/" + update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db" update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}" else update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0" diff --git a/agent2/ubuntu/Dockerfile b/agent2/ubuntu/Dockerfile index e58b4a8f2..8dcbd65eb 100644 --- a/agent2/ubuntu/Dockerfile +++ b/agent2/ubuntu/Dockerfile @@ -34,6 +34,7 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/buffer && \ apt-get -y update && \ DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ tini \ diff --git a/agent2/ubuntu/docker-entrypoint.sh b/agent2/ubuntu/docker-entrypoint.sh index 1476e10a4..14229d7ab 100755 --- a/agent2/ubuntu/docker-entrypoint.sh +++ b/agent2/ubuntu/docker-entrypoint.sh @@ -156,7 +156,7 @@ prepare_zbx_agent_config() { if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1" - update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/" + update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db" update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}" else update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0"