17 Commits
0.2.0 ... 0.3.0

Author SHA1 Message Date
c925be77c5 zabbix 7.0 lts
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-31 11:21:43 +02:00
e6f5f4092c fix file perms
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-26 10:23:03 +02:00
47d32d669b version bump
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-26 10:16:34 +02:00
f05bb63007 fix startup script 2023-07-26 10:15:49 +02:00
7759ca9ec7 version bump
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-26 10:04:25 +02:00
bcba8d258f fix docker permission 2023-07-26 10:03:52 +02:00
1045ebebd0 note on protection mode
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-26 09:44:30 +02:00
e0737632f8 version bump
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-26 09:15:48 +02:00
c37da6b538 update upstream agent
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2023-07-26 09:13:42 +02:00
83e7d0bc1f added port description 2023-07-26 09:12:51 +02:00
eee92ba7f2 enabled docker api access 2023-07-26 09:12:40 +02:00
3b8cab00ad fix s6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-06-13 11:34:36 +02:00
c975d7d2b6 fix typo 2022-06-13 11:13:36 +02:00
46c224cd9f fix bashio api access
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-06-13 11:08:21 +02:00
c2eef2b279 add Dockerfile labels
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-13 09:52:24 +02:00
b9fedb034e version bump
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-06-13 09:15:09 +02:00
aac9975a01 fix s6
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-13 09:14:07 +02:00
10 changed files with 119 additions and 58 deletions

View File

@@ -1,3 +1,4 @@
---
kind: pipeline kind: pipeline
type: docker type: docker
name: build-amd64 name: build-amd64
@@ -132,7 +133,7 @@ type: docker
name: manifest name: manifest
steps: steps:
- name: manifest - name: manifest
image: plugins/manifest image: plugins/manifest
settings: settings:
force_tag: true force_tag: true

View File

@@ -1,12 +1,17 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:12.0.0 ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:16.2.0
FROM $BUILD_FROM FROM $BUILD_FROM
ENV LANG C.UTF-8 ENV LANG C.UTF-8
# Copy scripts for add-on COPY rootfs /
COPY run.sh /
RUN apk add -U jq zabbix-agent2=6.0.5-r0 sudo && \ RUN \
chmod a+x /run.sh apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community zabbix-agent2=7.0.2-r0 zabbix-agent2-plugin-postgresql zabbix-agent2-plugin-alpine && \
apk add --no-cache sudo && \
addgroup -g 102 -S docker && \
addgroup zabbix docker
CMD [ "/run.sh" ] LABEL \
io.hass.version="0.3.0" \
io.hass.type="addon" \
io.hass.arch="amd64"

View File

@@ -1,12 +1,17 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/armhf:12.0.0 ARG BUILD_FROM=ghcr.io/hassio-addons/base/armhf:16.2.0
FROM $BUILD_FROM FROM $BUILD_FROM
ENV LANG C.UTF-8 ENV LANG C.UTF-8
# Copy scripts for add-on COPY rootfs /
COPY run.sh /
RUN apk add -U jq zabbix-agent2=6.0.5-r0 sudo && \ RUN \
chmod a+x /run.sh apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community zabbix-agent2=7.0.2-r0 zabbix-agent2-plugin-postgresql zabbix-agent2-plugin-alpine && \
apk add --no-cache sudo && \
addgroup -g 102 -S docker && \
addgroup zabbix docker
CMD [ "/run.sh" ] LABEL \
io.hass.version="0.3.0" \
io.hass.type="addon" \
io.hass.arch="armhf"

View File

