Open Systems and Windows NT Appendix 4: MIB to Dictionary Compiler | |
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/
.
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
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.
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
-i
option specifies rfc1213.mib
as the input file to be compiled. If
you do not specify -i
, then mib2dict
will expect input from stdin. -o
option specifies rfc1213.ddu
as the output file to which CPDDUTL
control statements are printed. If you do not
specify -o
, CPDDUTL control statements will print
to stdout. -f
option specifies that rfc1213.sas
is to receive the SAS statements for
PROC FORMAT. If you do not specify -f
,
then no PROC FORMAT statements are written to rfc1213.sas
. Note:
When you specify the -f
option, any CPDDUTL CREATE VARIABLE
statements that are generated by mib2dict
have a FORMAT= parameter that is set to
the proper SAS format, as defined in rfc1213.sas
. In a later action, you will execute rfc1213.sas
. If you do not execute rfc1213.sas
, the formats will not exist and you
will receive format errors when a value that uses
the non-existent format is to be displayed.
-c
option specifies what hp-ov
as the collector to use. If you do not specify -c
,
the collector will be set to an empty string. Note: When you specify
the -c
option, any CPDDUTL CREATE TABLE
statements that are generated by mib2dict
have a COLLECTOR= parameter that is set
to hp-ov
. In this example we use hp-ov
because we plan to use HP OpenView Network Node
Manager or IBM NetView for AIX to collect the
SNMP data. You may use any collector supported by
IT Service Vision that can collect SNMP data. Or
if you are logging SNMP data in an unsupported
format, you could use -c
generic
and use the IT Service Vision generic
collector capability to read the raw data.
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:
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.
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.
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.
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.
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);