zevilz / zabbix-alertscript-telegram

Script for sending Zabbix alerts via Telegram bot (including sending native Zabbix graphs)
MIT License
19 stars 2 forks source link

Docker #1

Closed alexanderek closed 1 year ago

alexanderek commented 1 year ago

Hello

When executing the script in the docker container, I get a message: The script only for using on GNU Linux dists!

The official zabbix image is based on alpine linux.

zevilz commented 1 year ago

The script check OSTYPE var in OS. It throw this error if in OSTYPE not linux-gnu. But alpine linux have right value:

# docker exec zabbix-server-pgsql echo "$OSTYPE"
linux-gnu
alexanderek commented 1 year ago

zabbix/zabbix-server-pgsql:alpine-6.0-latest

bash-5.1$ echo "$OSTYPE"
linux-musl

I have now commented out this check in the script.

seventhsite commented 1 year ago

@alexanderek how you run script inside container? My zabbix-server-mysql:ubuntu-latest don't have inside: curl, jq, jo.

alexanderek commented 1 year ago

@seventhsite

You need to make your Dockerfile

In my case, it's like this

FROM zabbix/zabbix-server-pgsql:alpine-6.0.14

USER root

RUN apk add --no-cache file curl jq jo && apk add --no-cache --upgrade grep

USER zabbix

further, if you use docker compose, you must specify build instead of image.