Site/SunNet/Domain Manager Administration Guide
검색에만이 책은
PDF로 이 문서 다운로드

Customizing SunNet Manager

10

This chapter discusses the following topics:
  • Adding background image to current view
  • Creating types of elements
  • Creating a new glyph for an element type
  • Modifying the tools menu for an element type
  • Adding agents and glyphs
  • Forwarding Novell's NMS Alarms to SunNet Manager

10.1 Adding Background Image to Current View

You may find it helpful to place elements in views relative to their physical locations to each other. A Console view may be superimposed upon a background image, such as that of a region map or the layout of a building.
  1. Create the background with your favorite graphics tools (for example, Island Paint).

    The background canvas can be any size. A size no larger than 1120 x 800 is recommended for standard resolution displays. The image should be in raster file format. Icon format is supported if the file ends with the extension .icon. Large backgrounds in icon format load much more slowly than raster format files.

  1. In the Console window, invoke the View >> Add Background option.

You receive an Add Background file menu, as shown in Figure 10-1.

그래픽

Figure 10-1

  1. Double-click SELECT on the file of your choice in the Add Background file menu.

    The background contained in the selected file is displayed in the SunNet Manager Console, as shown in Figure 10-2.

그래픽

Figure 10-2

After you save the runtime database to a file, the background you add to a given view is displayed each time you select that view.
To save the runtime database to an ASCII file, do the following:
  1. In the Console's File button, press MENU on Save >> Management Database and release MENU.

그래픽

Figure 10-3

You receive the file menu shown in Figure 10-4.

그래픽

Figure 10-4

In the file menu, enter or select the directory and file name of the file you want to save. Click SELECT on the Save button.
When you restart the Console with a command such as the one below, you receive the view with the background that you added.

  hostname% snm -i $HOME/snm/databases/japan.dbase  

Note that the pathname specified as an argument to snm, above, is an example.

10.1.1 Background Images

You can have up to 1024 icon or raster files defined in the runtime database; this includes background images as well as element glyphs.
In addition to changing the background image with the Console option described in this section, you can also edit the ASCII file that contains the runtime database to achieve the same effect. With a text editor, open this ASCII file. Define a viewBackground instance record that specifies the name of the view and the path name of the background image.
Database definitions for background images are described in "Part 2: Reference."
By editing the ASCII file containing a database, you can add a background to a view other than the current view. However, it is generally easier to use the Console menu item to add or remove a background than it is to edit a file and load the modified database. Also, the Console option is far less prone to error than the file-editing option.

10.2 Creating Types of Elements

The elements.schema file defines many general types of elements, such as SPARCstations and SPARCservers. If necessary, you can create additional element types for your database.
  1. With a text editor, create a file with the extension .schema in a directory specified by the Schema Directories category of the Console Properties >> Locations window.

    The default locations for these directories are:

  • /opt/SUNWconn/snm/agents or /opt/SUNWconn/snm/struct for Solaris 2.x
  • /usr/snm/agents or /usr/snm/struct for Solaris 1.x If you create a schema file in another directory, you should specify the directory in the Console Properties >> Locations window. The steps for adding a path to this window are described in "Adding Agents and Glyphs" later in this Chapter.
  1. Create a record that defines the element type and the fields that are stored in the database for the element type.

    Database definitions for element types are described in "Part 2: Reference." Define a glyph to be used to represent the element type. You can also define the tools that will be available for this element type.

    See "Creating a New Glyph for an Element Type" later in this Chapter for information on creating an icon for the element type. See "Modifying the Console Tools Menu" later in this Chapter for information on defining tools for the element type.

  2. Load the new element type definition into the runtime database:

In the Console's File button, press MENU on Load >> Management Database and release MENU as shown in Figure 10-5.
An alternative to loading the file into the runtime database is to exit the Console (you may want to save the runtime database), then reinvoke the Console (snm -i). The new schema file will be automatically loaded in the new Console session.

그래픽

Figure 10-5

e. In the file menu you receive (shown i n Figure 10-6), enter or select the directory and file name for the schema file where the new element type is stored and click SELECT on Load.

그래픽

Figure 10-6

  1. Create element instances of the newly loaded element type with the graphical editor.

Starting with version 2.3 a new file, network_elements.schema, is available which contains the Novell IPX component definition.

10.2.1 Element Categories

There are four categories of elements. You cannot create new element categories. The element categories are:
  • Component. Includes elements such as workstations, printers, and routers.
  • View. Includes elements such as subnets and buildings. Views can contain other views or components.
  • Bus. Includes an Ethernet LAN segment. A bus appears as a line with movable endpoints.
  • Connection. Includes links and RS-232 lines. A connection connects two other elements and appears as a line between the two elements.
Element types are defined in a record that specifies the element category and the name of the element type. Refer to "Part 2: Reference" for more information about the element type record definition.

10.3 Creating a New Glyph for an Element Type

Each element type defined in the elements.schema file is represented by a glyph. The elements.schema file is normally located in the following directory:
  • /opt/SUNWconn/snm/struct for Solaris 2.x
  • /usr/snm/struct for Solaris 1.x
