[ZBX-14541] IPv6 Traps does not show proper IPv6 address Created: 2018 Jun 29  Updated: 2024 Apr 10  Resolved: 2018 Jul 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 3.0.18
Fix Version/s: 4.0 (plan)

Type: Incident report Priority: Minor
Reporter: Simon Leung Assignee: Michael Veksler
Resolution: Won't fix Votes: 0
Labels: snmptraps
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu


Team: Team A
Sprint: Sprint 37, Sprint 38
Story Points: 1

 Description   

Steps to reproduce

I have installed Zabbix 3.0.18 on  Ubuntu16.04. I am using snmptt to handle my traps and I have configured the file this way:

/etc/snmp/snmptt.conf

EVENT general .* "General Event" Normal
FORMAT ZBXTRAP $aA $aA severity: $s $Fn + $*

 

which is following Zabbix trap format:

 [timestamp] [the trap, part 1] ZBXTRAP [address] [the trap, part 2] 

When I send traps via IPv4/IPv6 with SNMPv2 I can see the trap in Zabbix.

Problem occurs when I send SNMPv3 traps using IPv6 the text format is changed. Is there a snmptt.conf format I can use so it works for both SNMPv2 and v3?

 

Result:

/tmp/zabbix_traps.tmp

#  SNMPv2 IPv4/IPv6
13:49:48 2018/06/29 SNMPv2-SMI::enterprises.232.0.11003 Normal "General Event" 192.168.80.33 - ZBXTRAP 192.168.80.33 severity: Normal
+ TXSLPERFLAB-H-PE0C7O1-001 4 HPE Onboard Administrator Test Trap sent from enclosure: TXSLPERFLAB-001

  1. SNMPv3 IPv6
    13:50:04 2018/06/29 SNMPv2-SMI::enterprises.232.0.11003 Normal "General Event" UDP/IPv6: [2607:f160:a:f0:9:fe0:0:2002]:1205 - ZBXTRAP severity: Normal
    + TXSLPERFLAB-H-PE0C7O1-002 4 HPE Onboard Administrator Test Trap sent from enclosure: TXSLPERFLAB-002

Expected:
13:50:04 2018/06/29 SNMPv2-SMI::enterprises.232.0.11003 Normal "General Event" [2607:f160:a:f0:9:fe0:0:2002] - ZBXTRAP severity: Normal 
+ TXSLPERFLAB-H-PE0C7O1-002 4 HPE Onboard Administrator Test Trap sent from enclosure: TXSLPERFLAB-002



 Comments   
Comment by Simon Leung [ 2018 Jun 30 ]

Updated expected result so it matches IPv4 SNMPv2 trap:

13:50:04 2018/06/29 SNMPv3-SMI::enterprises.232.0.11003 Normal "General Event" [2607:f160:a:f0:9:fe0:0:2002] - ZBXTRAP [2607:f160:a:f0:9:fe0:0:2002] severity: Normal
+ TXSLPERFLAB-H-PE0C7O1-002 4 HPE Onboard Administrator Test Trap sent from enclosure: TXSLPERFLAB-002

Comment by Michael Veksler [ 2018 Jul 11 ]

The problem connected with registered bug of net-snmp. As workaround for 5.7.3 you can change:
1. the configuration of /etc/snmp/snmptt.conf like:

EVENT general .* "General Event" Normal
FORMAT ZBXTRAP $aA $aA severity: $s $Fn + $*
MATCH $A: !(UDP/IPv6: \[[\d\:a-fA-F]+\]:\d+)i

EVENT general .* "General Event" Normal
FORMAT ZBXTRAP $A $A severity: $s $Fn + $*
REGEX (UDP/IPv6: \[([\d\:a-fA-F]+)\]:\d+)($1)ig
MATCH $A: ([\d\:a-fA-F]{0,4}:[\d\:a-fA-F]+)

2. the configuration of /etc/snmp/snmptt.ini as describe in documentation, plus check value of the following flags:

net_snmp_perl_enable = 1
allow_unsafe_regex = 1
date_time_format = %H:%M:%S %Y/%m/%d

At the result if you send snmptrap:

[root@dev-c]~# snmptrap -v 2c -c public fc00::800:27ff:fe00:0 "" NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification netSnmpExampleHeartbeatRate i 123456
[root@dev-c]~# snmptrap -v 2c -c public 192.168.56.1 "" NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification netSnmpExampleHeartbeatRate i 123456

you will receive in zabbix_traps.tmp

09:40:15 2018/07/11 .iso Normal "General Event" UDP/IPv6: [fc00::800:27ff:fe01:0]:43546 - ZBXTRAP fc00::800:27ff:fe01:0 fc00::800:27ff:fe01:0 severity: Normal 
 + 123456
09:41:04 2018/07/11 .iso Normal "General Event" 192.168.56.3 - ZBXTRAP 192.168.56.3 192.168.56.3 severity: Normal 
 + 123456

and zabbix server can successfully find host based on ip and process the traps

ZBX-14541 v4
snmptrap[Genera]
90d SNMP trap 2018-07-11 09:41:06 09:41:04 2018/07/11 .iso Normal "General Event" 192.168.56.3 - 192.168.56.3 severity: Normal + 123456 History
ZBX-14541 v6
snmptrap[General]
90d SNMP trap 2018-07-11 09:40:16 09:40:15 2018/07/11 .iso Normal "General Event" UDP/IPv6: [fc00::800:27ff:fe01:0]:43546 - fc00::800:27ff:fe01:0 severity: Normal + 123456 History
Comment by Simon Leung [ 2018 Jul 12 ]

Thank you for the detailed description and explanation. I found that net-snmp URL before but it didn't make any sense to me how I can fix it. IPv6 SNMPv3 traps are finally working after your  suggested changes, i can see it in zabbix_traps.tmp and Zabbix GUI  

Comment by Simon Leung [ 2018 Jul 12 ]

FYI I have a similar format issue using the zabbix_trap_receiver.pl instead of snmptt. 

https://support.zabbix.com/browse/ZBX-14576

Generated at Thu Apr 25 09:44:53 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.