5.1   Configuring VxWorks for Use with WindNet SNMP

Many WindNet SNMP facilities can be configured into VxWorks by defining the various configuration constants presented in this section.

The default location of these INCLUDE options is the EXCLUDED FACILITIES section of the configuration file $WIND_BASE/target/config/all/configAll.h. To define them, move them to the INCLUDED FACILITIES section.


*   

NOTE: VxWorks is not SNMP-capable unless you reconfigure configAll.h and rebuild VxWorks as shown here.

For general information on configuring VxWorks, see the VxWorks Programmer's Guide: Configuration.

5.1.1   Standard Included Facilities

The constants INCLUDE_SNMPD and INCLUDE_MIB2_ALL, listed in Table 5-1, configure VxWorks for running an SNMP agent that offers all MIB- II services. These are the default services shipped with WindNet SNMPv1/v2c.

Table 5-1:  WindNet SNMP Configuration Constants


Constant
 
Facility Included
 

INCLUDE_SNMPD
 
SNMP agent
 
INCLUDE_MIB2_ALL
 
All MIB-II groups
 

WindNet SNMPv1/v2c features MIB extensibility. If you desire a configuration other than the default, you must rebuild the SNMP agent to support only the wanted MIB groups. If you do not need all of the provided MIB-II variables, you can define a subset by including or excluding variables by group (see 5.1.2 Scalability and MIB-II Facilities).

For information about VxWorks MIB-II system interface routines, see the manual entry for mib2Lib in the VxWorks Reference Manual.

5.1.2   Scalability and MIB-II Facilities

The WindNet SNMPv1/v2c agent is shipped with a default configuration that includes all MIB-II groups. (Note that this does not automatically configure VxWorks for SNMP; to use SNMPv1/v2c with VxWorks, you must define INCLUDE_MIB2_ALL in configAll.h.)

Because WindNet SNMPv1/v2c is a scalable product, you can include or exclude from the agent any of the MIB-II groups defined by the constants listed in Table 5-2.

Table 5-2:  MIB-II Facilities Constants


Constant
 
Facility Included
 

INCLUDE_MIB2_SYSTEM
 
MIB-II system group
 
INCLUDE_MIB2_IF
 
MIB-II interface group
 
INCLUDE_MIB2_AT
 
MIB-II AT group
 
INCLUDE_MIB2_IP
 
MIB-II IP group
 
INCLUDE_MIB2_ICMP
 
MIB-II ICMP group
 
INCLUDE_MIB2_UDP
 
MIB-II UDP group
 
INCLUDE_MIB2_TCP
 
MIB-II TCP group
 

By performing the following steps, you can specify the MIB-II services available in your agent MIB:

  1. Move those MIB-II constants associated with services you want available in your agent MIB to the INCLUDED FACILITIES section of configAll.h.

  1. Make sure INCLUDE_SNMPD resides in the INCLUDED FACILITIES section of configAll.h.

  1. Move INCLUDE_MIB2_ALL to the EXCLUDED FACILITIES section of configAll.h.

  1. Whenever a group is scaled out of the SNMP agent, the agent, as well as the BSP for the target, needs to be rebuilt. To build the agent, you must edit the file snmpMib2.mib in the directory $WIND_BASE/target/src/snmpv1/agent in order to exclude variables from the MIB. For example, to exclude the MIB-II system group, edit snmpMib2.mib by adding the keyword EXCLUDE and the name of the group as shown:

--EXCLUDE system
For more information on the EXCLUDE keyword, see The EXCLUDE Keyword. For information on editing and recompiling this MIB configuration file, see A. The MIB Compiler User's Guide.

  1. Rebuild the agent. For example, to rebuild for a SunOS host and an MVME147 target, type the following line from the VxWorks base directory:

% (cd $WIND_BASE/target/src/snmpv1/agent ; make CPU=MC68020 TOOL=gnu)
To determine what values to use for CPU and TOOL for a particular host/target combination, look in the makefile provided in the target-specific BSP directory.

  1. Rebuild VxWorks. For example, to rebuild for a SunOS host and an MVME147 target, type the following line from the VxWorks base directory:

% (cd $WIND_BASE/target/config/mv147 ; make TOOL=gnu)

  1. Reload VxWorks onto your target system and reboot.

5.1.3   Standard Configuration Definitions

Default values for the configuration and MIB-II system group variables listed in Table 5-3 are also provided in configAll.h.

Table 5-3:  WindNet SNMP Configuration Constants with Default Values


Constant
 
Default Value
 

MIB2_SYS_DESCR
 
"VxWorks SNMPv1/v2c Agent"
 
MIB2_SYS_CONTACT
 
"Wind River Systems"
 
MIB2_SYS_LOCATION
 
"Planet Earth"
 
MIB2_SYS_OBJID_LEN
 
2
 
MIB2_SYS_OBJID
 
{ 0, 0 }
 
SNMP_TRACE_LEVEL
 
0
 

The MIB-II system group variables defined in configAll.h initialize the MIB-II system group in the agent. Their values can be modified to customize the agent as shown below.

MIB2_SYS_DESCR

Describes the local SNMP environment.

MIB2_SYS_CONTACT

Base contact for this active SNMP agent.

MIB2_SYS_LOCATION

Physical location of this SNMP agent.

MIB2_SYS_OBJID_LEN

Expected length (in octets) of an OBJECT IDENTIFIER.

MIB2_SYS_OBJID

Value of the agent's own OBJECT IDENTIFIER.

SNMP_TRACE_LEVEL

Integer (0-3) representing a level of information reported in trace messages. The various levels are:

0
no trace messages
1
only errors which prevent the agent from continuing altogether, usually due to unavailable resources at startup (for example, semaphores or memory partitions)
2
level 1 messages, plus other errors which do not prevent the agent from continuing
3
level 1 plus level 2 plus informational messages