Previous Next Contents Generated Index Home


Chapter 3

Introduction to the Reference Manual




This chapter covers the following topics:


The Different Parts of this Manual

The Sun Management Center Developer Environment documentation provides information on the following general topics, divided into three parts:

A Glossary and an Index are included.

This document also contains a lot of examples. The examples provided in this document are provided purely for reference. The client API examples will be placed in a directory from which you can copy and run them for your purposes. The location of the examples directory will be provided in the following file:

opt/SUNWsymon/sdk/docs/index.html

The procedures described in the following sections allow you to work within the broad areas covered in this document. They also introduce scenarios to help you understand the usage of the Sun Management Center Developer Environment Manual from a functional perspective.

Two main types of information are included:


Accessing Information in this Manual

To access the information you need, you can refer to the "Contents" on page iii or the "Index". However, you can also review the major topics identified below and proceed to specific sections and chapters. This section includes pointers for the following major functionality:

  1. Installing Sun Management Center Developer Environment
  See the following chapter:
  2. Building Modules
See the following chapters:
  3. Writing Rules
  See the following chapter:
  4. Building Consoles
  See the following chapter:
  5. Using Client API
  See the following chapter:
  6. Conforming to Internationalization & GUI Guidelines
  See the following chapters:
  7. Packaging Your Product
  See the following chapter:
  8. Working within the Agent Interactive Mode
  See the following chapter:

Note - This document also includes a troubleshooting section and several appendices.


Building Modules

This section describes the steps to build a simple module:

  1. Name Module Definition Files.
  2. Specify Module Parameters.
  3. Create a Data Model.
  4. Realize the Data Model.
  5. Add Alarm Checks.
  6. Install Module Files.
  7. Load a Module.
  8. Log Data and To Activate Debug Mode.
  9. Write a Module from an existing SNMP MIB.
  10. Publish an SNMP Interface.

 

Name Module Definition Files

   Select a unique name for the module that must be used in naming module definition files.
_
 

Specify Module Parameters

  1. Decide on the module requirements.
  2. Specify the standard or mandatory set of parameters.
  3. Specify any optional parameters that are required for the module.
  4. Specify any parameters for internationalization.
  When done, all the parameters go into the following file:

<module><-subspec>-m.x


 

Create a Data Model

  1. Identify the components and properties that must belong to the module.
  2. Define the data model structure.
  Create the hierarchical structure of the managed object classes and properties. For each of the nodes in the MIB tree for the module:
  i. Add the structural primitive.
  ii. Assign data and alarm and rule type primitives to properties.
  iii. Add the node description and units.
  iv. Add the qualifiers for internationalization.

When done, place the contents into the following file:

<module>-models-d.x


 

Realize the Data Model

  1. Determine the data acquisition method to use:
  2. Incorporate the data model into the module framework.
  3. Add data acquisition services.
  4. Add operational types to the node.
  5. Add refresh parameters.

When done, all the parameters go into the following file:

<module>-d.x


 

Add Alarm Checks

  1. If a property has a threshold type alarm check, define thresholds in the file: <module>-d.def. Do the following:
  a. Specify the alarm criteria.
  b. Specify alarm severity.
  c. Specify alarm actions.
  2. If the property has rules:
  a. Determine if the rules need to have any editable threshold parameters.
  b. Define all the rule initialization parameters in the file:
<module>-ruleinit-d.x.
The error messages required for the rules must be defined in the file:
<module>-ruletext-d.x.
  c. Create the rules. The <module>-d.rul file contains the rule logic.
  d. Assign the appropriate rule to the property in the <module>-d.x file using the alarmRule qualifier.

 

Install Module Files

   Make sure that each of the following directories contains the respective module files listed under its directory listing:
_
  1. /opt/SUNWsymon/modules/cfg
  2. /opt/SUNWsymon/modules/sbin
  3. /opt/SUNWsymon/base/lib/sparc-sun-solaris2.(x)

 

