From 84173e46a85fd404740666f2bf04e99a299766bc Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Fri, 17 May 2024 12:47:41 +0200 Subject: [PATCH] Change zabbix proxy config --- src/zabbix-proxy/constants-service.conf | 2 +- src/zabbix-proxy/install-service.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zabbix-proxy/constants-service.conf b/src/zabbix-proxy/constants-service.conf index 07b8f78..1f68f3a 100644 --- a/src/zabbix-proxy/constants-service.conf +++ b/src/zabbix-proxy/constants-service.conf @@ -34,7 +34,7 @@ ZABBIX_DB_IP="127.0.0.1" ZABBIX_DB_PORT="5432" # Defines the name from the SQL database -ZABBIX_DB_NAME="zabbix" +ZABBIX_DB_NAME="zabbix_proxy" # Defines the name from the SQL user ZABBIX_DB_USR="zabbix" diff --git a/src/zabbix-proxy/install-service.sh b/src/zabbix-proxy/install-service.sh index ef00b39..7921edd 100644 --- a/src/zabbix-proxy/install-service.sh +++ b/src/zabbix-proxy/install-service.sh @@ -32,8 +32,9 @@ EOF cat /usr/share/zabbix-sql-scripts/postgresql/proxy.sql | sudo -u zabbix psql ${ZABBIX_DB_NAME} echo "DBPassword=${ZABBIX_DB_PWD}" >> /etc/zabbix/zabbix_proxy.conf -echo "Server=${ZBX_ADDR}" >> /etc/zabbix/zabbix_proxy.conf +$srv=$(grep -E "^Server" /etc/zabbix/zabbix_proxy.conf) +sed -i "s/$srv/Server=${ZBX_ADDR}/g" "s/# ListenPort=/ListenPort=/g" "s/Hostname=Zabbix proxy/# Hostname=${LXC_HOSTNAME}.${LXC_DOMAIN}/g" /etc/zabbix/zabbix_proxy.conf systemctl enable zabbix-proxy