Template:FAQ:Coding 20
From Net-SNMP Wiki
There are two ways to do this. You can either use the
'send_v2trap'
call and give a varbind list, starting with
the v2-equivalent of the SNMPv1 trap, followed by the
additional varbinds.
Alternatively, you can use the API call 'send_trap_vars'
which takes the same generic/specific trap values as
'send_easy_trap'
, plus the list of additional varbinds.
In either case, you also need to have 'trapsink'
in the
snmpd.conf
file. The resulting trap will be identical,
whichever approach is used.