Load a Module

  1. Start all Sun Management Center components.
  Preferably start the agent interactively. This also enables you to debug the module. For more information on starting the agent interactively, see the Chapter 11.
  2. In the Sun Management Center console, highlight the host you want to monitor with your new module loaded.
  3. Bring up the Load Module Window. Select the module you want to load.
  Refer to the Sun Management Center Software User's Guide for more information on module loading.

 

Log Data and To Activate Debug Mode

  Currently, all debug information is logged in circular log files in:

/var/opt/SUNWsymon/log directory

  For more troubleshooting information, such as this, refer to the Chapter 23.
   To see the contents of these files, use the following commands:

/opt/SUNWsymon/util/bin/sparc-sun-solaris<2.x>/ccat 

_
  This is similar to the cat command in UNIX.

/opt/SUNWsymon/util/bin/sparc-sun-solaris<2.x>/ctail

  This is similar to the tail command in UNIX.
   To enable a specific level of debug message to be logged:
_
  a. Go to the following directory:

cd /var/opt/SUNWsymon/cfg

  b. Edit the domain-config.x file.
  For example, to enable logging for agent add the following lines to the agent section:

activeChannels = debug info error status history
defaultOutput   = "clog://localhost/../log ESAgent.log;lines=10000"

  This enables you to log debug, info, error, status, and history debug messages into the following file:

/var/opt/SUNWsymon/log/ESAgent.log

  The log file wraps around after every 10,000 lines of entry.
   To enable specific debugging when an agent is started interactively:
_
  a. Start the agent interactively:

/opt/SUNWsymon/sbin/es-start -ai

  b. Close any existing debug level currently set:
  For example, to turn off the channel open for information level messages, use the following command:

ddl close info 

  c. Open a new debug channel, for example:

ddl open info desc:stderr

  This command activates the info level debugging, and sends all the info level messages to stderr. You can also send these messages to stdout or to a file.
  d. To enable the corresponding debug level:

ddl enable info


 

Write a Module from an existing SNMP MIB

If you want to write a module for an SNMP MIB, do the following:

  1. Use MIB2x to generate the module configuration files.
  2. Update the module configuration files to implement data acquisition.
  3. Write the data acquisition code, with one or more of the following:
  4. Write the rules on the data properties, if required.

Note - This procedure is optional and, for example, is used if you want to define alarm limits on these properties.
  5. Install the module configuration files and other libraries/scripts/procedure files.
  6. Load the module into the agent.
 

 

Publish an SNMP Interface

If you have some data to be modeled and monitored using Sun Management Center and want to publish an SNMP interface for this data:

  1. Prepare the data model with the following information:
  2. Write a models file for the data model.
  3. Write the data acquisition code.
  4. Write the rules on the data properties if required.

Note - This procedure is optional and, for example, is used if you want to want to define alarm limits on these properties.
  5. Install the module configuration files and other libraries/scripts/procedure files.
  6. Start the agent in interactive mode.
  7. Load the module into the agent.
  8. Use mibExport to export the SNMP MIB for the module.


Building Consoles


 

Build Your Own Console

To build your own console to use in place of or in addition to the Sun Management Center console, do the following:
  1. Design the graphical user interface (GUI) using the Java programming language.
  Refer to the Chapter 20 for information on how to design your GUI to be consistent with the Sun Management Center.
  2. Obtain information from Sun MC programmatically through the Client API.
  Refer to Chapter 18 and the online Javadoc files for information on the client API.
  3. Invoke the Host Details bean to incorporate all the functionality provided in the console Host Details window.
  Refer to the description of the Host Details bean in the section, "To Invoke the HostDetailsBean" in the Chapter 16.

Note - For detailed information on building consoles, refer to the Chapter 16.

 

To Access Troubleshooting Information

  1. Go to the main Sun Management Center screen.
  2. Select File.
  3. Click on "Sun Management Center-Console Messages...".
  Sun Management Center displays error messages as applicable.


