diff --git a/.drone.yml b/.drone.yml index 0aba42e..12e0436 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,4 +50,61 @@ steps: trigger: event: - tag - - push \ No newline at end of file + - push + +--- + +kind: pipeline +type: docker +name: zabbix-agent + +steps: + + - name: build_and_publish_zabbix-agent + image: plugins/docker:linux-amd64 + settings: + dockerfile: zabbix-agent/Dockerfile + context: zabbix-agent + password: + from_secret: docker_password + registry: docker.asperti.com + repo: docker.asperti.com/paspo/hassio-zabbix-agent + tags: + - latest + - 0.1.4 + username: + from_secret: docker_username + +trigger: + event: + - tag + - push + + +--- + +kind: pipeline +type: docker +name: zabbix-agent2 + +steps: + + - name: build_and_publish_zabbix-agent2 + image: plugins/docker:linux-amd64 + settings: + dockerfile: zabbix-agent2/Dockerfile + context: zabbix-agent2 + password: + from_secret: docker_password + registry: docker.asperti.com + repo: docker.asperti.com/paspo/hassio-zabbix-agent2 + tags: + - latest + - 0.1.1 + username: + from_secret: docker_username + +trigger: + event: + - tag + - push \ No newline at end of file diff --git a/zabbix-agent/Dockerfile b/zabbix-agent/Dockerfile index ea351b1..f54220c 100644 --- a/zabbix-agent/Dockerfile +++ b/zabbix-agent/Dockerfile @@ -1,4 +1,4 @@ -ARG BUILD_FROM=hassioaddons/base:8.0.1 +ARG BUILD_FROM=hassioaddons/base:8.0.6 FROM $BUILD_FROM ENV LANG C.UTF-8 diff --git a/zabbix-agent/config.json b/zabbix-agent/config.json index ce60f8b..5b77de6 100644 --- a/zabbix-agent/config.json +++ b/zabbix-agent/config.json @@ -1,7 +1,8 @@ { "name": "Zabbix Agent", "url": "https://git.asperti.com/paspo/hassio-addons", - "version": "0.1.3", + "image": "docker.asperti.com/paspo/hassio-zabbix-agent", + "version": "0.1.4", "slug": "zabbix-agent", "description": "Zabbix Agent for hass.io", "startup": "services", diff --git a/zabbix-agent2/Dockerfile b/zabbix-agent2/Dockerfile new file mode 100644 index 0000000..859c079 --- /dev/null +++ b/zabbix-agent2/Dockerfile @@ -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" ] diff --git a/zabbix-agent2/config.json b/zabbix-agent2/config.json new file mode 100644 index 0000000..2aa5b6f --- /dev/null +++ b/zabbix-agent2/config.json @@ -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" + } +} diff --git a/zabbix-agent2/icon.png b/zabbix-agent2/icon.png new file mode 100644 index 0000000..0d14501 Binary files /dev/null and b/zabbix-agent2/icon.png differ diff --git a/zabbix-agent2/logo.png b/zabbix-agent2/logo.png new file mode 100644 index 0000000..2f2bc49 Binary files /dev/null and b/zabbix-agent2/logo.png differ diff --git a/zabbix-agent2/run.sh b/zabbix-agent2/run.sh new file mode 100644 index 0000000..fc67ef0 --- /dev/null +++ b/zabbix-agent2/run.sh @@ -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