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


#include <net-snmp/agent/agent_trap.h>

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);


These three routines may be used to send traps from a MIB module 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 the configuredq list of inform sinks. Sinks that can only handle SNMPv1 traps are skipped.

The various "send_trap()" calls allow you to specify traps in different formats. And the various "trapsink" directives allow you to specify destinations to receive different formats. 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

send_easy_trap -------------------> trapsink
send_v2trap -------------------> trap2sink
???? -------------------> informsink
???? -------------------> trapsess


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.


snmpd.conf(5), snmptrapd(8)

More Linux Commands

glEvalPoint(3gl) - generate and evaluate a single point in a
glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalPoint can be used to evaluat

App::Prove::State::Result::Test(3pm) - Individual test resul
The prove command supports a --state option that instructs it to store persistent state across runs. This module encapsulates the results for a single test. SYN

SDL_MapRGB(3) - Map a RGB color value to a pixel format.....
Maps the RGB color value to the specified pixel format and returns the pixel value as a 32-bit int. If the format has a palette (8-bit) the index of the closest

radvd.conf(5) - configuration file of the router advertiseme
This file describes the information which is included in the router advertisement (RA) of a specific interface. The file contains one or more interface definiti

intro.6 - intro(6) - Introduction to games (Games - Linux manual page)
Section 6 of the manual describes all the games and funny little programs available on the system. NOTES Authors and copyright conditions Look at the header of

doupdate(3ncurses) - refresh curses windows and lines.......
The refresh and wrefresh routines (or wnoutrefresh and doupdate) must be called to get actual output to the terminal, as other routines merely manipulate data s

Time::tm(3pm) - internal object used by Time::gmtime and Tim
This module is used internally as a base class by Time::localtime And Time::gmtime functions. It creates a Time::tm struct object which is addressable just like

gnutls_openpgp_set_recv_key_function(3) - API function......
This funtion will set a key retrieval function for OpenPGP keys. This callback is only useful in server side, and will be used if the peer sent a key fingerprin

nsenter(1) run program with namespaces of other processes...
Enters the namespaces of one or more other processes and then executes the specified program. Enterable namespaces are: mount namespace Mounting and unmounting

Tk_NameOfAnchor(3) - translate between strings and anchor po
Tk_GetAnchorFromObj places in *anchorPtr an anchor position (enumerated type Tk_Anchor) corresponding to objPtrs value. The result will be one of TK_ANCHOR_N, T

XRestackWindows(3) - change window stacking order (ManPage)
The XRaiseWindow function raises the specified window to the top of the stack so that no sibling window obscures it. If the windows are regarded as overlapping

Mail::SpamAssassin::Plugin::AccessDB(3pm) - check message ag
Many MTAs support access databases, such as Sendmail, Postfix, etc. This plugin does similar checks to see whether a message would have been flagged. The rule r

We can't live, work or learn in freedom unless the software we use is free.