Solaris WBEM Services Administration Guide

Configuring the Adapter and Mapping SNMP to CIM Objects

Configuration Files

The files you use to configure the SNMP Adapter for WBEM, which are located in /etc/snmp/conf/, are described in this section.


In snmpXwbem.acl, you define the access control list policies that are associated with the Adapter, in this format:

#pragma ident  "@(#)snmpXwbem.acl   1.2   01/04/18 SMI"
#Copyright (c) 2001 by Sun Microsystems, Inc.
#All rights reserved.

#        Configuration file of the SNMP subagent for WBEM

##################
# access control #
##################
# The list of community names needed for read/write access
# to the entire MIB.

# If the list is empty, the only valid community name is "public"
# and its access type is read-only
#
# A * in the managers list indicates requests can be received from
# any host.

acl = {
        {
                communities = public, private
                access = read-only
                managers = * 
        }
}

###################
# trap parameters #
###################
trap = {
}

A comma-separated list of communities and a comma-separated list of managers are allowed. The access policies are read-only. An empty trap clause is required. Traps are not supported by the Adapter in Solaris 9.



In snmpXwbem.reg, you define the Object Identifier (OID) of the subtree for which the Adapter is responsible, in this format:

#pragma ident   "@(#)snmpXwbem.reg      1.3    01/10/04 SMI"
#
#Copyright (c) 2001 by Sun Microsystems, Inc.
#All rights reserved.

#       Configuration file of the SNMP subagent for WBEM

##########
# macros # 
##########

# The following 3 macros are predefined:
#
#       mib-2 =         1.3.6.1.2.1
#       enterprise =    1.3.6.1.4.1
#       sun =           1.3.6.1.4.1.42
#
# You can define your own macros, so that you can
# manipulate strings instead of OIDs in defining the agent.
# See the "agent" section below.

macros = {
        system = mib-2.1    
        hostRsrc = mib-2.25
}


##########
# agent  #
##########

# You must fill in at least the following fields:
#
# - name:               the name of your agent (for example, the executable
#                       file name of your agent)
#
# - subtrees:           the list of OIDs / subtrees of OIDs your agent
#                       supports. The listed items must be separated by
#                       a comma.
#
# You can also change or add the following fields:
#
# - timeout:            the number of micro-seconds the SNMP Relay will
#                       wait for a response from your agent
#
# - watch-dog-time:     the number of seconds the SNMP Relay will wait to
#                       test whether the subagent is active, if there has
#                       been no activity for the watch-dog-time interval
#
# - port:               the UDP port number on which you will start
#                       your agent

agents =
{
        {
                name = "WBEMsubagent"
                subtrees = { system, hostRsrc }
                timeout = 20000000
                watch-dog-time = 240
        }
}

The unit of measure for timeout is microseconds. The unit of measure for watch-dog-time is seconds. By default, the Master Agent tries to start the Adapter every four minutes (or number of seconds to which watch-dog-time is set).



Note –

The Master Agent automatically determines the port to be used by the Adapter.



In snmpXwbem.rsrc-, you define a pointer to the registration file and you define how the SNMP Master Agent is to start the Adapter, in this format:

#pragma ident   "@(#)snmpXwbem.rsrc-   1.2   01/04/18 SMI"
#Copyright (c) 2001 by Sun Microsystems, Inc.
#All rights reserved.

#        Configuration file of the SNMP subagent for WBEM

##########
# agents #
##########
resource =
{
         {
                 registration_file = "/etc/snmp/conf/snmpXwbem.reg"
                 security = "/etc/snmp/conf/snmpXwbem.acl"
                 policy = "spawn"
                 type = "legacy"
                 command = "/usr/sadm/lib/wbem/snmpXwbemd -p $PORT"
         }
}

Mapping Files

When the Master Agent passes a Get-request to the SNMP Adapter for WBEM, the Adapter uses the mapping files in /var/sadm/wbem/snmp/map to translate the Get-request into a CIM object request. The Solaris operating environment includes a mapping file for you in this directory. You can also define your own mapping file for the CIM instrumentation that you want to view through an SNMP Manager.

This section shows the contents of a mapping file that the Solaris environment provides, and describes what you need to know to create an Adapter mapping file.

Contents of the Mapping File That Is Included in Solaris

This example shows the contents of the mapping file that the Solaris operating environment includes for you:

#
#pragma ident    "@(#)050SUNWwbcou.map    1.0    01/04/03 SMI"
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
# *** Description of contents ***
#
# First non-commented non-blank line contains required Version label.
# Remaining non-commented non-blank lines are considered map entries 
# used as described below:
#
# Column 1 - SNMP OID - Uniquely describes an SNMP variable
# Column 2 - CIM Class Name - CIM class associated with this variable
# Column 3 - CIM Property Name - CIM property that maps to SNMP OID variable
# Column 4 - ASN.1 type - SNMP datatype that dictates how data is mapped 
#            to/from SNMP requests.  Supported types are: SnmpString, SnmpOid,
#            SnmpTimeticks, SnmpCounter, SnmpInt, SnmpGauge, SnmpIpAddress, 
#            SnmpOpaque)
# Column 5 and greater are ignored
#
Version 1.0

