|
Packit |
fcad23 |
.TH NETSNMP_TRAP_API 3 "13 Aug 2010" VVERSIONINFO "Net-SNMP"
|
|
Packit |
fcad23 |
.SH NAME
|
|
Packit |
fcad23 |
send_easy_trap,
|
|
Packit |
fcad23 |
send_trap_vars,
|
|
Packit |
fcad23 |
send_v2trap - send TRAPs or INFORMs from a Net-SNMP MIB module
|
|
Packit |
fcad23 |
.SH SYNOPSIS
|
|
Packit |
fcad23 |
.B #include <net-snmp/agent/agent_trap.h>
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.BI "void send_easy_trap(int " trap ", int " specific ");"
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.BI "void send_trap_vars(int " trap ", int " specific ", struct variable_list *" vars ");"
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.BI "void send_v2trap(struct variable_list *" vars ");"
|
|
Packit |
fcad23 |
.SH DESCRIPTION
|
|
Packit |
fcad23 |
These three routines may be used to send traps from a MIB module
|
|
Packit |
fcad23 |
within the Net-SNMP agent (including an AgentX subagent).
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.B send_easy_trap()
|
|
Packit |
fcad23 |
sends an SNMPv1 trap (or the SNMPv2 equivalent) to the list of
|
|
Packit |
fcad23 |
configured trap destinations (or "sinks"), using the provided values
|
|
Packit |
fcad23 |
for the generic trap type, and specific trap value.
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.B send_trap_vars()
|
|
Packit |
fcad23 |
is similar, but appends the supplied list of variable bindings to the
|
|
Packit |
fcad23 |
traps that are sent.
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.B send_v2trap()
|
|
Packit |
fcad23 |
uses the supplied list of variable bindings to form an SNMPv2 trap,
|
|
Packit |
fcad23 |
which is sent to SNMPv2-capable sinks on the configured list. An
|
|
Packit |
fcad23 |
equivalent INFORM is sent to the configuredq list of inform sinks.
|
|
Packit |
fcad23 |
Sinks that can only handle SNMPv1 traps are skipped.
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
The various "send_trap()" calls allow you to specify traps in different
|
|
Packit |
fcad23 |
formats. And the various "trapsink" directives allow you to specify
|
|
Packit |
fcad23 |
destinations to receive different formats.
|
|
Packit |
fcad23 |
But *all* traps are sent to *all* destinations, regardless of how they
|
|
Packit |
fcad23 |
were specified.
|
|
Packit |
fcad23 |
.nf
|
|
Packit |
fcad23 |
I.e. it's
|
|
Packit |
fcad23 |
___ trapsink
|
|
Packit |
fcad23 |
/
|
|
Packit |
fcad23 |
send_easy_trap \___ [ Trap ] ____ trap2sink
|
|
Packit |
fcad23 |
___ [ Generator ]
|
|
Packit |
fcad23 |
send_v2trap / [ ] ----- informsink
|
|
Packit |
fcad23 |
\____
|
|
Packit |
fcad23 |
trapsess
|
|
Packit |
fcad23 |
|
|
Packit |
fcad23 |
*Not*
|
|
Packit |
fcad23 |
send_easy_trap -------------------> trapsink
|
|
Packit |
fcad23 |
send_v2trap -------------------> trap2sink
|
|
Packit |
fcad23 |
???? -------------------> informsink
|
|
Packit |
fcad23 |
???? -------------------> trapsess
|
|
Packit |
fcad23 |
.fi
|
|
Packit |
fcad23 |
.SH WARNINGS
|
|
Packit |
fcad23 |
These routines are used to send the traps immediately they are called.
|
|
Packit |
fcad23 |
Invoking them at the appropriate time is left to the MIB module programmer.
|
|
Packit |
fcad23 |
.SH "SEE ALSO"
|
|
Packit |
fcad23 |
.BR snmpd.conf "(5), " snmptrapd "(8)"
|