Sun Management Center 3.6.1 User's Guide

Adding Customized Menu Items

Sun Management Center software enables you to customize the Tools menu by adding external, standalone applications that can be launched from the main console window. The application must be written in the Java programming language. Non-Java applications can be accommodated by the ExampleSystemCommand Java wrapper class that executes another program or shell script in a separate process. The application does not require a selected host object. The application has no further interaction with Sun Management Center once the application has been launched.

The name of the application is specified in the console-tools.cfg file. The application name is added to the Tools menu in the main console window below the standard Sun Management Center menu items. The application is launched in a separate window.

The console-tools.cfg file is a plain text file that resides on the Sun Management Center server host. The file may be modified at any time, including while the console is running. However, changes that are introduced by editing the files do not take effect until the es-tool script is executed and the console is restarted. The file consists of a series of lines, each of which describes an application. Blank lines and lines beginning with the pound sign (#) are ignored. Fields within each line are separated by commas (,).

Each application that is implemented as a shell script or as an executable binary is defined by a line with the following format:


menu_label,class [args]

where:

For example, the following file shows entries for three applications to be added to the Tools menu: Example GUI, rlogin, and ftp.

# Format:
# menu_label, class arguments

Example GUI,exampleApp.ExampleGUITool

Rlogin,com.sun.symon.base.client.console.SMSystemCommand 
"/usr/openwin/bin/xterm -e rlogin $host" "start rlogin $host"

exampleApp.ExampleSystemCommand:ftp,exampleApp.ExampleSystemCommand 
"/usr/openwin/bin/xterm -e ftp $host" "start ftp $host"

Caution – Caution –

Each entry must be specified on a single line, even though the text is shown wrapped in the example.


The Java wrapper class SMSystemCommand enables you to execute an arbitrary shell command. This class takes two arguments. The first argument is the shell command to execute.

The second argument is the command to run on a Microsoft Windows client. The following line is an example of this command:

com.sun.symon.base.client.console.SystemCommand "<shell command>" "<windows command>"

In this case, the first argument is ignored. Variable substitution is performed on the arguments if special variable references are present. Two variables are allowed:

ProcedureTo Customize the Tools Menu

  1. Use a standard text editor to add a line to the /var/opt/SUNWsymon/cfg/console-tools.cfg file.

    This line specifies the following items:

    • Name to display on the Tools menu

    • Fully-qualified Java class name for the application

    • Any required class arguments

    See the detailed description in the section introduction for more information.

  2. Place the Java class files for the applications in the /opt/SUNWsymon/apps/classes directory.

  3. Run the es-tool update script on the Sun Management Center server host.


    # /opt/SUNWsymon/sbin/es-tool /var/opt/SUNWsymon/cfg/console-tools.cfg
    
  4. Stop the console by choosing Exit from the File menu on the main console window.

  5. Click the Exit button to exit the application.

  6. Restart the console for the application to be added to the Tools menu.


    # /opt/SUNWsymon/sbin/es-start -c
    

    Note –

    Your site's configuration might also require you to restart the Sun Management Center server.