Paolo Asperti
5b3ad999a4
All checks were successful
continuous-integration/drone/push Build is passing
23 lines
444 B
Bash
23 lines
444 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
CONFIG_PATH=/data/options.json
|
|
CUSTOM_CFG_PATH=/share/zabbix-agent2
|
|
|
|
SERVER=$(jq --raw-output ".server" $CONFIG_PATH)
|
|
HOSTNAME=$(jq --raw-output ".hostname" $CONFIG_PATH)
|
|
|
|
if [ ! -d "$CUSTOM_CFG_PATH" ] ; then
|
|
mkdir -p "$CUSTOM_CFG_PATH"
|
|
fi
|
|
|
|
echo "
|
|
Server=$SERVER
|
|
ServerActive=$SERVER
|
|
Hostname=$HOSTNAME
|
|
LogType=console
|
|
Include=${CUSTOM_CFG_PATH}/*.conf
|
|
" > /etc/zabbix/zabbix_agent2.conf
|
|
|
|
sudo -u zabbix zabbix_agent2 -f
|