Open Systems and Windows NT Appendix 4: MIB to Dictionary Compiler

Table Of ContentsIT Service Vision Help


Introduction

In the master data dictionary, IT Service Vision supplies table and variable definitions for the data from many collectors. For those data, you can use the supplied table and variable definitions (after adding them from the master data dictionary to your PDB). For other data, you can create the table and variable definitions in your PDB by running the IT Service Vision %CPDDUTL macro with CPDDUTL control statements that define the tables and variables.

You can write the CPDDUTL control statements yourself. But for SNMP data (all of which are described with a MIB) there is an easier way to generate the necessary control statements that add the MIB tables and variables to your PDB. The IT Service Vision mib2dict compiler takes as input any SNMP V1 or V2 MIB and produces as output CPDDUTL control statements that can be read directly by the %CPDDUTL macro to define IT Service Vision tables and variables. The mib2dict compiler can optionally produce SAS statements for input to the SAS FORMAT procedure so that you can add formats for MIB enumeration types.

As an example, this appendix walks you through the steps needed to create table and variable definitions for MIB-II data. The same steps apply for any MIB. We use MIB-II as an example because of its simplicity and familiarity. If you want to use MIB-II tables in your PDB, you do not actually need to use mib2dict because all the MIB-II tables are included in the master data dictionary that is shipped with IT Service Vision. (MIB-II table names begin with M.)

Note: For more information about the %CPDDUTL macro, see the Macro Reference documentation for IT Service Vision.

Note: For more about collecting data using the other MIBs for which IT Service Vision supplies tables, see the UNIX information in Section 3: Advanced Setup.

Note: If you need to know more about the MIB for one of your hardware devices, check the hardware documentation or call the manufacturer of the device. There are proprietary MIBs and public domain, Internet standard MIBs. If the MIB is a proprietary MIB, the hardware installation procedure probably copied it to a directory at your site and/or you can probably find a copy on the manufacturer's web page. If the MIB is a standard MIB, the copy is probably on the web page http://ds.internic.net/.

Creating Table and Variable Definitions from a MIB

Prerequisites

  1. The IT Service Vision server Release 1 or later is installed on your SAS host machine.

  2. The IT Service Vision server software is running, and the PDB to which you want to add the tables is the active PDB.

  3. You are familiar with the mib2dict man page.

    To view the man page, execute the following on UNIX (assuming that SAS has been installed in /usr/local/sas):

       cd /usr/local/sas/utilities/man/man1
       nroff -man mib2dict.1 | more
  4. The MIB that you want to compile conforms to SNMPv1 or SNMPv2 standards.

    For the purposes of this exercise, we will use rfc1213.mib, which is a file containing the definition of MIB-II. Assuming you have installed SAS and the IT Service Vision server in /usr/local/sas, you can find a copy of rfc1213.mib in !sasroot/cpe/mibs/. On Windows NT !sasroot/cpe/mibs.

Actions

  1. Compile the MIB.

    In this action we are going to compile rfc1213.mib and produce two output files: rfc1213.ddu and rfc1213.sas. The .ddu file will contain the CPDDUTL control statements needed by the %CPDDUTL macro. The .sas file will contain the PROC FORMAT statements needed to create the formats for enumeration types.

    To compile the MIB, execute the following command (assuming that SAS has been installed in !sasroot and that your PATH includes !sasroot/sas/utilities/bin/):

       On UNIX
       mib2dict -i rfc1213.mib -o rfc1213.ddu -f rfc1213.sas -c hp-ov
       On Windows NT
       mib2dict.exe -i rfc1213.mib -o rfc1213.ddu -f rfc1213.sas -c hp-ov

    where

  2. Review, and revise if necessary, the resulting CPDDUTL control statements.

    Although mib2dict is designed to create CPDDUTL control statements that can be directly processed by the %CPDDUTL macro, there are circumstances in which you may want to edit the control statements before you use them:

    1. There may be tables or variables that were in the MIB but that you do not want to add to your PDB.

      If this is the case, prior to executing the %CPDDUTL macro you can simply delete the CPDDUTL control statements that define the tables or variables that you do not want.

      To delete an entire table, look for the CREATE TABLE statement and delete everything up to the next CREATE TABLE statement.

      To delete a variable from a table, simply delete everything from CREATE VARIABLE up to and including the semicolon that ends the statement.

      If you delete a variable from a table but you do not delete the entire table, be sure that the variable you deleted is not in the table's BYVARS or CLASSVARS lists. In particular, do not delete MACHINE, HOUR, or SHIFT because these variables are always on the BYVARS and CLASSVARS lists. For more about the BY and CLASS variables lists, see Section 2, Task 1: Customize and Verify Your Test PDB.

    2. There may be some IT Service Vision table or variable names that you want to change.

      Although mib2dict is able to squeeze long MIB table and variable names down to six-character names for the PDB tables and seven-character names for the PDB variables, the resulting names do not always look mnemonic.

      So that users of your PDB can read the names more easily, you can modify the PDB table and variable names in the file to which the CPDDUTL control statements were written. For the naming conventions of user-defined tables and variables, see Open Systems and Windows NT Appendix 1: Tables and Variables Naming Convention.

  3. Run the %CPDDUTL macro to create the table and variable definitions in your PDB.

    In the body of the SAS PROGRAM EDITOR window, type the following:

       %cpddutl(filename='rfc1213.ddu');
       run;

    Then if your PROGRAM EDITOR window has pull-down menus, select Locals and Submit; otherwise, type SUBMIT on the command line and press ENTER or RETURN. %CPDDUTL creates the table and variable definitions in your PDB.

  4. Optionally create formats for MIB enumeration types.

    If you used the -f rfc1213.sas option when you ran mib2dict, then you need to execute rfc1213.sas. This SAS program executes the SAS FORMAT procedure, which creates the new formats and installs them in the active PDB's DICTLIB.CPFMTS catalog.

    If your PROGRAM EDITOR window has pull-down menus, select File and Open, locate rfc1213.sas, and select Open; otherwise, type include rfc1213.sas on the command line and press ENTER or RETURN. Then select Locals and Submit; or type SUBMIT on the command line and press ENTER or RETURN.

  5. You are now ready to process raw data into your new PDB.

    In our example we used the mib2dict -c hp-ov option to specify HP-OV as the collector. Thus, to process data (for example, for ifTable in the newly built UIFTBL table), you could submit the following from the PROGRAM EDITOR window:

       %csproces (/usr/OV/databases/snmpCollect/,
                  UIFTBL,
                  collector=HP-OV);