SNMP_TRAP_API

NAME
SYNOPSIS
DESCRIPTION
WARNINGS
SEE ALSO

NAME

snmp_trap_api − sending a trap or notification from a UCD-SNMP MIB module

SYNOPSIS

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

DESCRIPTION

These three routines may be used to send traps from a MIB module within the UCD SNMP agent.

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 to form an SNMPv2 trap, which is sent to SNMPv2-capable sinks on the configured list. Sinks that can only handle SNMPv1 traps are skipped.

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)