1NETSNMP_TRAP_API(3)                Net-SNMP                NETSNMP_TRAP_API(3)
2
3
4

NAME

6       send_easy_trap,  send_trap_vars,  send_v2trap  -  send TRAPs or INFORMs
7       from a Net-SNMP MIB module
8

SYNOPSIS

10       #include <net-snmp/agent/agent_trap.h>
11
12       void send_easy_trap(int trap, int specific);
13
14       void  send_trap_vars(int  trap,  int  specific,  struct   variable_list
15       *vars);
16
17       void send_v2trap(struct variable_list *vars);
18

DESCRIPTION

20       These three routines may be used to send traps from a MIB module within
21       the Net-SNMP agent (including an AgentX subagent).
22
23       send_easy_trap() sends an SNMPv1 trap (or the SNMPv2 equivalent) to the
24       list  of  configured trap destinations (or "sinks"), using the provided
25       values for the generic trap type, and specific trap value.
26
27       send_trap_vars() is similar, but appends the supplied list of  variable
28       bindings to the traps that are sent.
29
30       send_v2trap()  uses  the  supplied list of variable bindings to form an
31       SNMPv2 trap, which is sent to SNMPv2-capable sinks  on  the  configured
32       list.   An  equivalent INFORM is sent to the configuredq list of inform
33       sinks.  Sinks that can only handle SNMPv1 traps are skipped.
34
35       The various "send_trap()" calls allow you to specify traps in different
36       formats.   And  the  various "trapsink" directives allow you to specify
37       destinations to receive different formats.  But *all* traps are sent to
38       *all* destinations, regardless of how they were specified.
39       I.e. it's
40                                                ___  trapsink
41                                               /
42           send_easy_trap ___  [  Trap      ] ____  trap2sink
43                           ___  [ Generator  ]
44           send_v2trap    /     [            ] ----- informsink
45                                               ____
46                                                     trapsess
47
48       *Not*
49            send_easy_trap  ------------------->  trapsink
50            send_v2trap     ------------------->  trap2sink
51            ????            ------------------->  informsink
52            ????            ------------------->  trapsess
53

WARNINGS

55       These  routines are used to send the traps immediately they are called.
56       Invoking them at the appropriate time is left to the  MIB  module  pro‐
57       grammer.
58

SEE ALSO

60       snmpd.conf(5), snmptrapd(8)
61
62
63
64V5.9.3                            13 Aug 2010              NETSNMP_TRAP_API(3)
Impressum