11   Tools

11.1   Tool Configuration

External tools like a PDF viewer, SNMP tool, or code generator program like AgenPro 2 can be easily integrated with MIB Designer. Choose Tools>Configure from the main menu to configure an external program for usage with MIB Designer with the dialog shown on the left.MIBDesigner200071.png

Figure2-31:   Tool Configuration

In the above example, four tools have been configured. Each tool is listed by its title and gets populated in the Tools>Run Tool menu by the same order as displayed in the configuration dialog.

To add a new tool, press the Add button and the Tool Editor dialog will be displayed where the tool can be defined by the following properties:

MACRO

Description

$MODULE_NAME

This macro will be replaced by the currently edited MIB module name when the tool is executed.

$MODULE_AS_HTML_FILE[=<moduleName>]

The current module (or the MIB module with the specified name after the optional = sign) is exported as a HTML file into a temporary file. The macro is then replaced by the file name of the temporary file on the tool’s command line.

$MODULE_AS_PDF_FILE[=<moduleName>]

Same as above, except that the MIB module is exported as a PDF file.

$MODULE_AS_TXT_FILE[=<moduleName>]

Same as above, except that the MIB module is exported as a plain text file.

$MODULE_AS_XML_FILE[=<moduleName>]

Same as above, except that the MIB module is exported as a XML file.

$MODULE_AS_XSD_FILE[=<moduleName>]

Same as above, except that the MIB module is exported as a XML schema file.

$REPOSITORY

This macro is replaced by the path to the MIB repository of MIB Designer. This macro can be used to run command line versions of MIB Explorer and AgenPro 2.

$SELECTED_OID

This macro is replaced by the object identifier of the currently selected node in the MIB tree of the edited MIB module. If the node does not have an OID (e.g. a textual convention) then “0.0” is inserted instead.

Table 1: Macros for the tool configuration.

 

To remove a tool from the configuration, select the tool in the list and press the Remove button. To change the order of the tools in the run menu, select a tool and press the Move Up or Move Down button.

The tables that follow provide a few example tool configurations that might be helpful illustrate the capabilities of the tool integration interface.

Title

PDF Viewer

Program

C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe

Parameters

$MODULE_AS_PDF_FILE

Working Directory

 

Table 2: Example configuration for a PDF Viewer.

Title

SNMP4JCLT Sub-Tree Browser

Program

/usr/bin/java

Parameters

-jar SNMP4J-CLT.jar –c public -v 2c -L „<License>“ <Key> walk udp:127.0.0.1/161 $SELECTED_OID

Working Directory

~/snmp4jclt

Table 3: Example tool configuration for SNMP4JCLT sub-tree browsing. Note: You have to provide your MIB Designer license and key on first execution. The license has to be enclosed in double quotes. For more help run „-jar SNMP4-CLT.jar help“.

Title

Dump HOST-RESOURCES-MIB

Program

C:\WINDOWS\SYSTEM32\CMD.EXE

Parameters

/C type $MODULE_AS_TXT_FILE=HOST-RESOURCES-MIB

Working Directory

 

Table 4: Example tool configuration for dumping a MIB module to the console.

Title

AGENT++ Stub Generation

Program

/home/agentpp/agenpro2/agenpro.sh

Parameters

projects/$MODULE_NAME.prj

Working Directory

/home/agentpp/agenpro2

Table 5: Example tool configuration for generating stub code with AgenPro by using a project file named by the current MIB modules name.

 

11.2   Tool Execution

To execute a tool, choose it from the Tools>Run Tools sub-menu. If there are no items in the sub-menu, no tools have been defined yet. See section “Tool Configuration” on page 63 for a description on how to configure tools then. The first ten configured tools can be directly run by pressing <Alt>+<1> through <Alt>+<9> and <Alt>+<0>.

Tools are executed synchronously. Thus, MIB Designer will not respond to key and mouse events until the executed tool as been terminated. The output of the last tool run is displayed in the lower right panel where MIB Designer also displays SMI checker error messages. If the executed process (tool) generated any output on stdout, the output will be displayed with blue foreground. If it generated output on stderr, then the output will be displayed with orange foreground.