1.3.6.1.2.1.1.1.0 Solaris_ComputerSystem Description SnmpString
1.3.6.1.2.1.1.3.0 Solaris_OperatingSystem LastBootUpTime SnmpTimeticks
1.3.6.1.2.1.1.4.0 Solaris_ComputerSystem PrimaryOwnerContact SnmpString
1.3.6.1.2.1.1.5.0 Solaris_ComputerSystem Name SnmpString

1.3.6.1.2.1.25.1.5.0 Solaris_OperatingSystem NumberOfUsers SnmpGauge
1.3.6.1.2.1.25.1.6.0 Solaris_OperatingSystem NumberOfProcesses SnmpGauge
1.3.6.1.2.1.25.1.7.0 Solaris_OperatingSystem MaxNumberOfProcesses SnmpGauge
1.3.6.1.2.1.25.1.2.0 Solaris_OperatingSystem LocalDateTime SnmpString

The contents of this mapping file associate the SNMP MIB-2 System Group scalar objects with their corresponding CIM objects.

MIB-2 System Group Scalar Object 

CIM Object 

sysDescr

Solaris_ComputerSystem.Description

sysUpTime

Solaris_OperatingSystem.LastBootUpTime

sysContact

Solaris_ComputerSystem.PrimaryOwnerContact

sysName

Solaris_ComputerSystem.Name

The contents of this mapping file also associate the SNMP Host Resources MIB objects with their corresponding CIM objects.

SNMP Host Resources MIB Object 

CIM Object 

hrSystemNumUsers

Solaris_OperatingSystem.NumberOfUsers

hrSystemProcesses

Solaris_OperatingSystem.NumberOfProcesses

hrSystemMaxProcesses

Solaris_OperatingSystem.MaxNumberOfProcesses

hrSystemDate

Solaris_OperatingSystem.LocalDateTime

The syntax of the contents of a mapping file is described in Syntax of the Contents of a Mapping File.


Note –

At present, the only way to retrieve host resource data is through the CIM Object Manager, as Solaris does not currently provide an SNMP Host Resource agent.


Syntax of a Mapping File Name

To ensure that the Adapter reads your mapping file, name the file according to this syntax:

alphanumeric-string.map

alphanumeric-string represents an alphanumeric string. For example, here is the name of the mapping file that Solaris includes:

050SUNWwbcou.map

You include the three digits to ensure that the Adapter reads the files in a more precise order. For example, 002SUNWlvma.map is read before 050SUNWwbcou.map.


Note –

You must allow root to at least read the mapping files that you create.

$ chmod 400 002SUNWlvma.map


Syntax of the Contents of a Mapping File

The following table describes the elements and the syntax of the contents of a mapping file.

Table 3–1 Contents of a Mapping File

Element 

Description 

Required? 

# 

A comment, which is always ignored. 

No 

Version 1.0

The version of the mapping file. The text string that specifies the version must be the first uncommented line. If you do not specify a version as shown, the mapping file is ignored.  

Yes 

1.3.6.1.2.1.1.1.0

The SNMP Object Identifier, or OID, which is the key you want to extract from the SNMP request. The SNMP OID describes an SNMP variable. Because the Adapter currently supports scalars only, the OID must end with the text string .0.

Yes 

Solaris_ComputerSystem

The CIM class name that is associated with the variable. 

Yes 

Description

The CIM property name that defines a characteristic of the specified class and that maps to the SNMP OID variable. 

Yes 

SnmpString

The ASN.1 data type. Values that you can specify, including how they are mapped, are:

  • SnmpString – Move string, number, or CIM LocalDateTime into SnmpString.

  • SnmpInt – Move CIM number data types (including a string in number format) into SnmpInt (signed, 32-bit integer).

  • SnmpCounter – Move CIM number data types (including string in number format) into SnmpCounter (unsigned, 32-bit integer).

  • SnmpGauge – Move CIM number data types (including string in number format) into SnmpGauge (unsigned, 32-bit integer).

  • SnmpTimeticks – Move the time difference, represented in hundredths of a second, into SnmpTimeticks. This value is calculated by subtracting the CIM value from the current time. For example, sysUpTime is calculated by subtracting bootTime from currentTime.

  • SnmpIpAddress – Move string into SnmpIpAddress. You must specify the string in IP address format.

  • SnmpOid – Move string into SnmpOid. You must specify the string in OID format.

  • SnmpOpaque – Move vector of bytes into SnmpOpaque.

Yes