From 518292df9f431086054786b47df3927601709ffa Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Fri, 26 Jan 2024 22:14:49 +0900 Subject: [PATCH] Updated date / time format in SNMP traps image according ZBX-21192 --- Dockerfiles/snmptraps/README.md | 2 +- Dockerfiles/snmptraps/alpine/Dockerfile | 2 +- .../snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh | 2 +- Dockerfiles/snmptraps/centos/Dockerfile | 2 +- .../snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh | 2 +- Dockerfiles/snmptraps/ol/Dockerfile | 2 +- Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh | 2 +- Dockerfiles/snmptraps/rhel/Dockerfile | 2 +- Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh | 2 +- Dockerfiles/snmptraps/ubuntu/Dockerfile | 2 +- .../snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh | 2 +- env_vars/.env_snmptraps | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfiles/snmptraps/README.md b/Dockerfiles/snmptraps/README.md index 173f7312b..891071514 100644 --- a/Dockerfiles/snmptraps/README.md +++ b/Dockerfiles/snmptraps/README.md @@ -64,7 +64,7 @@ When you start the `zabbix-snmptraps` image, you can adjust the configuration by ### `ZBX_SNMP_TRAP_DATE_FORMAT` -This variable is represent date and time format in the output `snmptraps.log` file. By default, value is `+%Y%m%d.%H%M%S`. Please, refer to `date` command man for more details about date and time format. +This variable is represent date and time format in the output `snmptraps.log` file. By default, value is `+%Y-%m-%dT%T%z`. Please, refer to `date` command man for more details about date and time format. ### `ZBX_SNMP_TRAP_FORMAT` diff --git a/Dockerfiles/snmptraps/alpine/Dockerfile b/Dockerfiles/snmptraps/alpine/Dockerfile index 6cd9465ed..d6a5ee867 100644 --- a/Dockerfiles/snmptraps/alpine/Dockerfile +++ b/Dockerfiles/snmptraps/alpine/Dockerfile @@ -7,7 +7,7 @@ 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 \ - ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" \ + ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ ZBX_SNMP_TRAP_USE_DNS=false LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ diff --git a/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh index b3f317e08..f504ca326 100644 --- a/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh @@ -2,7 +2,7 @@ ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" -ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"} +ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_FORMAT=${ZBX_SNMP_TRAP_FORMAT:-"\n"} diff --git a/Dockerfiles/snmptraps/centos/Dockerfile b/Dockerfiles/snmptraps/centos/Dockerfile index b1e9affa4..49f1eb8dd 100644 --- a/Dockerfiles/snmptraps/centos/Dockerfile +++ b/Dockerfiles/snmptraps/centos/Dockerfile @@ -7,7 +7,7 @@ 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 \ - ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" \ + ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ ZBX_SNMP_TRAP_USE_DNS=false LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ diff --git a/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh index b3f317e08..f504ca326 100644 --- a/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh @@ -2,7 +2,7 @@ ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" -ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"} +ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_FORMAT=${ZBX_SNMP_TRAP_FORMAT:-"\n"} diff --git a/Dockerfiles/snmptraps/ol/Dockerfile b/Dockerfiles/snmptraps/ol/Dockerfile index fa7a00001..2bd4898d8 100644 --- a/Dockerfiles/snmptraps/ol/Dockerfile +++ b/Dockerfiles/snmptraps/ol/Dockerfile @@ -7,7 +7,7 @@ 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 \ - ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" \ + ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ ZBX_SNMP_TRAP_USE_DNS=false LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ diff --git a/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh index b3f317e08..f504ca326 100644 --- a/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh @@ -2,7 +2,7 @@ ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" -ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"} +ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_FORMAT=${ZBX_SNMP_TRAP_FORMAT:-"\n"} diff --git a/Dockerfiles/snmptraps/rhel/Dockerfile b/Dockerfiles/snmptraps/rhel/Dockerfile index 2d40fdc28..e4e2f1af4 100644 --- a/Dockerfiles/snmptraps/rhel/Dockerfile +++ b/Dockerfiles/snmptraps/rhel/Dockerfile @@ -9,7 +9,7 @@ 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 \ - ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" \ + ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ ZBX_SNMP_TRAP_USE_DNS=false LABEL description="Zabbix SNMP traps receiver" \ diff --git a/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh index b3f317e08..f504ca326 100644 --- a/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh @@ -2,7 +2,7 @@ ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" -ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"} +ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_FORMAT=${ZBX_SNMP_TRAP_FORMAT:-"\n"} diff --git a/Dockerfiles/snmptraps/ubuntu/Dockerfile b/Dockerfiles/snmptraps/ubuntu/Dockerfile index c4c41ea95..8a28ef6cd 100644 --- a/Dockerfiles/snmptraps/ubuntu/Dockerfile +++ b/Dockerfiles/snmptraps/ubuntu/Dockerfile @@ -7,7 +7,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/var/lib/mibs/ietf:/var/lib/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ - ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" \ + ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ ZBX_SNMP_TRAP_USE_DNS=false LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ diff --git a/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh index b3f317e08..f504ca326 100644 --- a/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh @@ -2,7 +2,7 @@ ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" -ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"} +ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_FORMAT=${ZBX_SNMP_TRAP_FORMAT:-"\n"} diff --git a/env_vars/.env_snmptraps b/env_vars/.env_snmptraps index 70a705ea3..6c14ed08b 100644 --- a/env_vars/.env_snmptraps +++ b/env_vars/.env_snmptraps @@ -1,4 +1,4 @@ -ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S +ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT=\n # To use DNS instead of sender IP override container's command: /usr/sbin/snmptrapd -C -c /etc/snmp/snmptrapd.conf -Lo -A # Need to remove "-n" command argument