diff --git a/java-gateway/alpine/README.md b/java-gateway/alpine/README.md index 742b7d8bd..a0fa06119 100644 --- a/java-gateway/alpine/README.md +++ b/java-gateway/alpine/README.md @@ -18,13 +18,13 @@ These are the only official Zabbix Java Gateway Docker images. They are based on Zabbix Java Gateway 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) Zabbix Java Gateway 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) - Zabbix Java Gateway 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2.*) (unsupported) + Zabbix Java Gateway 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported) Zabbix Java Gateway 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported) - Zabbix Java Gateway 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4.*) (unsupported) + Zabbix Java Gateway 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported) Zabbix Java Gateway 3.4.* (tags: alpine-3.4.*, ubuntu-3.4.*, centos-3.4.*) (unsupported) Zabbix Java Gateway 4.0 (tags: alpine-4.0-latest, ubuntu-4.0-latest, centos-4.0-latest) Zabbix Java Gateway 4.0.* (tags: alpine-4.0.*, ubuntu-4.0.*, centos-4.0.*) - Zabbix Java Gateway 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2.*) (unsupported) + Zabbix Java Gateway 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2-latest) (unsupported) Zabbix Java Gateway 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix Java Gateway 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix Java Gateway 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) diff --git a/java-gateway/centos/README.md b/java-gateway/centos/README.md index 742b7d8bd..a0fa06119 100644 --- a/java-gateway/centos/README.md +++ b/java-gateway/centos/README.md @@ -18,13 +18,13 @@ These are the only official Zabbix Java Gateway Docker images. They are based on Zabbix Java Gateway 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) Zabbix Java Gateway 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) - Zabbix Java Gateway 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2.*) (unsupported) + Zabbix Java Gateway 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported) Zabbix Java Gateway 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported) - Zabbix Java Gateway 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4.*) (unsupported) + Zabbix Java Gateway 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported) Zabbix Java Gateway 3.4.* (tags: alpine-3.4.*, ubuntu-3.4.*, centos-3.4.*) (unsupported) Zabbix Java Gateway 4.0 (tags: alpine-4.0-latest, ubuntu-4.0-latest, centos-4.0-latest) Zabbix Java Gateway 4.0.* (tags: alpine-4.0.*, ubuntu-4.0.*, centos-4.0.*) - Zabbix Java Gateway 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2.*) (unsupported) + Zabbix Java Gateway 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2-latest) (unsupported) Zabbix Java Gateway 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix Java Gateway 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix Java Gateway 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) diff --git a/java-gateway/ubuntu/README.md b/java-gateway/ubuntu/README.md index 742b7d8bd..a0fa06119 100644 --- a/java-gateway/ubuntu/README.md +++ b/java-gateway/ubuntu/README.md @@ -18,13 +18,13 @@ These are the only official Zabbix Java Gateway Docker images. They are based on Zabbix Java Gateway 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) Zabbix Java Gateway 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) - Zabbix Java Gateway 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2.*) (unsupported) + Zabbix Java Gateway 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported) Zabbix Java Gateway 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported) - Zabbix Java Gateway 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4.*) (unsupported) + Zabbix Java Gateway 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported) Zabbix Java Gateway 3.4.* (tags: alpine-3.4.*, ubuntu-3.4.*, centos-3.4.*) (unsupported) Zabbix Java Gateway 4.0 (tags: alpine-4.0-latest, ubuntu-4.0-latest, centos-4.0-latest) Zabbix Java Gateway 4.0.* (tags: alpine-4.0.*, ubuntu-4.0.*, centos-4.0.*) - Zabbix Java Gateway 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2.*) (unsupported) + Zabbix Java Gateway 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2-latest) (unsupported) Zabbix Java Gateway 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix Java Gateway 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix Java Gateway 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) diff --git a/server-mysql/alpine/README.md b/server-mysql/alpine/README.md index 60d34aa33..d19c3cd8e 100644 --- a/server-mysql/alpine/README.md +++ b/server-mysql/alpine/README.md @@ -20,13 +20,13 @@ These are the only official Zabbix server Docker images. They are based on Alpin Zabbix server 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) Zabbix server 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) - Zabbix server 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2.*) (unsupported) + Zabbix server 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported) Zabbix server 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported) - Zabbix server 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4.*) (unsupported) + Zabbix server 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported) Zabbix server 3.4.* (tags: alpine-3.4.*, ubuntu-3.4.*, centos-3.4.*) (unsupported) Zabbix server 4.0 (tags: alpine-4.0-latest, ubuntu-4.0-latest, centos-4.0-latest) Zabbix server 4.0.* (tags: alpine-4.0.*, ubuntu-4.0.*, centos-4.0.*) - Zabbix server 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2.*) (unsupported) + Zabbix server 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2-latest) (unsupported) Zabbix server 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix server 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix server 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) diff --git a/server-mysql/centos/README.md b/server-mysql/centos/README.md index 60d34aa33..d19c3cd8e 100644 --- a/server-mysql/centos/README.md +++ b/server-mysql/centos/README.md @@ -20,13 +20,13 @@ These are the only official Zabbix server Docker images. They are based on Alpin Zabbix server 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) Zabbix server 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) - Zabbix server 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2.*) (unsupported) + Zabbix server 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported) Zabbix server 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported) - Zabbix server 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4.*) (unsupported) + Zabbix server 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported) Zabbix server 3.4.* (tags: alpine-3.4.*, ubuntu-3.4.*, centos-3.4.*) (unsupported) Zabbix server 4.0 (tags: alpine-4.0-latest, ubuntu-4.0-latest, centos-4.0-latest) Zabbix server 4.0.* (tags: alpine-4.0.*, ubuntu-4.0.*, centos-4.0.*) - Zabbix server 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2.*) (unsupported) + Zabbix server 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2-latest) (unsupported) Zabbix server 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix server 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix server 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) diff --git a/server-mysql/ubuntu/README.md b/server-mysql/ubuntu/README.md index 60d34aa33..d19c3cd8e 100644 --- a/server-mysql/ubuntu/README.md +++ b/server-mysql/ubuntu/README.md @@ -20,13 +20,13 @@ These are the only official Zabbix server Docker images. They are based on Alpin Zabbix server 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, centos-3.0-latest) Zabbix server 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*, centos-3.0.*) - Zabbix server 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2.*) (unsupported) + Zabbix server 3.2 (tags: alpine-3.2-latest, ubuntu-3.2-latest, centos-3.2-latest) (unsupported) Zabbix server 3.2.* (tags: alpine-3.2.*, ubuntu-3.2.*, centos-3.2.*) (unsupported) - Zabbix server 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4.*) (unsupported) + Zabbix server 3.4 (tags: alpine-3.4-latest, ubuntu-3.4-latest, centos-3.4-latest) (unsupported) Zabbix server 3.4.* (tags: alpine-3.4.*, ubuntu-3.4.*, centos-3.4.*) (unsupported) Zabbix server 4.0 (tags: alpine-4.0-latest, ubuntu-4.0-latest, centos-4.0-latest) Zabbix server 4.0.* (tags: alpine-4.0.*, ubuntu-4.0.*, centos-4.0.*) - Zabbix server 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2.*) (unsupported) + Zabbix server 4.2 (tags: alpine-4.2-latest, ubuntu-4.2-latest, centos-4.2-latest) (unsupported) Zabbix server 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix server 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix server 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) diff --git a/snmptraps/alpine/Dockerfile b/snmptraps/alpine/Dockerfile index 98ce0fdce..ce21756f4 100644 --- a/snmptraps/alpine/Dockerfile +++ b/snmptraps/alpine/Dockerfile @@ -11,16 +11,13 @@ LABEL org.opencontainers.image.title="zabbix-snmptraps-alpine" \ org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.url="https://zabbix.com/" \ - org.opencontainers.image.description="Zabbix server with MySQL database support" \ + org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.licenses="GPL v2.0" \ - org.opencontainers.image.documentation="Zabbix SNMP traps receiver" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" + org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM -COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] - RUN set -eux && \ addgroup -S -g 1995 zabbix && \ adduser -S \ @@ -31,40 +28,14 @@ RUN set -eux && \ apk update && \ apk add --clean-protected --no-cache \ tzdata \ - net-snmp \ - supervisor && \ - apk add --no-cache --virtual build-dependencies \ - alpine-sdk \ - autoconf \ - automake \ - libnsl-dev \ - net-snmp-dev && \ + net-snmp && \ + touch /var/lib/net-snmp/snmptrapd.conf && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/mibs && \ - cd /tmp/ && \ - tar -zxvf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ - 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 && \ - cp snmptrapfmt.conf /etc/snmp/snmptrapfmt.conf && \ - echo "disableAuthorization yes" >> "/etc/snmp/snmptrapd.conf" && \ - echo "traphandle default /usr/sbin/snmptrapfmthdlr" >> "/etc/snmp/snmptrapd.conf" && \ - sed -i \ - -e "/^VARFMT=/s/=.*/=\"%n %v \"/" \ - -e '/^LOGFMT=/s/=.*/=\"$x ZBXTRAP $R $G $S $e $*\"/' \ - -e "/^LOGFILE=/s/=.*/=\"\/var\/lib\/zabbix\/snmptraps\/snmptraps.log\"/" \ - "/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 /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 1162/UDP @@ -73,9 +44,9 @@ WORKDIR /var/lib/zabbix/snmptraps/ VOLUME ["/var/lib/zabbix/snmptraps"] -COPY ["conf/etc/supervisor/", "/etc/supervisor/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] +COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] USER 1997 -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] +CMD ["/usr/sbin/snmptrapd", "-n", "-C", "-c", "/etc/snmp/snmptrapd.conf", "-Lo", "-A"] diff --git a/snmptraps/alpine/conf/etc/snmp/snmptrapd.conf b/snmptraps/alpine/conf/etc/snmp/snmptrapd.conf new file mode 100644 index 000000000..6b6d2e31f --- /dev/null +++ b/snmptraps/alpine/conf/etc/snmp/snmptrapd.conf @@ -0,0 +1,13 @@ +snmpTrapdAddr udp:0.0.0.0:1162 + +doNotFork yes +pidFile /tmp/snmptrapd.pid +doNotRetainNotificationLogs yes + +authCommunity log,execute,net public +disableAuthorization yes + +format1 %V\n%.4y%.2m%.2l.%.2h:%.2j:%.2k ZBXTRAP %A\n%b\n%v\n +format2 %V\n%.4y%.2m%.2l.%.2h:%.2j:%.2k ZBXTRAP %A\n%b\n%v\n + +[snmp] logOption f /var/lib/zabbix/snmptraps/snmptraps.log diff --git a/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf b/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf deleted file mode 100644 index e3fa91279..000000000 --- a/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf +++ /dev/null @@ -1,32 +0,0 @@ -[supervisord] -nodaemon = true - -[program:snmptrapfmt] -command = /usr/sbin/%(program_name)s -f /etc/snmp/%(program_name)s.conf -auto_start = true -autorestart = true -priority = 50 - -startsecs=3 -startretries=3 -stopsignal=TERM -stopwaitsecs=2 - -redirect_stderr=true -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 /tmp/snmptrapd.pid -C -c /etc/snmp/%(program_name)s.conf udp:0.0.0.0:1162 -auto_start = true -autorestart = true -priority = 100 - -startsecs=3 -startretries=3 -stopsignal=TERM -stopwaitsecs=2 - -redirect_stderr=true -stdout_logfile = /dev/stdout -stdout_logfile_maxbytes = 0 diff --git a/snmptraps/alpine/conf/etc/supervisor/supervisord.conf b/snmptraps/alpine/conf/etc/supervisor/supervisord.conf deleted file mode 100644 index f8d80e461..000000000 --- a/snmptraps/alpine/conf/etc/supervisor/supervisord.conf +++ /dev/null @@ -1,35 +0,0 @@ -; supervisor config file - -[unix_http_server] -file = /tmp/supervisor.sock ; (the path to the socket file) -chmod = 0700 ; sockef file mode (default 0700) -username = zbx -password = password - -[supervisord] -logfile = /dev/stdout ; (main log file;default $CWD/supervisord.log) -pidfile = /tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) -childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP) -critical = critical -;user = zabbix -logfile_maxbytes = 0 -logfile_backupcount = 0 -loglevel = info - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl = unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket - -; The [include] section can just contain the "files" setting. This -; setting can list multiple files (separated by whitespace or -; newlines). It can also contain wildcards. The filenames are -; interpreted as relative to this file. Included files *cannot* -; include files themselves. - -[include] -files = /etc/supervisor/conf.d/*.conf diff --git a/snmptraps/alpine/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz b/snmptraps/alpine/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz deleted file mode 100644 index 92804eb30..000000000 Binary files a/snmptraps/alpine/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz and /dev/null differ diff --git a/snmptraps/centos/Dockerfile b/snmptraps/centos/Dockerfile index f836f36b8..12b47f55a 100644 --- a/snmptraps/centos/Dockerfile +++ b/snmptraps/centos/Dockerfile @@ -14,13 +14,10 @@ LABEL org.opencontainers.image.title="zabbix-snmptraps-centos" \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM -COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] - RUN set -eux && \ groupadd -g 1995 --system zabbix && \ adduser -r --shell /sbin/nologin \ @@ -31,42 +28,14 @@ RUN set -eux && \ yum -y install epel-release && \ yum -y install --setopt=tsflags=nodocs \ tzdata \ - net-snmp \ - supervisor && \ - yum -y install --setopt=tsflags=nodocs \ - autoconf \ - automake \ - gcc \ - patch \ - make \ - libnsl-devel \ - net-snmp-devel && \ + net-snmp && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/mibs && \ - cd /tmp/ && \ - tar -zxvf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ - 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 && \ - cp snmptrapfmt.conf /etc/snmp/snmptrapfmt.conf && \ - echo "disableAuthorization yes" >> "/etc/snmp/snmptrapd.conf" && \ - echo "traphandle default /usr/sbin/snmptrapfmthdlr" >> "/etc/snmp/snmptrapd.conf" && \ - sed -i \ - -e "/^VARFMT=/s/=.*/=\"%n %v \"/" \ - -e '/^LOGFMT=/s/=.*/=\"$x ZBXTRAP $R $G $S $e $*\"/' \ - -e "/^LOGFILE=/s/=.*/=\"\/var\/lib\/zabbix\/snmptraps\/snmptraps.log\"/" \ - "/etc/snmp/snmptrapfmt.conf" && \ - rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ - rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ + touch /var/lib/net-snmp/snmptrapd.conf && \ 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/ && \ - yum -y history undo `yum -q history | sed -n 3p |column -t | cut -d' ' -f1` && \ yum -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki @@ -77,9 +46,9 @@ WORKDIR /var/lib/zabbix/snmptraps/ VOLUME ["/var/lib/zabbix/snmptraps"] -COPY ["conf/etc/supervisor/", "/etc/supervisor/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] +COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] USER 1997 -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] +CMD ["/usr/sbin/snmptrapd", "-n", "-C", "-c", "/etc/snmp/snmptrapd.conf", "-Lo", "-A"] diff --git a/snmptraps/centos/conf/etc/snmp/snmptrapd.conf b/snmptraps/centos/conf/etc/snmp/snmptrapd.conf new file mode 100644 index 000000000..6b6d2e31f --- /dev/null +++ b/snmptraps/centos/conf/etc/snmp/snmptrapd.conf @@ -0,0 +1,13 @@ +snmpTrapdAddr udp:0.0.0.0:1162 + +doNotFork yes +pidFile /tmp/snmptrapd.pid +doNotRetainNotificationLogs yes + +authCommunity log,execute,net public +disableAuthorization yes + +format1 %V\n%.4y%.2m%.2l.%.2h:%.2j:%.2k ZBXTRAP %A\n%b\n%v\n +format2 %V\n%.4y%.2m%.2l.%.2h:%.2j:%.2k ZBXTRAP %A\n%b\n%v\n + +[snmp] logOption f /var/lib/zabbix/snmptraps/snmptraps.log diff --git a/snmptraps/centos/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf b/snmptraps/centos/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf deleted file mode 100644 index 201b52c92..000000000 --- a/snmptraps/centos/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf +++ /dev/null @@ -1,32 +0,0 @@ -[supervisord] -nodaemon = true - -[program:snmptrapfmt] -command = /usr/sbin/%(program_name)s -f /etc/snmp/%(program_name)s.conf -auto_start = true -autorestart = true -priority = 50 - -startsecs=3 -startretries=3 -stopsignal=TERM -stopwaitsecs=2 - -redirect_stderr=true -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 udp:0.0.0.0:1162 -auto_start = true -autorestart = true -priority = 100 - -startsecs=3 -startretries=3 -stopsignal=TERM -stopwaitsecs=2 - -redirect_stderr=true -stdout_logfile = /dev/stdout -stdout_logfile_maxbytes = 0 diff --git a/snmptraps/centos/conf/etc/supervisor/supervisord.conf b/snmptraps/centos/conf/etc/supervisor/supervisord.conf deleted file mode 100644 index f8d80e461..000000000 --- a/snmptraps/centos/conf/etc/supervisor/supervisord.conf +++ /dev/null @@ -1,35 +0,0 @@ -; supervisor config file - -[unix_http_server] -file = /tmp/supervisor.sock ; (the path to the socket file) -chmod = 0700 ; sockef file mode (default 0700) -username = zbx -password = password - -[supervisord] -logfile = /dev/stdout ; (main log file;default $CWD/supervisord.log) -pidfile = /tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) -childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP) -critical = critical -;user = zabbix -logfile_maxbytes = 0 -logfile_backupcount = 0 -loglevel = info - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl = unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket - -; The [include] section can just contain the "files" setting. This -; setting can list multiple files (separated by whitespace or -; newlines). It can also contain wildcards. The filenames are -; interpreted as relative to this file. Included files *cannot* -; include files themselves. - -[include] -files = /etc/supervisor/conf.d/*.conf diff --git a/snmptraps/centos/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz b/snmptraps/centos/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz deleted file mode 100644 index 92804eb30..000000000 Binary files a/snmptraps/centos/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz and /dev/null differ diff --git a/snmptraps/ubuntu/Dockerfile b/snmptraps/ubuntu/Dockerfile index eef72fd0e..691cd6600 100644 --- a/snmptraps/ubuntu/Dockerfile +++ b/snmptraps/ubuntu/Dockerfile @@ -1,11 +1,11 @@ -FROM ubuntu:bionic +FROM ubuntu:focal ARG MAJOR_VERSION=5.4 ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ - MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL + MIBDIRS=/var/lib/snmp/mibs/ietf:/var/lib/snmp/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL LABEL org.opencontainers.image.title="zabbix-snmptraps-ubuntu" \ org.opencontainers.image.authors="Alexey Pustovalov " \ @@ -14,15 +14,12 @@ LABEL org.opencontainers.image.title="zabbix-snmptraps-ubuntu" \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM -COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] - RUN set -eux && \ - echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ + echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ addgroup --system --gid 1995 --quiet zabbix && \ adduser --quiet \ --system --disabled-login \ @@ -34,51 +31,14 @@ RUN set -eux && \ DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ tzdata \ snmp-mibs-downloader \ - snmptrapd \ - supervisor && \ + snmptrapd && \ download-mibs && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - autoconf \ - automake \ - gcc \ - patch \ - make \ - libc6-dev \ - libsnmp-dev && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/mibs && \ - cd /tmp/ && \ - tar -zxvf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ - 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 && \ - cp snmptrapfmt.conf /etc/snmp/snmptrapfmt.conf && \ - echo "disableAuthorization yes" >> "/etc/snmp/snmptrapd.conf" && \ - echo "traphandle default /usr/sbin/snmptrapfmthdlr" >> "/etc/snmp/snmptrapd.conf" && \ - sed -i \ - -e "/^VARFMT=/s/=.*/=\"%n %v \"/" \ - -e '/^LOGFMT=/s/=.*/=\"$x ZBXTRAP $R $G $S $e $*\"/' \ - -e "/^LOGFILE=/s/=.*/=\"\/var\/lib\/zabbix\/snmptraps\/snmptraps.log\"/" \ - "/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 /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/ && \ - DEBIAN_FRONTEND=noninteractive apt-get -y purge \ - autoconf \ - automake \ - gcc \ - patch \ - make \ - libc6-dev \ - libsnmp-dev && \ - apt-get -y autoremove && \ rm -rf /var/lib/apt/lists/* EXPOSE 1162/UDP @@ -87,9 +47,9 @@ WORKDIR /var/lib/zabbix/snmptraps/ VOLUME ["/var/lib/zabbix/snmptraps"] -COPY ["conf/etc/supervisor/", "/etc/supervisor/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] +COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] USER 1997 -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] +CMD ["/usr/sbin/snmptrapd", "-n", "-C", "-c", "/etc/snmp/snmptrapd.conf", "-Lo", "-A"] diff --git a/snmptraps/ubuntu/conf/etc/snmp/snmptrapd.conf b/snmptraps/ubuntu/conf/etc/snmp/snmptrapd.conf new file mode 100644 index 000000000..6b6d2e31f --- /dev/null +++ b/snmptraps/ubuntu/conf/etc/snmp/snmptrapd.conf @@ -0,0 +1,13 @@ +snmpTrapdAddr udp:0.0.0.0:1162 + +doNotFork yes +pidFile /tmp/snmptrapd.pid +doNotRetainNotificationLogs yes + +authCommunity log,execute,net public +disableAuthorization yes + +format1 %V\n%.4y%.2m%.2l.%.2h:%.2j:%.2k ZBXTRAP %A\n%b\n%v\n +format2 %V\n%.4y%.2m%.2l.%.2h:%.2j:%.2k ZBXTRAP %A\n%b\n%v\n + +[snmp] logOption f /var/lib/zabbix/snmptraps/snmptraps.log diff --git a/snmptraps/ubuntu/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf b/snmptraps/ubuntu/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf deleted file mode 100644 index c40417824..000000000 --- a/snmptraps/ubuntu/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf +++ /dev/null @@ -1,32 +0,0 @@ -[supervisord] -nodaemon = true - -[program:snmptrapfmt] -command = /usr/sbin/%(program_name)s -f /etc/snmp/%(program_name)s.conf -auto_start = true -autorestart = true -priority = 50 - -startsecs=3 -startretries=3 -stopsignal=TERM -stopwaitsecs=2 - -redirect_stderr=true -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/snmp/mibs/iana:/var/lib/snmp/mibs/ietf:/var/lib/zabbix/mibs -f -n -Lo -p /var/run/snmptrapd.pid -C -c /etc/snmp/%(program_name)s.conf udp:0.0.0.0:1162 -auto_start = true -autorestart = true -priority = 100 - -startsecs=3 -startretries=3 -stopsignal=TERM -stopwaitsecs=2 - -redirect_stderr=true -stdout_logfile = /dev/stdout -stdout_logfile_maxbytes = 0 diff --git a/snmptraps/ubuntu/conf/etc/supervisor/supervisord.conf b/snmptraps/ubuntu/conf/etc/supervisor/supervisord.conf deleted file mode 100644 index f8d80e461..000000000 --- a/snmptraps/ubuntu/conf/etc/supervisor/supervisord.conf +++ /dev/null @@ -1,35 +0,0 @@ -; supervisor config file - -[unix_http_server] -file = /tmp/supervisor.sock ; (the path to the socket file) -chmod = 0700 ; sockef file mode (default 0700) -username = zbx -password = password - -[supervisord] -logfile = /dev/stdout ; (main log file;default $CWD/supervisord.log) -pidfile = /tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) -childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP) -critical = critical -;user = zabbix -logfile_maxbytes = 0 -logfile_backupcount = 0 -loglevel = info - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl = unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket - -; The [include] section can just contain the "files" setting. This -; setting can list multiple files (separated by whitespace or -; newlines). It can also contain wildcards. The filenames are -; interpreted as relative to this file. Included files *cannot* -; include files themselves. - -[include] -files = /etc/supervisor/conf.d/*.conf diff --git a/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz b/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz deleted file mode 100644 index 92804eb30..000000000 Binary files a/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz and /dev/null differ diff --git a/web-nginx-pgsql/alpine/Dockerfile b/web-nginx-pgsql/alpine/Dockerfile index 0575ce9b6..23173b99f 100644 --- a/web-nginx-pgsql/alpine/Dockerfile +++ b/web-nginx-pgsql/alpine/Dockerfile @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.url="https://zabbix.com/" \ - org.opencontainers.image.description="abbix web-interface based on Nginx web server with PostgreSQL database support" \ + org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ org.opencontainers.image.licenses="GPL v2.0" STOPSIGNAL SIGTERM