hassio-addons/zabbix-agent2/run.sh
Paolo Asperti 38d9d66501
Some checks failed
continuous-integration/drone/push Build is failing
zabbix agent & agent2
2021-09-13 12:04:31 +02:00

23 lines
443 B
Bash

#!/bin/bash
set -e
CONFIG_PATH=/data/options.json
CUSTOM_CFG_PATH=/share/zabbix-agent
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_agentd.conf
sudo -u zabbix zabbix_agentd -f