added zabbix-agent
This commit is contained in:
parent
eef1ac29d3
commit
d9bcc160fc
12
zabbix-agent/Dockerfile
Normal file
12
zabbix-agent/Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Copy scripts for add-on
|
||||
COPY run.sh /
|
||||
|
||||
RUN apk add -U jq zabbix-agent sudo && \
|
||||
chmod a+x /run.sh
|
||||
|
||||
CMD [ "/run.sh" ]
|
31
zabbix-agent/config.json
Normal file
31
zabbix-agent/config.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "Zabbix Agent",
|
||||
"url": "https://git.asperti.com/paspo/hassio-addons",
|
||||
"version": "0.1.0",
|
||||
"slug": "zabbix-agent",
|
||||
"description": "Zabbix Agent for hass.io",
|
||||
"startup": "services",
|
||||
"boot": "auto",
|
||||
"audio": false,
|
||||
"gpio": false,
|
||||
"arch": [
|
||||
"aarch64",
|
||||
"amd64",
|
||||
"armhf",
|
||||
"i386"
|
||||
],
|
||||
"ports": {
|
||||
"10050/tcp": 10050
|
||||
},
|
||||
"map": [
|
||||
"config"
|
||||
],
|
||||
"options": {
|
||||
"server": "zabbix-server",
|
||||
"hostname": "hassio"
|
||||
},
|
||||
"schema": {
|
||||
"server": "str",
|
||||
"hostname": "str"
|
||||
}
|
||||
}
|
18
zabbix-agent/run.sh
Normal file
18
zabbix-agent/run.sh
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
CONFIG_PATH=/data/options.json
|
||||
CUSTOM_CFG_PATH=/config/zabbix-agent
|
||||
|
||||
SERVER=$(jq --raw-output ".server" $CONFIG_PATH)
|
||||
HOSTNAME=$(jq --raw-output ".hostname" $CONFIG_PATH)
|
||||
|
||||
echo "
|
||||
Server=$SERVER
|
||||
ServerActive=$SERVER
|
||||
Hostname=$HOSTNAME
|
||||
LogType=console
|
||||
Include=/config/zabbix-agent/*.conf
|
||||
" > /etc/zabbix/zabbix_agentd.conf
|
||||
|
||||
sudo -u zabbix zabbix_agentd -f
|
Loading…
Reference in New Issue
Block a user