custom config path

This commit is contained in:
Paolo Asperti 2019-03-20 09:13:18 +01:00
parent b9a64e91f9
commit 68f1c026b6
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

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