custom config path
This commit is contained in:
parent
b9a64e91f9
commit
68f1c026b6
@ -2,13 +2,13 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONFIG_PATH=/data/options.json
|
CONFIG_PATH=/data/options.json
|
||||||
CUSTOM_CFG_PATH=/config/zabbix-agent
|
CUSTOM_CFG_PATH=/data/zabbix-agent
|
||||||
|
|
||||||
SERVER=$(jq --raw-output ".server" $CONFIG_PATH)
|
SERVER=$(jq --raw-output ".server" $CONFIG_PATH)
|
||||||
HOSTNAME=$(jq --raw-output ".hostname" $CONFIG_PATH)
|
HOSTNAME=$(jq --raw-output ".hostname" $CONFIG_PATH)
|
||||||
|
|
||||||
if [ ! -d /data/zabbix-agent ] ; then
|
if [ ! -d "$CUSTOM_CFG_PATH" ] ; then
|
||||||
mkdir /data/zabbix-agent
|
mkdir -p "$CUSTOM_CFG_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
@ -16,7 +16,7 @@ Server=$SERVER
|
|||||||
ServerActive=$SERVER
|
ServerActive=$SERVER
|
||||||
Hostname=$HOSTNAME
|
Hostname=$HOSTNAME
|
||||||
LogType=console
|
LogType=console
|
||||||
Include=/data/zabbix-agent/*.conf
|
Include=${CUSTOM_CFG_PATH}/*.conf
|
||||||
" > /etc/zabbix/zabbix_agentd.conf
|
" > /etc/zabbix/zabbix_agentd.conf
|
||||||
|
|
||||||
sudo -u zabbix zabbix_agentd -f
|
sudo -u zabbix zabbix_agentd -f
|
||||||
|
Loading…
Reference in New Issue
Block a user