diff --git a/java-gateway/alpine/Dockerfile b/java-gateway/alpine/Dockerfile index 72ebf947e..2ef662688 100644 --- a/java-gateway/alpine/Dockerfile +++ b/java-gateway/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.4 +FROM alpine:3.7 LABEL maintainer="Alexey Pustovalov " ARG BUILD_DATE diff --git a/snmptraps/alpine/.dockerignore b/snmptraps/alpine/.dockerignore new file mode 100644 index 000000000..c07a74de4 --- /dev/null +++ b/snmptraps/alpine/.dockerignore @@ -0,0 +1 @@ +build.sh \ No newline at end of file diff --git a/snmptraps/alpine/Dockerfile b/snmptraps/alpine/Dockerfile new file mode 100644 index 000000000..185c72ac2 --- /dev/null +++ b/snmptraps/alpine/Dockerfile @@ -0,0 +1,85 @@ +FROM alpine:3.7 +LABEL maintainer "Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG APK_FLAGS_COMMON="-q" +ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache" +ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache" +ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL + +LABEL org.label-schema.name="zabbix-snmptraps-alpine" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix SNMP traps receiver" \ + org.label-schema.vcs-ref="${VCS_REF}" \ + org.label-schema.build-date="${BUILD_DATE}" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.license="GPL 2.0" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="1.14" \ + org.label-schema.vcs-url="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" \ + org.label-schema.docker.cmd="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:162/UDP -d zabbix-snmptraps:alpine-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] + +RUN addgroup zabbix && \ + adduser -S \ + -D -G zabbix \ + -h /var/lib/zabbix/ \ + zabbix && \ + apk update && \ + apk add ${APK_FLAGS_PERSISTANT} \ + net-snmp \ + supervisor && \ + apk add ${APK_FLAGS_DEV} --virtual build-dependencies \ + alpine-sdk \ + autoconf \ + automake \ + libnsl-dev \ + net-snmp-dev && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/mibs && \ + chown --quiet -R zabbix:root /var/lib/zabbix && \ + cd /tmp/ && \ + tar -zxvf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ + ls -lah && \ + cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ + patch -p1 < ./patches/makefile.patch && \ + make -j"$(nproc)" -s 1>/dev/null && \ + 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 1>/dev/null && \ + rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ 1>/dev/null && \ + apk del ${APK_FLAGS_COMMON} --purge \ + build-dependencies && \ + rm -rf /var/cache/apk/* + +EXPOSE 162/UDP + +WORKDIR /var/lib/zabbix/snmptraps/ + +VOLUME ["/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"] + +COPY ["conf/etc/supervisor/", "/etc/supervisor/"] +COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/snmptraps/alpine/README.md b/snmptraps/alpine/README.md new file mode 100644 index 000000000..af6f825d1 --- /dev/null +++ b/snmptraps/alpine/README.md @@ -0,0 +1,89 @@ +![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) + +# What is Zabbix? + +Zabbix is an enterprise-class open source distributed monitoring solution. + +Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning. + +For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com + +# What is the image? + +The image is used to receive SNMP traps, store them to a log file and provide access to Zabbix to collected SNMP trap messsages. + +# Zabbix snmptraps images + +These are the only official Zabbix snmptraps Docker images. They are based on trusty Ubuntu. The available versions of Zabbix snmptraps are: + + Zabbix snmptraps 3.0 (tags: ubuntu-3.0-latest) + Zabbix snmptraps 3.0.* (tags: ubuntu-3.0.*) + Zabbix snmptraps 3.2 (tags: ubuntu-3.2-latest, ubuntu-latest, latest) + Zabbix snmptraps 3.2.* (tags: ubuntu-3.2.*) + Zabbix snmptraps 3.4 (tags: ubuntu-trunk) + +Images are updated when new releases are published. + +# How to use this image + +## Start `zabbix-snmptraps` + +Start a Zabbix snmptraps container as follows: + + docker run --name some-zabbix-snmptraps -d zabbix/zabbix-snmptraps:tag + +Where `some-zabbix-snmptraps` is the name you want to assign to your container and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-snmptraps/tags/). + +## Linking Zabbix server or Zabbix proxy with the container + + docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -d zabbix/zabbix-server:tag + +## Container shell access and viewing Zabbix snmptraps logs + +The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-snmptraps` container: + +```console +$ docker exec -ti some-zabbix-snmptraps /bin/bash +``` + +The Zabbix snmptraps log is available through Docker's container log: + +```console +$ docker logs some-zabbix-snmptraps +``` + +## Allowed volumes for the Zabbix snmptraps container + +### ``/var/lib/zabbix/snmptraps`` + +The volume contains log file ``snmptraps.log`` named with received SNMP traps. + +### ``/var/lib/zabbix/mibs`` + +The volume allows to add new MIB files. It does not support subdirectories, all MIBs must be placed to ``/var/lib/zabbix/mibs``. + +# Supported Docker versions + +This image is officially supported on Docker version 1.12.0. + +Support for older versions (down to 1.6) is provided on a best-effort basis. + +Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon. + +# User Feedback + +## Documentation + +Documentation for this image is stored in the [`snmptraps/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/snmptraps) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request. + +## Issues + +If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues). + +### Known issues + +## Contributing + +You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can. + +Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing. diff --git a/snmptraps/alpine/build.sh b/snmptraps/alpine/build.sh new file mode 100755 index 000000000..5b31ed50f --- /dev/null +++ b/snmptraps/alpine/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +os=${PWD##*/} + +version=$1 +version=${version:-"latest"} + +cd ../ +app_component=${PWD##*/} +cd $os/ + +if [[ ! $version =~ ^[0-9]*\.[0-9]*\.[0-9]*$ ]] && [ "$version" != "latest" ]; then + echo "Incorrect syntax of the version" + exit 1 +fi + +if [ "$version" != "latest" ]; then + VCS_REF=`svn info svn://svn.zabbix.com/tags/$version |grep "Last Changed Rev"|awk '{print $4;}'` +fi + +docker build -t zabbix-$app_component:$os-$version --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -f Dockerfile . + +#docker rm -f zabbix-$app_component +#docker run --name zabbix-$app_component -t -d zabbix-$app_component:$os-$version diff --git a/snmptraps/alpine/conf/etc/logrotate.d/zabbix_snmptraps b/snmptraps/alpine/conf/etc/logrotate.d/zabbix_snmptraps new file mode 100644 index 000000000..70d611eee --- /dev/null +++ b/snmptraps/alpine/conf/etc/logrotate.d/zabbix_snmptraps @@ -0,0 +1,8 @@ +# https://support.zabbix.com/browse/ZBX-9858 +/var/lib/zabbix/snmptraps/snmptraps.log { + missingok + daily + rotate 0 + minsize 50M notifempty + su zabbix zabbix +} diff --git a/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf b/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf new file mode 100644 index 000000000..6a4c9a4af --- /dev/null +++ b/snmptraps/alpine/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf @@ -0,0 +1,32 @@ +[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 -f -n -Lo -p /var/run/snmptrapd.pid -c /etc/snmp/%(program_name)s.conf +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 new file mode 100644 index 000000000..925bb1838 --- /dev/null +++ b/snmptraps/alpine/conf/etc/supervisor/supervisord.conf @@ -0,0 +1,35 @@ +; supervisor config file + +[unix_http_server] +file = /var/run/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 = /var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP) +critical = critical +user = root +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:///var/run/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 new file mode 100644 index 000000000..aef450e2c Binary files /dev/null and b/snmptraps/alpine/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz differ diff --git a/snmptraps/centos/.dockerignore b/snmptraps/centos/.dockerignore new file mode 100644 index 000000000..88a84e55a --- /dev/null +++ b/snmptraps/centos/.dockerignore @@ -0,0 +1 @@ +build.sh diff --git a/snmptraps/centos/Dockerfile b/snmptraps/centos/Dockerfile new file mode 100644 index 000000000..b6fe68ef1 --- /dev/null +++ b/snmptraps/centos/Dockerfile @@ -0,0 +1,94 @@ +FROM centos:centos7 +LABEL maintainer "Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" +ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL + +LABEL org.label-schema.name="zabbix-snmptraps-centos" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix SNMP traps receiver" \ + org.label-schema.vcs-ref="${VCS_REF}" \ + org.label-schema.build-date="${BUILD_DATE}" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.license="GPL 2.0" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="1.14" \ + org.label-schema.vcs-url="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" \ + org.label-schema.docker.cmd="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:162/UDP -d zabbix-snmptraps:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix \ + -d /var/lib/zabbix/ \ + zabbix && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_DEV} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + net-snmp \ + supervisor && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + autoconf \ + automake \ + gcc \ + patch \ + make \ + libnsl-devel \ + net-snmp-devel && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/mibs && \ + chown --quiet -R zabbix:root /var/lib/zabbix && \ + cd /tmp/ && \ + tar -zxf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ + ls -lah && \ + cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ + patch -p1 < ./patches/makefile.patch && \ + make -j"$(nproc)" -s 1>/dev/null && \ + 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 1>/dev/null && \ + rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ 1>/dev/null && \ + yum history && \ + yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ + yum ${YUM_FLAGS_COMMON} clean all && \ + rm -rf /etc/udev/hwdb.bin && \ + rm -rf /var/cache/yum && \ + rm -rf /var/lib/yum/yumdb/* && \ + rm -rf /usr/lib/udev/hwdb.d/* && \ + rm -rf /root/.pki && \ + rm -rf /root/.subversion + +EXPOSE 162/UDP + +WORKDIR /var/lib/zabbix/snmptraps/ + +VOLUME ["/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"] + +COPY ["conf/etc/supervisor/", "/etc/supervisor/"] +COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/snmptraps/centos/README.md b/snmptraps/centos/README.md new file mode 100644 index 000000000..af6f825d1 --- /dev/null +++ b/snmptraps/centos/README.md @@ -0,0 +1,89 @@ +![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) + +# What is Zabbix? + +Zabbix is an enterprise-class open source distributed monitoring solution. + +Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning. + +For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com + +# What is the image? + +The image is used to receive SNMP traps, store them to a log file and provide access to Zabbix to collected SNMP trap messsages. + +# Zabbix snmptraps images + +These are the only official Zabbix snmptraps Docker images. They are based on trusty Ubuntu. The available versions of Zabbix snmptraps are: + + Zabbix snmptraps 3.0 (tags: ubuntu-3.0-latest) + Zabbix snmptraps 3.0.* (tags: ubuntu-3.0.*) + Zabbix snmptraps 3.2 (tags: ubuntu-3.2-latest, ubuntu-latest, latest) + Zabbix snmptraps 3.2.* (tags: ubuntu-3.2.*) + Zabbix snmptraps 3.4 (tags: ubuntu-trunk) + +Images are updated when new releases are published. + +# How to use this image + +## Start `zabbix-snmptraps` + +Start a Zabbix snmptraps container as follows: + + docker run --name some-zabbix-snmptraps -d zabbix/zabbix-snmptraps:tag + +Where `some-zabbix-snmptraps` is the name you want to assign to your container and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-snmptraps/tags/). + +## Linking Zabbix server or Zabbix proxy with the container + + docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -d zabbix/zabbix-server:tag + +## Container shell access and viewing Zabbix snmptraps logs + +The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-snmptraps` container: + +```console +$ docker exec -ti some-zabbix-snmptraps /bin/bash +``` + +The Zabbix snmptraps log is available through Docker's container log: + +```console +$ docker logs some-zabbix-snmptraps +``` + +## Allowed volumes for the Zabbix snmptraps container + +### ``/var/lib/zabbix/snmptraps`` + +The volume contains log file ``snmptraps.log`` named with received SNMP traps. + +### ``/var/lib/zabbix/mibs`` + +The volume allows to add new MIB files. It does not support subdirectories, all MIBs must be placed to ``/var/lib/zabbix/mibs``. + +# Supported Docker versions + +This image is officially supported on Docker version 1.12.0. + +Support for older versions (down to 1.6) is provided on a best-effort basis. + +Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon. + +# User Feedback + +## Documentation + +Documentation for this image is stored in the [`snmptraps/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/snmptraps) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request. + +## Issues + +If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues). + +### Known issues + +## Contributing + +You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can. + +Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing. diff --git a/snmptraps/centos/build.sh b/snmptraps/centos/build.sh new file mode 100755 index 000000000..5b31ed50f --- /dev/null +++ b/snmptraps/centos/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +os=${PWD##*/} + +version=$1 +version=${version:-"latest"} + +cd ../ +app_component=${PWD##*/} +cd $os/ + +if [[ ! $version =~ ^[0-9]*\.[0-9]*\.[0-9]*$ ]] && [ "$version" != "latest" ]; then + echo "Incorrect syntax of the version" + exit 1 +fi + +if [ "$version" != "latest" ]; then + VCS_REF=`svn info svn://svn.zabbix.com/tags/$version |grep "Last Changed Rev"|awk '{print $4;}'` +fi + +docker build -t zabbix-$app_component:$os-$version --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -f Dockerfile . + +#docker rm -f zabbix-$app_component +#docker run --name zabbix-$app_component -t -d zabbix-$app_component:$os-$version diff --git a/snmptraps/centos/conf/etc/logrotate.d/zabbix_snmptraps b/snmptraps/centos/conf/etc/logrotate.d/zabbix_snmptraps new file mode 100644 index 000000000..70d611eee --- /dev/null +++ b/snmptraps/centos/conf/etc/logrotate.d/zabbix_snmptraps @@ -0,0 +1,8 @@ +# https://support.zabbix.com/browse/ZBX-9858 +/var/lib/zabbix/snmptraps/snmptraps.log { + missingok + daily + rotate 0 + minsize 50M notifempty + su zabbix zabbix +} diff --git a/snmptraps/centos/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf b/snmptraps/centos/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf new file mode 100644 index 000000000..6a4c9a4af --- /dev/null +++ b/snmptraps/centos/conf/etc/supervisor/conf.d/supervisord_snmptraps.conf @@ -0,0 +1,32 @@ +[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 -f -n -Lo -p /var/run/snmptrapd.pid -c /etc/snmp/%(program_name)s.conf +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 new file mode 100644 index 000000000..925bb1838 --- /dev/null +++ b/snmptraps/centos/conf/etc/supervisor/supervisord.conf @@ -0,0 +1,35 @@ +; supervisor config file + +[unix_http_server] +file = /var/run/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 = /var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP) +critical = critical +user = root +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:///var/run/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 new file mode 100644 index 000000000..aef450e2c Binary files /dev/null and b/snmptraps/centos/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz differ diff --git a/snmptraps/ubuntu/Dockerfile b/snmptraps/ubuntu/Dockerfile index 1591dc21b..485d56aa0 100644 --- a/snmptraps/ubuntu/Dockerfile +++ b/snmptraps/ubuntu/Dockerfile @@ -19,8 +19,8 @@ LABEL org.label-schema.name="zabbix-snmptraps-ubuntu" \ org.label-schema.schema-version="1.0" \ org.label-schema.license="GPL 2.0" -ARG MAJOR_VERSION=3.0 -ARG ZBX_VERSION=${MAJOR_VERSION}.14 +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} diff --git a/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz b/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz index a32e1053f..aef450e2c 100644 Binary files a/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz and b/snmptraps/ubuntu/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz differ diff --git a/web-apache-mysql/alpine/Dockerfile b/web-apache-mysql/alpine/Dockerfile index 77d68386f..c639e9bfe 100644 --- a/web-apache-mysql/alpine/Dockerfile +++ b/web-apache-mysql/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.4 +FROM alpine:3.7 LABEL maintainer="Alexey Pustovalov " ARG BUILD_DATE diff --git a/web-apache-pgsql/alpine/Dockerfile b/web-apache-pgsql/alpine/Dockerfile index b73705995..356f1558a 100644 --- a/web-apache-pgsql/alpine/Dockerfile +++ b/web-apache-pgsql/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.4 +FROM alpine:3.7 LABEL maintainer="Alexey Pustovalov " ARG BUILD_DATE diff --git a/web-nginx-mysql/alpine/Dockerfile b/web-nginx-mysql/alpine/Dockerfile index e183e2032..07b216647 100644 --- a/web-nginx-mysql/alpine/Dockerfile +++ b/web-nginx-mysql/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.4 +FROM alpine:3.7 LABEL maintainer="Alexey Pustovalov " ARG BUILD_DATE diff --git a/web-nginx-pgsql/alpine/Dockerfile b/web-nginx-pgsql/alpine/Dockerfile index 493d41c1f..d10db63e1 100644 --- a/web-nginx-pgsql/alpine/Dockerfile +++ b/web-nginx-pgsql/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.4 +FROM alpine:3.7 LABEL maintainer="Alexey Pustovalov " ARG BUILD_DATE diff --git a/zabbix-appliance/alpine/Dockerfile b/zabbix-appliance/alpine/Dockerfile index eddc4b193..9e45ae589 100644 --- a/zabbix-appliance/alpine/Dockerfile +++ b/zabbix-appliance/alpine/Dockerfile @@ -82,7 +82,7 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ org.label-schema.version="${ZBX_VERSION}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix -p 80:80 -p 10051:10051 -d zabbix:alpine-${ZBX_VERSION}" + org.label-schema.docker.cmd="docker run --name zabbix-appliance -p 80:80 -p 10051:10051 -d zabbix-appliance:alpine-${ZBX_VERSION}" COPY ["conf/tmp/font-config", "/tmp/font-config"] diff --git a/zabbix-appliance/centos/Dockerfile b/zabbix-appliance/centos/Dockerfile index a5f1d477c..afd391dec 100644 --- a/zabbix-appliance/centos/Dockerfile +++ b/zabbix-appliance/centos/Dockerfile @@ -82,7 +82,7 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ org.label-schema.version="${ZBX_VERSION}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix -p 80:80 -p 10051:10051 -d zabbix:centos-${ZBX_VERSION}" + org.label-schema.docker.cmd="docker run --name zabbix-appliance -p 80:80 -p 10051:10051 -d zabbix-appliance:centos-${ZBX_VERSION}" COPY ["conf/tmp/font-config", "/tmp/font-config"] diff --git a/zabbix-appliance/ubuntu/Dockerfile b/zabbix-appliance/ubuntu/Dockerfile index c730c3772..bcc83400c 100644 --- a/zabbix-appliance/ubuntu/Dockerfile +++ b/zabbix-appliance/ubuntu/Dockerfile @@ -94,7 +94,7 @@ ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ org.label-schema.version="${ZBX_VERSION}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix -p 80:80 -p 10051:10051 -d zabbix:ubuntu-${ZBX_VERSION}" + org.label-schema.docker.cmd="docker run --name zabbix-appliance -p 80:80 -p 10051:10051 -d zabbix-appliance:ubuntu-${ZBX_VERSION}" COPY ["conf/tmp/font-config", "/tmp/font-config"]