Oracle® VM Server for SPARC 3.3 Administration Guide

Exit Print View

Updated: October 2015

Using Oracle VM Server for SPARC MIB Module Traps

Access control checks are applied to incoming notifications. If snmptrapd runs without a suitable configuration file, or with equivalent access control settings, such traps are not processed. See the snmptrapd.conf(4) or snmptrapd.conf(5) man page.

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 89  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

How to Receive Traps

  • Start the SNMP trap daemon utility.

    For information about the output format options, see the snmptrapd(1M) man page.

    The snmptrapd utility is an SNMP application that receives and logs SNMP TRAP messages. For example, the following snmptrapd command shows that a new domain was created (ldomTrapDesc = Ldom Created) with a name of ldg2 (ldomName = ldg2).

    # /usr/sbin/snmptrapd -f -Le -F \
    "TRAP from %B on %m/%l/%y at %h:%j:%k Enterprise=%N Type=%w SubType=%q\n
    with Varbinds: %v\nSecurity info:%P\n\n" localhost:162
    NET-SNMP version 5.4.1
    TRAP from localhost on 6/27/2012 at 12:13:48
    Enterprise=SUN-LDOM-MIB::ldomMIBTraps Type=6 SubType=SUN-LDOM-MIB::ldomCreate
    with Varbinds: SUN-LDOM-MIB::ldomIndexNotif = INTEGER: 3
    SUN-LDOM-MIB::ldomName = STRING: ldg2   SUN-LDOM-MIB::ldomTrapDesc = STRING:
    Ldom Created
    Security info:TRAP, SNMP v1, community public

    Note that the –F option argument string is broken on to two lines for readability purposes.