sun.com | docs.sun.com | How To Buy | My Sun | Worldwide Sites |  |

| Previous Contents Index Next
Users can also be managed through USM MIB access. ## SNMP Manager Configuration Examples This section contains three examples of SNMP configurations. The NMA implements the Notification MIB module specified by the Internet Engineering Task Force in RFC 2573, which is accessible from `http://www.ietf.org/rfc/rfc2573.txt`. By default the NMA authorizes `localhost` to access its MIB using SNMPv1 or SNMPv2 on port `8085`. SNMP traps are sent using the mechanism described in the RFC 2573. Traps are sent by default to `localhost` on port `8086` using SNMPv2 parameters, as defined in the default RFC 2573 configuration files: `nma.params.txt` `nma.notifs.txt` `nma.targets.txt` The RFC 2573 configuration files can be manually edited. Alternately, use the `com.sun.jdmk.snmp.rfc2573.manager.SnmpV3AppliMibRegistration` class, found in the `rfc2573mgr.jar` file. Use this class to dynamically register or unregister SNMP managers at runtime. Example 4-3 is a code snippet that uses this class to register a trap target on trap port `trapPort` of the host `localHost`. Traps are received using SNMPv3 parameters. Example 4-3 Using the `SnmpV3AppliMibRegistration` API
    //Register the manager/params to the NMA
    try {

    System.out.println("Register the Manager to receive Traps using SNMPv3 " +
                       parameters");

    // Register the SNMP Parameters V3
    SnmpV3AppliMibRegistration.registerParams(session,
                                              "manager_paramsv3",
                                              3,
                                              3,
                                              "defaultUser",
                                              2);

    // Register the Manager to receive traps with SNMPv3 parameters
    SnmpV3AppliMibRegistration.registerTarget(session,
                                              "manager_targetv3",
                                              "1.3.6.1.6.1.1",
                                              localHost + "/"+ trapPort,
                                              10000,
                                              2,
                                              "trap",
                                              "manager_paramsv3");

    }
    catch(SnmpStatusException e) {
      System.out.println("ERROR in registration " + e.getMessage());
    }
### SNMPv2 Configuration Example In this configuration the NMA MIB is accessed using SNMPv2 on port number `8085`. The SNMP manager is authorized to access the MIB located on host `10.8.1.253`. Traps are sent to the manager on port `8086` using SNMPv2, using the Notification MIB described in RFC 2573. Example 4-4, Example 4-5, Example 4-6, Example 4-7, and Example 4-8 list the entries in the NMA configuration files that support this SNMP configuration. Example 4-4 Example Entries in `nma.properties` for SNMPv2
    com.sun.nhas.ma.adaptors.snmp.enabled=true
    com.sun.nhas.ma.adaptors.snmp.port=8085
    com.sun.nhas.ma.adaptors.snmp.rfc2573.enabled=true
    com.sun.nhas.ma.adaptors.snmp.rfc2573.v1v2set.enabled=true
    com.sun.nhas.ma.adaptors.snmp.rfc2573.target.addr.file=\
    /etc/opt/SUNWcgha/nma.targets.txt
    com.sun.nhas.ma.adaptors.snmp.rfc2573.target.params.file=\
    /etc/opt/SUNWcgha/nma.params.txt
    com.sun.nhas.ma.adaptors.snmp.rfc2573.notification.file=\
    /etc/opt/SUNWcgha/nma.notifs.txt
    jdmk.acl.file=/etc/opt/SUNWcgha/nma.acl
Example 4-5 Example Entries in `nma.acl` for SNMPv2
    acl = {
     {
     communities = public, private
     access = read-only
     managers = 10.8.1.253
     }
     {
     communities = public, private
     access = read-write
     managers = 10.8.1.253
     }
    }
Example 4-6 Example Entry in `nma.targets.txt` for SNMPv2
    targetsEntry=managerV2,snmpUDPDomain,10.8.1.253/8086,10000,2,trap,snmpV2,3
Example 4-7 Example Entry in `nma.params.txt` for SNMPv2
    paramsEntry=snmpV2,1,2,public,1,3
Example 4-8 Example Entry in `nma.notifs.txt` for SNMPv2
    notificationEntry=notif1,trap,1,3
### SNMPv2 and SNMPv3 Hybrid Configuration Example In this configuration the NMA is located at the CGTP address `10.8.3.18`. The NMA MIB can be accessed through SNMPv2 and SNMPv3 using port number `8085`. The manager that authorizes access to the MIB in SNMPv2 is located on host 10.8.1.253``. The user `defaultUser` is authorized to access the MIB through SNMPv3 using the security parameters described in the `nma.security` file. Traps are sent to the manager on port `8086` using SNMPv2 and on port `8095` using SNMPv3. The notification MIB described in the RFC 2573 is used. Example 4-9, Example 4-10, Example 4-11, Example 4-12, Example 4-13, Example 4-14, Example 4-15, and Example 4-16 list the entries in the NMA configuration files that support this SNMP configuration. Example 4-9 Example Entries in `nma.properties` for Hybrid Configuration
    com.sun.nhas.ma.adaptors.snmp.enabled=true
    com.sun.nhas.ma.adaptors.snmp.port=8085
    com.sun.nhas.ma.adaptors.snmp.rfc2573.enabled=true
    com.sun.nhas.ma.adaptors.snmp.rfc2573.v1v2set.enabled=true
    com.sun.nhas.ma.adaptors.snmp.rfc2573.target.addr.file=\
    /etc/opt/SUNWcgha/nma.targets.txt
    com.sun.nhas.ma.adaptors.snmp.rfc2573.target.params.file=\
    /etc/opt/SUNWcgha/nma.params.txt
    com.sun.nhas.ma.adaptors.snmp.rfc2573.notification.file=\
    /etc/opt/SUNWcgha/nma.notifs.txt
    jdmk.acl.file=/etc/opt/SUNWcgha/nma.acl
    jdmk.uacl.file=/etc/opt/SUNWcgha/nma.uacl
Example 4-10 Example Entries in `nma.security` for Hybrid Configuration
    userEntry=localEngineID,defaultUser,null,usmHMACMD5AuthProtocol,mypasswd
    localEngineBoots=23
    localEngineID=0x8000002a050a08031200001f95
Example 4-11 Example Entries in `nma.acl` for Hybrid Configuration
    acl = {
     {
     communities = public, private
     access = read-only
     managers = 10.8.1.253
     }
     {
     communities = public, private
     access = read-write
     managers = 10.8.1.253
     }
    }
Example 4-12 Example Entries in `nma.uacl` for Hybrid Configuration
    acl = {
     {
     context-names = null
     access = read-write
     security-level=authNoPriv
     users = defaultUser
     }
    }
Example 4-13 Example Entries in `nma.targets.txt` for Hybrid Configuration
    targetsEntry=managerV2,snmpUDPDomain,10.8.1.253/8086,10000,2,trap,snmpV2,3
    targetsEntry=managerV3,snmpUDPDomain,10.8.1.253/8095,10000,2,trap,snmpV3,3
Example 4-14 Example Entries in `nma.params.txt` for Hybrid Configuration
    paramsEntry=snmpV2,1,2,public,1,3
    paramsEntry=snmpV3,3,3,defaultUser,2,3
Previous Contents Index Next

Copyright 1994-2004 Sun Microsystems