This commit is contained in:
2024-06-23 20:26:54 +03:00
parent c772daa1a1
commit 3364544c55
3 changed files with 12 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
# Home Assistant Add-on: Zabbix agent 2
# Runs zabbix agent 2
# ==============================================================================
declare -a options
readonly ZBX_CFG_FILE='/config/zabbix_agent2.conf'
bashio::log.info 'Starting zabbix-agent2...'
@@ -14,5 +14,7 @@ if ! bashio::fs.file_exists "${ZBX_CFG_FILE}" || [ -z "$(ls -A ${ZBX_CFG_FILE})"
cp /etc/zabbix/zabbix_agent2.conf ${ZBX_CFG_FILE}
fi
# Run zabbix-agent2 in foreground
zabbix_agent2 --foreground -c /config/zabbix_agent2.conf
options+=(--foreground)
options+=(-c /config/zabbix_agent2.conf)
exec zabbix_agent2 "${options[@]}"