@@ -1,12 +1,17 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/aarch64:12.0.0 ARG BUILD_FROM=ghcr.io/hassio-addons/base/aarch64:16.2.0
FROM $BUILD_FROM FROM $BUILD_FROM
ENV LANG C.UTF-8 ENV LANG C.UTF-8
# Copy scripts for add-on COPY rootfs /
COPY run.sh /
RUN apk add -U jq zabbix-agent2=6.0.5-r0 sudo && \ RUN \
chmod a+x /run.sh apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community zabbix-agent2=7.0.2-r0 zabbix-agent2-plugin-postgresql zabbix-agent2-plugin-alpine && \
apk add --no-cache sudo && \
addgroup -g 102 -S docker && \
addgroup zabbix docker
CMD [ "/run.sh" ] LABEL \
io.hass.version="0.3.0" \
io.hass.type="addon" \
io.hass.arch="aarch64"

View File

@@ -2,4 +2,8 @@
This addon enables a zabbix agent2 for the hassio instance. This addon enables a zabbix agent2 for the hassio instance.
You obviously neead a zabbix server for it to be meaningful. You obviously need a zabbix server for it to be meaningful.
## Docker access
If you need the agent to access the underlying docker, you need to disable the "Protection mode" switch and restart the container.

View File

@@ -2,14 +2,16 @@
"name": "Zabbix Agent 2", "name": "Zabbix Agent 2",
"url": "https://git.asperti.com/paspo/hassio-addons", "url": "https://git.asperti.com/paspo/hassio-addons",
"image": "docker.asperti.com/paspo/hassio-zabbix-agent2", "image": "docker.asperti.com/paspo/hassio-zabbix-agent2",
"version": "0.2.0", "version": "0.3.0",
"slug": "zabbix-agent2", "slug": "zabbix-agent2",
"description": "Zabbix Agent 2 for hass.io", "description": "Zabbix Agent 2 for hass.io (7.0 LTS)",
"startup": "services", "startup": "services",
"boot": "auto", "boot": "auto",
"hassio_api": true, "hassio_api": true,
"docker_api": true,
"audio": false, "audio": false,
"gpio": false, "gpio": false,
"init": false,
"arch": [ "arch": [
"aarch64", "aarch64",
"amd64" "amd64"
@@ -17,6 +19,9 @@
"ports": { "ports": {
"10050/tcp": 10050 "10050/tcp": 10050
}, },
"ports_description": {
"10050/tcp": "Zabbix Agent port (used by Zabbix Server and/or proxies)"
},
"map": [ "map": [
"share" "share"
], ],

View File

@@ -0,0 +1,9 @@
#!/bin/sh
# Instead of enforcing this requirement, we let the user choose
# if he/she wants to access docker: if so, disabling the "protection mode" is mandatory
exit 0
#!/usr/bin/with-contenv bashio
#bashio::require.unprotected

View File

@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Take down the S6 supervision tree when zabbix-agent2 fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@@ -0,0 +1,41 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Start zabbix-agent2 service if enabled
# ==============================================================================
set -e
CONFIG_PATH=/data/options.json
CUSTOM_CFG_PATH=/share/zabbix-agent2
SERVER_OLD=$(jq --raw-output ".server" $CONFIG_PATH)
SERVER="$(bashio::config 'server' $SERVER_OLD)"
HOSTNAME_OLD=$(jq --raw-output ".hostname" $CONFIG_PATH)
HOSTNAME="$(bashio::config 'hostname' $HOSTNAME_OLD)"
if [ ! -d "$CUSTOM_CFG_PATH" ] ; then
bashio::log.info "Creating a folder for custom configuration"
mkdir -p "$CUSTOM_CFG_PATH"
fi
echo "
Server=$SERVER
ServerActive=$SERVER
Hostname=$HOSTNAME
LogType=console
PidFile=/var/run/zabbix/zabbix_agent2.pid
Include=${CUSTOM_CFG_PATH}/*.conf
" > /etc/zabbix/zabbix_agent2.conf
bashio::log.info "Starting zabbix-agent2"
sudo -u zabbix zabbix_agent2 -f &
AGENT_PID=$!
# Register stop
function stop_agent() {
killall zabbix_agent2
exit 0
}
trap "stop_agent" SIGTERM SIGHUP
wait "${AGENT_PID}"

22
run.sh
View File

@@ -1,22 +0,0 @@
#!/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