Using Client API


 

Use the Client API

  1. Log in to the session.
  2. Get the SMRawDataRequest handle from the SMClientRMIImpl Class.
  3. Use it in the constructor of other API class categories.
  4. Start using the classes documented in the Client API section.

The section incudes categories of classes and each category has examples that you use for reference purposes only. You may work with the examples that are part of the code directory.


Note - For more information on building consoles, refer to Chapter 18.


Using the Platform Agent

To hide your implementation of the Discovery Object Table, start the platform agent on the Sun Management Center agent machine, then load the Discovery Object Table on the platform agent.


 

To Start the Platform Agent

  1. Modify the file:

/etc/opt/SUNWsymon/symon.conf 

  2. Enter the following in the file:

platform

  3. Start the platform agent with the following commands:
  a. Stop the agent:

es-stop -A

  b. Enter one of the following commands to start the agent:

es-start -A 

or

es-start -l


 

How to See Changes that have been made to the Agent's module-d.x File

  1. Exit any Sun Management Center host detail screens.
  2. Login as superuser.
  3. Stop the agent with the following command:

% es-stop -a

  4. Restart the agent with the following command:

% es-start -a

  5. Bring back up the Sun Management Center host detail screen and test.


Conforming to Internationalization and GUI Guidelines


 

Work With a Java Application

  1. Create a .properties file for all text to be internationalized.
  If you need more information on this, refer to the Java documentation.
  2. Import the UcInternationalizer class into your objects:

import com.sun.symon.base.utility.UcInternationalizer;

  3. Wherever you display text that needs to be internationalized, enter UcInternationalizer.translateKey("<path to your resource is bundle>:<key>").
  For example, to display a label that uses a string defined by the key:

"myKey", do
      String s;
      s =
UcInternationalizer.translateKey("myPath.myResourceBundle:myKey");
      new JLabel(s);


 

Internationalize a Module

  1. Internationalize the module loader window:
  a. In the module parameter file (*-m.x), add two lines for each item to be internationalized. The two lines are:

?param:i18n<parameter>?i18n = yes
 param:i18n<parameter> = base.modules.<module>:<key>

For example, to internationalize the Fscan module name, add the following lines to fscan-m.x:

?param:i18nModuleName?i18n = yes
 param:i18nModuleName  = base.modules.fscan:moduleName

  b. Add the internationalized parameters to the list of parameters to be displayed in the module load window. For each internationalized string, add i18n<parameter> to the ConsoleHint:moduleParms(param) list.
For example, the Fscan module parameter list would be:

consoleHint:moduleParams(param) = module i18nModuleName version
location enterprise i18nModuleType instance instanceName
filename scanmode

  c. Create a property file. The name of the file is <module>.properties.
  d. Add an entry in the properties file for each internationalized string. The entry is of the form: <key>=<string>.
For example, for the Fscan module name, add the following entry:

moduleName=File Scanning

  2. Internationalize the text within the module.
  a. In the module models file, add the following line for each node:

consoleHint:mediumDesc = base.modules.<module>:<key>

For example, to internationalize the fileid node in the Fscan module use:

 consoleHint:mediumDesc = base.modules.fscan:fscanstats.fileid

  b. In the properties file created in Step c above, add the key/value for each internationalized string. This entry is the same as in Step 1 d:

<key>=<string>

  c. For example, key/value pair for the fileid node for the Fscan module is:

fscanstats.fileid=File Id


Note - For more information on building consoles, refer to the Chapter 19 and the Chapter 20.


Integrating Applications

User applications can be integrated into the console. There are primarily two places in the console where user applications can be added; one is in the Tools menu of the console main window and the other is in the Applications tab in the host details window. Refer to the Chapter 16 for more information.




Previous Next Contents Generated Index Home

Copyright © 2000 Sun Microsystems, Inc. All Rights Reserved.