Oracle® VM Server for SPARC 3.2 Administration Guide

Exit Print View

Updated: May 2015
 
 

Using Oracle VM Server for SPARC MIB Module Traps

The Oracle Solaris 11 MIB provides the same SNMP traps as are provided by the Oracle Solaris 10 MIB. However, the net-snmp versions are different and they must be configured in different ways. In Oracle Solaris 10 MIB, snmptrapd accepts all incoming notifications and automatically logs them. In Oracle Solaris 11 MIB, 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.
    • Oracle Solaris 10:

      Edit the /etc/sma/snmp/snmpd.conf file to add the directives to define the trap, inform version, and destination.

      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.

    • Oracle Solaris 11:

      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 20-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 Oracle Solaris 10 /etc/sma/snmp/snmpd.conf file or the Oracle Solaris 11 /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.
    • Oracle Solaris 10:

      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/sfw/sbin/snmptrapd -P -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
      TRAP from localhost on 5/18/2007 at 16:30:10 Enterprise=. Type=0 SubType=0
      with Varbinds: DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (47105)
      0:07:51.05 SNMPv2-MIB::snmpTrapOID.0 = OID: SUN-LDOM-MIB::ldomCreate
      SUN-LDOM-MIB::ldomIndexNotif = INTEGER: 3 SUN-LDOM-MIB::ldomName = STRING: ldg2
      SUN-LDOM-MIB::ldomTrapDesc = STRING: Ldom Created
      Security info:TRAP2, SNMP v2c, community public

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

    • Oracle Solaris 11:

      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.