diff --git a/docker-compose_v3_alpine_mysql_latest.yaml b/docker-compose_v3_alpine_mysql_latest.yaml index fd295be35..e68838601 100644 --- a/docker-compose_v3_alpine_mysql_latest.yaml +++ b/docker-compose_v3_alpine_mysql_latest.yaml @@ -340,7 +340,7 @@ services: zabbix-snmptraps: image: zabbix/zabbix-snmptraps:alpine-latest ports: - - "162:162/udp" + - "162:1162/udp" volumes: - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw deploy: diff --git a/docker-compose_v3_alpine_mysql_local.yaml b/docker-compose_v3_alpine_mysql_local.yaml index 6e69362e6..d52724ba4 100644 --- a/docker-compose_v3_alpine_mysql_local.yaml +++ b/docker-compose_v3_alpine_mysql_local.yaml @@ -372,7 +372,7 @@ services: - alpine:3.10 image: zabbix-snmptraps:alpine-local ports: - - "162:162/udp" + - "162:1162/udp" volumes: - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw deploy: diff --git a/docker-compose_v3_alpine_pgsql_latest.yaml b/docker-compose_v3_alpine_pgsql_latest.yaml index 943a4cb14..3102469b5 100644 --- a/docker-compose_v3_alpine_pgsql_latest.yaml +++ b/docker-compose_v3_alpine_pgsql_latest.yaml @@ -343,7 +343,7 @@ services: zabbix-snmptraps: image: zabbix/zabbix-snmptraps:alpine-latest ports: - - "162:162/udp" + - "162:1162/udp" volumes: - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw deploy: diff --git a/docker-compose_v3_alpine_pgsql_local.yaml b/docker-compose_v3_alpine_pgsql_local.yaml index 4dd23c3a5..f0aeb7fe6 100644 --- a/docker-compose_v3_alpine_pgsql_local.yaml +++ b/docker-compose_v3_alpine_pgsql_local.yaml @@ -376,7 +376,7 @@ services: - alpine:3.10 image: zabbix-snmptraps:alpine-local ports: - - "162:162/udp" + - "162:1162/udp" volumes: - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw deploy: diff --git a/snmptraps/alpine/Dockerfile b/snmptraps/alpine/Dockerfile index 979ad9655..292dfa2a6 100644 --- a/snmptraps/alpine/Dockerfile +++ b/snmptraps/alpine/Dockerfile @@ -46,6 +46,7 @@ RUN set -eux && \ ls -lah && \ cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ patch -p1 < ./patches/makefile.patch && \ + patch -p1 < ./patches/pid_location.patch && \ make -j"$(nproc)" -s && \ cp snmptrapfmthdlr /usr/sbin/snmptrapfmthdlr && \ cp snmptrapfmt /usr/sbin/snmptrapfmt && \ @@ -59,14 +60,14 @@ RUN set -eux && \ "/etc/snmp/snmptrapfmt.conf" && \ rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ - chown --quiet -R zabbix:root /var/lib/zabbix/ && \ - chgrp -R 0 /var/lib/zabbix/ && \ - chmod -R g=u /var/lib/zabbix/ && \ + chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ + chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ + chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ apk del --purge --no-network \ build-dependencies && \ rm -rf /var/cache/apk/* -EXPOSE 162/UDP +EXPOSE 1162/UDP WORKDIR /var/lib/zabbix/snmptraps/ diff --git a/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf b/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf index 89b330246..e3fa91279 100644 --- a/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf +++ b/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf @@ -17,7 +17,7 @@ stdout_logfile = /dev/stdout stdout_logfile_maxbytes = 0 [program:snmptrapd] -command = /usr/sbin/%(program_name)s -m '+ALL' -M /usr/share/snmp/mibs/:/var/lib/zabbix/mibs -f -n -Lo -p /var/run/snmptrapd.pid -C -c /etc/snmp/%(program_name)s.conf +command = /usr/sbin/%(program_name)s -m '+ALL' -M /usr/share/snmp/mibs/:/var/lib/zabbix/mibs -f -n -Lo -p /tmp/snmptrapd.pid -C -c /etc/snmp/%(program_name)s.conf udp:0.0.0.0:1162 auto_start = true autorestart = true priority = 100 diff --git a/web-nginx-mysql/alpine/docker-entrypoint.sh b/web-nginx-mysql/alpine/docker-entrypoint.sh index e7e2a97a4..2dc3da62c 100755 --- a/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -146,16 +146,13 @@ update_config_multiple_var() { # Check prerequisites for MySQL database check_variables() { - - DB_SERVER_HOST=${DB_SERVER_HOST:-"mysql-server"} - DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"} + : ${DB_SERVER_HOST:="mysql-server"} + : ${DB_SERVER_PORT:="3306"} USE_DB_ROOT_USER=false CREATE_ZBX_DB_USER=false file_env MYSQL_USER file_env MYSQL_PASSWORD - file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 @@ -175,16 +172,12 @@ check_variables() { [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials - DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} + : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}}.... [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} - if [ "$type" == "proxy" ]; then - DB_SERVER_DBNAME=${MYSQL_DATABASE:-"zabbix_proxy"} - else - DB_SERVER_DBNAME=${MYSQL_DATABASE:-"zabbix"} - fi + DB_SERVER_DBNAME=${MYSQL_DATABASE:-"zabbix"} } check_db_connect() { @@ -235,7 +228,6 @@ prepare_web_server() { fi ln -sf /dev/fd/2 /var/log/nginx/error.log - ln -sf /dev/fd/1 /var/log/php-fpm.log } clear_deploy() { diff --git a/web-nginx-pgsql/alpine/conf/etc/zabbix/web/zabbix.conf.php b/web-nginx-pgsql/alpine/conf/etc/zabbix/web/zabbix.conf.php index 6cbd68590..73c991b18 100644 --- a/web-nginx-pgsql/alpine/conf/etc/zabbix/web/zabbix.conf.php +++ b/web-nginx-pgsql/alpine/conf/etc/zabbix/web/zabbix.conf.php @@ -2,7 +2,7 @@ // Zabbix GUI configuration file. global $DB; -$DB['TYPE'] = 'MYSQL'; +$DB['TYPE'] = 'POSTGRESQL'; $DB['SERVER'] = '{DB_SERVER_HOST}'; $DB['PORT'] = '{DB_SERVER_PORT}'; $DB['DATABASE'] = '{DB_SERVER_DBNAME}'; diff --git a/web-nginx-pgsql/alpine/docker-entrypoint.sh b/web-nginx-pgsql/alpine/docker-entrypoint.sh index 962e05eb7..07fe044b7 100755 --- a/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -228,7 +228,6 @@ prepare_web_server() { fi ln -sf /dev/fd/2 /var/log/nginx/error.log - ln -sf /dev/fd/1 /var/log/php-fpm.log } clear_deploy() {