Change zabbix proxy config

This commit is contained in:
Thorsten Spille 2024-05-17 12:47:41 +02:00
parent d1c9615a4a
commit 84173e46a8
2 changed files with 3 additions and 2 deletions

View File

@ -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"

View File

@ -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