Net-SNMP SNMP_TRAP_API(3)
NAME
send_easy_trap, send_trap_vars, send_v2trap - send TRAPs or
INFORMs from a Net-SNMP MIB module
SYNOPSIS
#include
void send_easy_trap(int trap, int specific);
void send_trap_vars(int trap, int specific, struct
variable_list *vars
void send_v2trap(struct variable_list *vars);
DESCRIPTION
These three routines may be used to send traps from a MIBmodule within the Net-SNMP agent (including an AgentX
subagent).send_easy_trap() sends an SNMPv1 trap (or the SNMPv2
equivalent) to the list of configured trap destinations (or "sinks"), using the provided values for the generic trap type, and specific trap value.send_trap_vars() is similar, but appends the supplied list
of variable bindings to the traps that are sent.send_v2trap() uses the supplied list of variable bindings to
form an SNMPv2 trap, which is sent to SNMPv2-capable sinks
on the configured list. An equivalent INFORM is sent to theconfiguredq list of inform sinks. Sinks that can only han-
dle SNMPv1 traps are skipped.The various "send_trap()" calls allow you to specify traps
in different formats. And the various "trapsink" directivesallow you to specify destinations to receive different for-
mats. But *all* traps are sent to *all* destinations, regardless of how they were specified. I.e. it's___ trapsink
/send_easy_trap ___ [ Trap ] ____ trap2sink
___ [ Generator ]
send_v2trap / [ ] ----- informsink
____
trapsess *Not*send_easy_trap -------------------> trapsink
send_v2trap -------------------> trap2sink
???? -------------------> informsink
???? -------------------> trapsess
V5.4.1 Last change: 7 Mar 2002 1Net-SNMP SNMP_TRAP_API(3)
WARNINGS These routines are used to send the traps immediately they are called. Invoking them at the appropriate time is left to the MIB module programmer.SEE ALSO
snmpd.conf(5), snmptrapd(8)ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:box; cbp-1 | cbp-1 l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE =
Availability system/management/snmp/net-snmp = Interface
Stability Volatile NOTESSource for net-snmp is available on http://opensolaris.org.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:_______________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|____________________|__________________________________|_
| Availability | system/management/snmp/net-snmp|
|____________________|__________________________________|_
| Interface Stability| Volatile ||____________________|_________________________________|
NOTESSource for net-snmp is available on http://opensolaris.org.
V5.4.1 Last change: 7 Mar 2002 2