Added Zabbix web service image

This commit is contained in:
Alexey Pustovalov 2021-04-27 23:56:40 -04:00
parent 78719d212f
commit 867202beb4
18 changed files with 62 additions and 88 deletions

View File

@ -385,6 +385,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -421,6 +421,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -381,6 +381,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -417,6 +417,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -387,6 +387,8 @@ services:
- "10053:10053"
cap_add:
- SYS_ADMIN
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
deploy:
resources:
limits:

View File

@ -421,6 +421,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -381,6 +381,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -417,6 +417,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -377,6 +377,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -415,6 +415,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -375,6 +375,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -411,6 +411,8 @@ services:
- all
ports:
- "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add:
- SYS_ADMIN
deploy:

View File

@ -59,7 +59,6 @@ RUN set -eux && \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--prefix=/usr \
--enable-ipv6 \
--enable-webservice \
--silent && \
make -j"$(nproc)" -s && \

View File

@ -84,43 +84,27 @@ update_config_var() {
}
update_config_multiple_var() {
local config_path=$1
local var_name=$2
local var_value=$3
var_value="${var_value%\"}"
var_value="${var_value#\"}"
local IFS=,
local OPT_LIST=($var_value)
for value in "${OPT_LIST[@]}"; do
update_config_var $config_path $var_name $value true
done
}
prepare_zbx_web_service_config() {
echo "** Preparing Zabbix web service configuration file"
ZBX_WEB_SERVICE_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
ZBX_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogType" "console"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFile"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFileSize"
update_config_var $ZBX_WEB_SERVICE_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_CONFIG "LogType" "console"
update_config_var $ZBX_CONFIG "LogFile"
update_config_var $ZBX_CONFIG "LogFileSize"
update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
: ${ZBX_ALLOWEDIP:="zabbix-server"}
update_config_var $ZBX_WEB_SERVICE_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
}
prepare_web_service() {

View File

@ -22,7 +22,8 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
epel-release && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
chromium \
openssl-libs \
@ -63,7 +64,6 @@ RUN set -eux && \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--prefix=/usr \
--enable-ipv6 \
--enable-webservice \
--silent && \
make -j"$(nproc)" -s && \

View File

@ -84,43 +84,27 @@ update_config_var() {
}
update_config_multiple_var() {
local config_path=$1
local var_name=$2
local var_value=$3
var_value="${var_value%\"}"
var_value="${var_value#\"}"
local IFS=,
local OPT_LIST=($var_value)
for value in "${OPT_LIST[@]}"; do
update_config_var $config_path $var_name $value true
done
}
prepare_zbx_web_service_config() {
echo "** Preparing Zabbix web service configuration file"
ZBX_WEB_SERVICE_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
ZBX_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogType" "console"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFile"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFileSize"
update_config_var $ZBX_WEB_SERVICE_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_CONFIG "LogType" "console"
update_config_var $ZBX_CONFIG "LogFile"
update_config_var $ZBX_CONFIG "LogFileSize"
update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
: ${ZBX_ALLOWEDIP:="zabbix-server"}
update_config_var $ZBX_WEB_SERVICE_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
}
prepare_web_service() {

View File

@ -78,7 +78,6 @@ RUN set -eux && \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--prefix=/usr \
--enable-ipv6 \
--enable-webservice \
--silent && \
make -j"$(nproc)" -s && \

View File

@ -84,43 +84,27 @@ update_config_var() {
}
update_config_multiple_var() {
local config_path=$1
local var_name=$2
local var_value=$3
var_value="${var_value%\"}"
var_value="${var_value#\"}"
local IFS=,
local OPT_LIST=($var_value)
for value in "${OPT_LIST[@]}"; do
update_config_var $config_path $var_name $value true
done
}
prepare_zbx_web_service_config() {
echo "** Preparing Zabbix web service configuration file"
ZBX_WEB_SERVICE_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
ZBX_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogType" "console"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFile"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFileSize"
update_config_var $ZBX_WEB_SERVICE_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_CONFIG "LogType" "console"
update_config_var $ZBX_CONFIG "LogFile"
update_config_var $ZBX_CONFIG "LogFileSize"
update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
: ${ZBX_ALLOWEDIP:="zabbix-server"}
update_config_var $ZBX_WEB_SERVICE_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
}
prepare_web_service() {