Hi,

i am trying to receive snmp traps generated by relayd and send via snmpd to
a host running net-snmp snmptrapd.

there i only get the error

  Cannot find TrapOID in TRAP2 PDU

config:

# ------------OpenBSD 4.5 snmpd.conf: -------------
listen_addr="127.0.0.1"

# Restrict daemon to listen on localhost only
listen on $listen_addr

# Specify a number of trap receivers
trap receiver linuxsnmpserver
#trap receiver localhost
trap community secret

# Adjust the local system information
system contact "foo"
system description "Powered by OpenBSD"
system location "just here"
system services 74
# ------------ ends -------------

# --------------- net-snmp snmptrapd.conf: --------------
authCommunity log,execute secret
traphandle default /usr/sbin/snmptrapfmthdlr
# ------------ ends -------------

i tried with snmptrapd versions

NET-SNMP version 5.4.2.1  (on OpenBSD)
NET-SNMP version 5.4.1    (on Linux)

both with the same result:

  snmptrapd[1360]: truncating signed value to 32 bits (1)
  snmptrapd[1360]: Cannot find TrapOID in TRAP2 PDU

when started with debugging output 

the result of a relayd host down event looks like this:

# snmptrapd -f -Le -d 127.0.0.1
NET-SNMP version 5.4.2.1

Received 267 bytes from UDP: [127.0.0.1]:35951->[0.0.0.0]
0000: 30 82 01 07  02 01 01 04  06 73 65 63  72 65 74 A7    0........secret'
0016: 81 F9 02 04  C2 26 31 6E  02 01 00 02  01 00 30 81    .y..B&1n......0.
0032: EA 30 0D 06  07 2B 06 01  02 01 01 03  43 02 0E 96    j0...+......C...
0048: 30 17 06 09  2B 06 01 06  03 01 01 04  01 06 0A 2B    0...+..........+
0064: 06 01 04 01  81 EB 4B 03  01 30 1B 06  0B 2B 06 01    .....kK..0...+..
0080: 04 01 81 EB  4B 03 01 01  04 0C 32 31  37 2E 33 31    ...kK.....217.31
0096: 2E 38 37 2E  34 30 30 14  06 0B 2B 06  01 04 01 81    .87.400...+.....
0112: EB 4B 03 01  02 02 05 00  FF FF FF FF  30 10 06 0B    kK......0...
0128: 2B 06 01 04  01 81 EB 4B  03 01 03 02  01 01 30 11    +.....kK......0.
0144: 06 0B 2B 06  01 04 01 81  EB 4B 03 01  04 02 02 04    ..+.....kK......
0160: A7 30 11 06  0B 2B 06 01  04 01 81 EB  4B 03 01 05    '0...+.....kK...
0176: 02 02 08 56  30 1F 06 0B  2B 06 01 04  01 81 EB 4B    ...V0...+.....kK
0192: 03 01 06 04  10 61 73 5F  70 72 6F 64  5F 68 6F 73    .....as_prod_hos
0208: 74 73 3A 38  30 30 10 06  0B 2B 06 01  04 01 81 EB    ts:800...+.....k
0224: 4B 03 01 07  02 01 00 30  10 06 0B 2B  06 01 04 01    K......0...+....
0240: 81 EB 4B 03  01 08 02 01  02 30 10 06  0B 2B 06 01    .kK......0...+..
0256: 04 01 81 EB  4B 03 01 09  02 01 02                    ...kK......

Cannot find TrapOID in TRAP2 PDU

The snmptrapd can receive traps generated with the Net-SNMP snmptrap
programme:

 snmptrap -v 2c -c secret localhost "" OPENBSD-BASE-MIB::localTest \
     SNMPv2-MIB::sysLocation.0 s "Just here"

result:

Received 95 bytes from UDP: [127.0.0.1]:40091->[0.0.0.0]
0000: 30 5D 02 01  01 04 06 73  65 63 72 65  74 A7 50 02    0].....secret'P.
0016: 04 69 62 E6  65 02 01 00  02 01 00 30  42 30 10 06    .ibfe......0B0..
0032: 08 2B 06 01  02 01 01 03  00 43 04 06  0C 07 AC 30    .+.......C....,0
0048: 17 06 0A 2B  06 01 06 03  01 01 04 01  00 06 09 2B    ...+...........+
0064: 06 01 04 01  81 EB 4B 2A  30 15 06 08  2B 06 01 02    .....kK*0...+...
0080: 01 01 06 00  04 09 4A 75  73 74 20 68  65 72 65       ......Just here

2009-08-25 13:58:37 localhost [UDP: [127.0.0.1]:40091->[0.0.0.0]]:
    DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (101451692) 11 days,
17:48:36.92       SNMPv2-MIB::snmpTrapOID.0 = OID:
    SNMPv2-SMI::enterprises.30155.42       SNMPv2-MIB::sysLocation.0 = STRING:
    Just here

how can i receive snmp traps from OpenBSD snmpd?

/Benno

Reply via email to