zabbix agent & agent2
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Paolo Asperti 2021-09-13 12:04:31 +02:00
parent 305e0f03f9
commit 38d9d66501
Signed by: paspo
GPG Key ID: 06D46905D19D5182
8 changed files with 127 additions and 3 deletions

View File

@ -50,4 +50,61 @@ steps:
trigger: trigger:
event: event:
- tag - tag
- push - 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

View File

@ -1,4 +1,4 @@
ARG BUILD_FROM=hassioaddons/base:8.0.1 ARG BUILD_FROM=hassioaddons/base:8.0.6
FROM $BUILD_FROM FROM $BUILD_FROM
ENV LANG C.UTF-8 ENV LANG C.UTF-8

View File

@ -1,7 +1,8 @@
{ {
"name": "Zabbix Agent", "name": "Zabbix Agent",
"url": "https://git.asperti.com/paspo/hassio-addons", "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", "slug": "zabbix-agent",
"description": "Zabbix Agent for hass.io", "description": "Zabbix Agent for hass.io",
"startup": "services", "startup": "services",

12
zabbix-agent2/Dockerfile Normal file
View 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
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

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
View 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