This example populates the value of SM_SerialNumber (an attribute in the Router class) by querying a MIB. The postprocessing scripts can be used to query a MIB during discovery.

First, a driver is created that sets up the process of querying the MIB for the value of SM_SerialNumber. A driver is an instance of the GA_Driver class, and in this example it is defined in an import file. The import file is loaded into the test Network-Resource Manager when it is started with the sm_server command.

During a discovery, the custom-end-system.asl script is automatically run for each device after Phase III (discovery probing). Additional rules are added to this file. Within these rules, if the object is a router, it launches the driver that was created when the import file was read into memory. The driver executes and retrieves the values in the appropriate OID. The results are then forwarded to an ASL script that parses the input and populates the value of the SM_SerialNumber attribute.

This process is summarized in Figure 15 on page 98.

  1. 1

  2. 2

  3. 3

  4. 4

  5. 5

    DISCOVERY_serialNumber.import

    custom-end-system.asl

    The import file is loaded into the Manager memory at runtime. An instance of GA_Driver is created that defines the input source, how the input is parsed, and which repository the attribute value is stored in.

    This discovery postprocessing script is executed during the discovery process.

    This discovery postprocessing script invokes the GA_Driver that was loaded into memory when the Manager was started.

    The GA_Driver performs an SNMPWalk to retrieve the value from the MIB

    The input that is retrieved is parsed by this ASL script (defined by the GA_Driver) and assigned to the appropriate instance and attribute.

    dynmodel-sn.asl

Figure 1. Using the discovery postprocessing mechanism