mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2024-11-14 20:04:50 +01:00
Some images bumped to Alpine 3.7 version. Added Alpine and CentOS snmptraps image
This commit is contained in:
parent
ed806983ea
commit
26b9a39092
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.4
|
||||
FROM alpine:3.7
|
||||
LABEL maintainer="Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
ARG BUILD_DATE
|
||||
|
1
snmptraps/alpine/.dockerignore
Normal file
1
snmptraps/alpine/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
build.sh
|
85
snmptraps/alpine/Dockerfile
Normal file
85
snmptraps/alpine/Dockerfile
Normal file
@ -0,0 +1,85 @@
|
||||
FROM alpine:3.7
|
||||
LABEL maintainer "Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
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"]
|
89
snmptraps/alpine/README.md
Normal file
89
snmptraps/alpine/README.md
Normal file
@ -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.
|
24
snmptraps/alpine/build.sh
Executable file
24
snmptraps/alpine/build.sh
Executable file
@ -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
|
8
snmptraps/alpine/conf/etc/logrotate.d/zabbix_snmptraps
Normal file
8
snmptraps/alpine/conf/etc/logrotate.d/zabbix_snmptraps
Normal file
@ -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
|
||||
}
|
@ -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
|
35
snmptraps/alpine/conf/etc/supervisor/supervisord.conf
Normal file
35
snmptraps/alpine/conf/etc/supervisor/supervisord.conf
Normal file
@ -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
|
BIN
snmptraps/alpine/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz
Normal file
BIN
snmptraps/alpine/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz
Normal file
Binary file not shown.
1
snmptraps/centos/.dockerignore
Normal file
1
snmptraps/centos/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
build.sh
|
94
snmptraps/centos/Dockerfile
Normal file
94
snmptraps/centos/Dockerfile
Normal file
@ -0,0 +1,94 @@
|
||||
FROM centos:centos7
|
||||
LABEL maintainer "Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
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"]
|
89
snmptraps/centos/README.md
Normal file
89
snmptraps/centos/README.md
Normal file
@ -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.
|
24
snmptraps/centos/build.sh
Executable file
24
snmptraps/centos/build.sh
Executable file
@ -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
|
8
snmptraps/centos/conf/etc/logrotate.d/zabbix_snmptraps
Normal file
8
snmptraps/centos/conf/etc/logrotate.d/zabbix_snmptraps
Normal file
@ -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
|
||||
}
|
@ -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
|
35
snmptraps/centos/conf/etc/supervisor/supervisord.conf
Normal file
35
snmptraps/centos/conf/etc/supervisor/supervisord.conf
Normal file
@ -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
|
BIN
snmptraps/centos/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz
Normal file
BIN
snmptraps/centos/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz
Normal file
Binary file not shown.
@ -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}
|
||||
|
||||
|
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.4
|
||||
FROM alpine:3.7
|
||||
LABEL maintainer="Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
ARG BUILD_DATE
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.4
|
||||
FROM alpine:3.7
|
||||
LABEL maintainer="Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
ARG BUILD_DATE
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.4
|
||||
FROM alpine:3.7
|
||||
LABEL maintainer="Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
ARG BUILD_DATE
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.4
|
||||
FROM alpine:3.7
|
||||
LABEL maintainer="Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
||||
|
||||
ARG BUILD_DATE
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user