diff --git a/zabbix-agent/run.sh b/zabbix-agent/run.sh index 4370f7c..0d1d379 100644 --- a/zabbix-agent/run.sh +++ b/zabbix-agent/run.sh @@ -2,13 +2,13 @@ set -e CONFIG_PATH=/data/options.json -CUSTOM_CFG_PATH=/config/zabbix-agent +CUSTOM_CFG_PATH=/data/zabbix-agent SERVER=$(jq --raw-output ".server" $CONFIG_PATH) HOSTNAME=$(jq --raw-output ".hostname" $CONFIG_PATH) -if [ ! -d /data/zabbix-agent ] ; then - mkdir /data/zabbix-agent +if [ ! -d "$CUSTOM_CFG_PATH" ] ; then + mkdir -p "$CUSTOM_CFG_PATH" fi echo " @@ -16,7 +16,7 @@ Server=$SERVER ServerActive=$SERVER Hostname=$HOSTNAME LogType=console -Include=/data/zabbix-agent/*.conf +Include=${CUSTOM_CFG_PATH}/*.conf " > /etc/zabbix/zabbix_agentd.conf sudo -u zabbix zabbix_agentd -f