Go to main content
Oracle® VM Server for SPARC 3.4 Management Information Base User's Guide

Exit Print View

Updated: May 2016
 
 

How to Send Traps

  1. Configure the trap.

    Edit the /etc/net-snmp/snmp/snmpd.conf SNMP configuration file to add the directives to define the trap, inform version, and destination.

    You must use the pfedit command to edit the /etc/net-snmp/snmp/snmpd.conf file.

    trapcommunity string --> define community string to be used when sending traps
    trapsink host[community [port]] --> to send v1 traps
    trap2sink host[community [port]] --> to send v2c traps
    informsink host[community [port]] --> to send informs

    For more information, see the snmpd.conf(4) or snmpd.conf(5) man page.

    For example, the following directives use the public string as the community string when sending traps and indicate that the v1 traps are sent to the localhost destination:

    trapcommunity public
    trapsink localhost
  2. Configure access control settings by creating or editing the /usr/etc/snmp/snmptrapd.conf SNMP trapd configuration file.

    You must use the pfedit command to edit the /etc/net-snmp/snmp/snmpd.conf file.

    The following example shows who is authorized to send traps (public) and how incoming traps should be processed (log,execute,net). See the snmptrapd.conf(4) or snmptrapd.conf(5) man page.

    authCommunity log,execute,net public
  3. To receive SNMP trap messages, start the SNMP trap daemon utility, snmptrapd.
Example 4  Sending SNMP v1 and v2c Traps

This example sends send both v1 and v2c traps to the SNMP trap daemon that runs on the same host. Update the /etc/net-snmp/snmp/snmpd.conf file with the following directives:

trapcommunity public
trapsink localhost
trap2sink localhost