You can create your own glyphs to represent an element type.
  1. Save the runtime database to an ASCII file.

    a. In the Console's File button, press MENU on Save >> Management Database and release MENU. (See Figure 10-5.)

    b. In the file menu, enter or select the directory and file name of the file you want to save. (See Figure 10-6.)

    c. Click SELECT on the Save button.

  2. Create an icon using the OpenWindows Icon Editor or your favorite utility. The icon file name should be <iconname>.icon. Icons shipped with SunNet Manager are 32 by 32 pixels in size. Icons to be used with the Console can be 32, 48, or 64 pixels wide and any reasonable height.

  3. You can also define a second icon--the icon mask--to be used as a stencil when coloring or inverting the icon.

    This step is optional. The icon mask should be black for bits that you wish colored or inverted. The icon mask should have the path name iconname.iconmask. If you do not define an icon mask, a rectangular icon is assumed.

  1. In the element's schema file, define an elementGlyph instance specifying the component or view and its icon path name.

    If the icon path name begins with a slash (/), it is treated as an absolute path. Otherwise, the path name is relative to the directories specified in the Console Properties window. Refer to "Part 2: Reference" for more information.

  2. Restart the Console with the -i option and specify the ASCII file in which the runtime database was saved.


Note - You can have up to 1024 icon or raster files defined in the runtime database; this includes background images as well as element glyphs.

10.4 Modifying the Console Tools Menu

Starting with version 2.3, in addition to being able to add new tools to the Tools Menu, you can create cascaded submenus and associate commands with different menu items.
  1. In the Console window, press MENU in Tools >> Customize and release MENU. You receive the window in Figure 10-7.

  2. Click SELECT on the Menu check box.

  3. Enter the name of the Menu or Tool you are adding.

  1. In the Console window press MENU in Tools >> Customize and release MENU. You receive the window in Figure 10-7.

그래픽

Figure 10-7

  1. Add a new entry or modify an entry.

    a. To add an entry enter the tool name in the Tool Name line, as you want it to appear in the Console Tools menu.

    b. Enter the tool's complete pathname in the Command line.

    c. Click SELECT on the Add button to add your entry to the Tools List. d. Click SELECT on Apply for your change to take effect.

  2. To modify an entry in the Tools List, click SELECT on the entry.

    The tool's name appears in the Tool Name line as it is displayed in the Console Tools menu. The tool's full pathname appears in the command line.

    a. Make any edits you want and click SELECT on Change. b. Click SELECT on Apply to make the change take effect.

    c. Click SELECT on Reset to restore the menu to the state it was in when you first invoked the Customize option.

Any changes you make to the Console's Tool menu remain in effect until the next time you invoke snm with the -i argument. The contents of the Tool menu are part of the runtime database. As such, they are saved when you invoke File >> Save >> Management Database to save the database to an ASCII file.

10.5 Modifying the Tools Menu for an Element Type

A SunOS command can be defined to appear in the Tools menu of an element type.
  1. Save the runtime database to an ASCII file.

    a. In the Console's File button, press MENU on Save >> Management Database and release MENU. (See Figure 10-3.)

    b. In the file menu, enter or select the directory and file name of the file you want to save. (See Figure 10-4.)

    c. Click SELECT on the Save button.

  2. Using a text editor, open the .schema file that contains the element type for which you are adding or modifying a user command. If you are adding or modifying Tools menu options for an element type that is supplied with SunNet Manager, open the elements.schema file. The elements.schema file is normally located in the following directory:

  • /opt/SUNWconn/snm/struct for Solaris 2.x
  • /usr/snm/struct for Solaris 1.x If you are adding or modifying Tools menu options for an element type that you have created previously, open the appropriate .schema file.
  1. Restart the Console with the -i option and specify the ASCII file in which the runtime database was saved.

10.6 Adding Agents and Glyphs

See the Section, "Creating a New Glyph for an Element Type" in this Chapter for instructions on creating new glyphs.
You add agents and glyphs by appending the paths to the directories that contain them to the Schema Directories and Icon Directories items in the Console's Properties >> Locations window. These might be agents and glyphs shipped with another Sun product, such as SunLink X.25, or agents and glyphs provided by a party other than Sun.
  1. In the Console window, click SELECT on Props.

  1. In the Properties window, press MENU on the Category abbreviated menu button and release MENU over Locations. You receive the window in Figure 10-8.

그래픽

Figure 10-8

  1. To add a path, append a colon to the last path and enter the path where your agents or icons are stored and then click SELECT on Apply.

    Following this, you must quit and reinvoke the Console, to make the new agents and icons available.

An alternative to the procedure described here is to simply copy the agents and glyphs (after ensuring there are no same-name collisions) to the directories already specified in the Properties >> Locations window. This alternative is acceptable if you do not want to keep the SunNet Manager-supplied agents and glyphs separate from agents and glyphs you obtain from other sources. With either alternative, all agents and glyphs will be available to you whenever you create a new network element, or modify the properties of an existing network element.