I have turned to the hive for help as apart from being still a novice when it comes to Zabbix, I've been trying to figure this out for last couple of days.
The SNMP traps are not showing in the GUI for some reason.
I have deployed Zabbix-5.4.6 with podman on Rocky Linux 8 with:
Had to disable Selinux as zabbix-smtptraps container couldn't write to /var/lib/zabbix/snmptraps. If someone knows solution please feel free to chip in.
When I sent the trap with
I can see the trap being received by zabbix-snmptraps container
and read by the zabbix-server
The snmptraps.log file contains the traps as expected.
Zabbix is configured as follows:


zabbix_server.conf from server container
snmptrap.conf from zabbix-snmptraps container
Could any one throw me a bone here and point me in the right direction please.
The SNMP traps are not showing in the GUI for some reason.
I have deployed Zabbix-5.4.6 with podman on Rocky Linux 8 with:
Code:
podman pod create --name zabbix -p 80:8080 -p 10051:10051 -p 162:1162/udp -p 3000:3000 podman run -d --name=grafana -p 3000:3000 docker.io/grafana/grafana-enterprise podman run --name zabbix-snmptraps -t \ -v /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw \ -v /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro \ --pod=zabbix \ --restart unless-stopped \ -d docker.io/zabbix/zabbix-snmptraps:latest podman run --name zabbix-agent \ -e ZBX_SERVER_HOST="127.0.0.1,localhost" \ --restart=always \ --pod=zabbix \ -d docker.io/zabbix/zabbix-agent:latest podman run --name zabbix-server-pgsql -t \ -e DB_SERVER_HOST="192.168.70.15" \ -e POSTGRES_DATABASE="zabbix7" \ -e POSTGRES_USER="zabbix7" \ -e POSTGRES_PASSWORD="zabbix7" \ -e ZBX_ENABLE_SNMP_TRAPS="true" \ -v /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw \ -v /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro \ --restart=always \ --pod=zabbix \ -d docker.io/zabbix/zabbix-server-pgsql:latest podman run --name zabbix-web-nginx-pgsql -t \ -e ZBX_SERVER_HOST="127.0.0.1" \ -e DB_SERVER_HOST="192.168.70.15" \ -e POSTGRES_DATABASE="zabbix7" \ -e POSTGRES_USER="zabbix7" \ -e POSTGRES_PASSWORD="zabbix7" \ -e ZBX_ENABLE_SNMP_TRAPS="true" \ --restart=always \ --pod=zabbix \ -d docker.io/zabbix/zabbix-web-nginx-pgsql:latest podman generate systemd --restart-policy=always -t 1 -f --name zabbix cp pod-zabbix.service container-zabbix-* /etc/systemd/system/ systemctl enable --now pod-zabbix.service
When I sent the trap with
Code:
[root@podman ~]# snmptrap -v 1 -c public 192.168.70.240 '.1.3.6.1.6.3.1.1.5.3' '0.0.0.0' 6 33 '55' .1.3.6.1.6.3.1.1.5.3 s "zmzmzmzmzmzmzmz"
Code:
2021-10-31 22:12:36 0.0.0.0(via UDP: [10.88.0.1]:49645->[10.88.0.14]:1162) TRAP, SNMP v1, community public iso.3.6.1.6.3.1.1.5.3 Enterprise Specific Trap (33) Uptime: 55 iso.3.6.1.6.3.1.1.5.3 = STRING: "qpqpqpqpqpqpqpqpq" 2021-10-31 22:14:26 0.0.0.0(via UDP: [10.88.0.1]:36369->[10.88.0.14]:1162) TRAP, SNMP v1, community public iso.3.6.1.6.3.1.1.5.3 Enterprise Specific Trap (33) Uptime: 55 iso.3.6.1.6.3.1.1.5.3 = STRING: "zmzmzmzmzmzmzmz" 2021-10-31 22:30:55 0.0.0.0(via UDP: [192.168.70.240]:44643->[10.88.0.14]:1162) TRAP, SNMP v1, community public iso.3.6.1.6.3.1.1.5.3 Enterprise Specific Trap (33) Uptime: 55 iso.3.6.1.6.3.1.1.5.3 = STRING: "zmzmzmzmzmzmzmz"
Code:
190:20211031:223056.778 unmatched trap received from "192.168.70.240": 20211031.223055 UDP: [192.168.70.240]:44643->[10.88.0.14]:1162 iso.3.6.1.2.1.1.3.0 = 55 iso.3.6.1.6.3.1.1.4.1.0 = iso.3.6.1.6.3.1.1.5.3.0.33 iso.3.6.1.6.3.1.1.5.3 = "zmzmzmzmzmzmzmz" iso.3.6.1.6.3.18.1.4.0 = "public" iso.3.6.1.6.3.1.1.4.3.0 = iso.3.6.1.6.3.1.1.5.3
Zabbix is configured as follows:
zabbix_server.conf from server container
Code:
... ... ### Option: SNMPTrapperFile # Temporary file used for passing data from SNMP trap daemon to the server. # Must be the same as in zabbix_trap_receiver.pl or SNMPTT configuration file. # # Mandatory: no # Default: # SNMPTrapperFile=/tmp/zabbix_traps.tmp SNMPTrapperFile=/var/lib/zabbix/snmptraps/snmptraps.log ### Option: StartSNMPTrapper # If 1, SNMP trapper process is started. # # Mandatory: no # Range: 0-1 # Default: # StartSNMPTrapper=0 StartSNMPTrapper=1 ... ...
Code:
bash-5.1$ cat /etc/snmp/snmptrapd.conf # A list of listening addresses, on which to receive incoming SNMP notifications snmpTrapdAddr udp:1162 snmpTrapdAddr udp6:1162 # Do not fork from the calling shell doNotFork yes # File in which to store the process ID of the notification receiver pidFile /tmp/snmptrapd.pid # Disables support for the NOTIFICATION-LOG-MIB doNotRetainNotificationLogs yes authCommunity log,execute,net public disableAuthorization yes ignoreAuthFailure yes # Specify the format used for trap handle location #format execute %B\n%b\n%V\n%v\n # o - Log messages to the standard output stream. # logOption o # S - Display the name of the MIB, as well as the object name (This is the default OID output format) # T - If values are printed as Hex strings, display a printable version as well # t - Display TimeTicks values as raw numbers # e - Removes the symbolic labels from enumeration values # outputOption STte # Invokes the specified program (with the given arguments) whenever a notification # is received that matches the OID token traphandle default /bin/bash /usr/sbin/zabbix_trap_handler.sh
Comment