This commit is contained in:
12
zabbix-agent2/Dockerfile
Normal file
12
zabbix-agent2/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
ARG BUILD_FROM=hassioaddons/base:8.0.6
|
||||
FROM $BUILD_FROM
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Copy scripts for add-on
|
||||
COPY run.sh /
|
||||
|
||||
RUN apk add -U jq zabbix-agent2=5.0.14-r1 sudo && \
|
||||
chmod a+x /run.sh
|
||||
|
||||
CMD [ "/run.sh" ]
|
||||
32
zabbix-agent2/config.json
Normal file
32
zabbix-agent2/config.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "Zabbix Agent 2",
|
||||
"url": "https://git.asperti.com/paspo/hassio-addons",
|
||||
"image": "docker.asperti.com/paspo/hassio-zabbix-agent2",
|
||||
"version": "0.1.1",
|
||||
"slug": "zabbix-agent2",
|
||||
"description": "Zabbix Agent 2 for hass.io",
|
||||
"startup": "services",
|
||||
"boot": "auto",
|
||||
"audio": false,
|
||||
"gpio": false,
|
||||
"arch": [
|
||||
"aarch64",
|
||||
"amd64",
|
||||
"armhf",
|
||||
"i386"
|
||||
],
|
||||
"ports": {
|
||||
"10050/tcp": 10050
|
||||
},
|
||||
"map": [
|
||||
"share"
|
||||
],
|
||||
"options": {
|
||||
"server": "zabbix-server",
|
||||
"hostname": "hassio"
|
||||
},
|
||||
"schema": {
|
||||
"server": "str",
|
||||
"hostname": "str"
|
||||
}
|
||||
}
|
||||
BIN
zabbix-agent2/icon.png
Normal file
BIN
zabbix-agent2/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 632 B |
BIN
zabbix-agent2/logo.png
Normal file
BIN
zabbix-agent2/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
22
zabbix-agent2/run.sh
Normal file
22
zabbix-agent2/run.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user