| Solstice Enterprise Manager 4.1 Customizing Guide |       | 
Debugging Request Templates
There are several facilities available to you in debugging Nerve Center request templates:
- The Design Advanced Requests tool does RCL syntax checking when you attempt to save a newly created, or modified, condition. However, the Design Advanced Requests tool will not catch possible runtime errors.
- The Basic Requests tool (accessible from the Network Views menu) lists the requests currently executing in the Nerve Center. If you select a request and click Examine, the Request Examine window is invoked. This window displays the values of variables in the request as it is executing. (Refer to Chapter 4 in Managing Your Network for information on the Basic Requests tool.)
The Solstice Enterprise Manager (Solstice EM) em_debug utility also provides facilities that are useful in debugging templates.
This chapter describes the following topics:
- Section 16.1 Nerve Center Debugging Agents
- Section 16.2 Activating RCL Print Statements
- Section 16.3 Turning Off Debug Agents
16.1 Nerve Center Debugging Agents
As a part of em_debug, there are a number of Nerve Center debugging "agents" which track aspects of Nerve Center operation and display messages in the shell where they are invoked.
- nc_state--Traces transitions from state to state, indicating the current state and the condition used to transition out of a state.
- nc_poll--Traces the enabling and disabling of polling in states.
- nc_event--Provides information on all event notifications that have been received.
- nc_error--Provides information on Nerve Center runtime errors.
For example, you can activate the nc_state agent by entering the following command:
In reporting on state transitions in a running request, nc_state refers to states by number. States are numbered by order of appearance in the left-most column in the Design Advanced Requests textual display.
You should invoke the debugging agents before launching the request in the Network Views.
The Nerve Center debugging agents report on the activities of any request running in the MIS. If you have multiple requests running, it may be difficult to isolate which request is the cause of a message that is displayed. For this reason, it is recommended that you only have the request running which you are trying to debug when using the NC debugging agents.
16.2 Activating RCL Print Statements
Request Condition Language provides a print() function which you can use in conditions to help you in debugging templates--by printing current values of variables, for example. You can use the following em_debug command to activate RCL print() statements:
The RCL print() statements will be displayed in the shell where this command was invoked.
As with the NC debugging agents, the misc_stdout agent turns on print statements for all requests running in the MIS that contain the print() function. If you follow a practice of removing print() statements from templates after new conditions have been debugged, you can use print() statements to debug new templates even while other requests are running in the MIS. Only messages from the request being debugged are then displayed.
Keep in mind that the RCL print() function always returns a value of true. If a print() statement is the last statement in a condition that defines a transition, that transition will always occur. Accordingly, when debugging a template, you may want to avoid print() statements in conditions that define transitions, and restrict them to conditions that are used as actions after a transition.
Note  An RCL print() statement will only be executed if it is in a condition that is evaluated. If a state is never "woken up" by either a poll for an attribute value or the arrival of an incoming event, the conditions defining the transitions out of that state will never be evaluated. Also, the conditions that define transitions out of a state are evaluated in the order they appear in the template. If a prior condition has evaluated to true, and the request transitions out of the state, the subsequent transitions in that state are not evaluated.
16.3 Turning Off Debug Agents
You can turn off a particular debugging agent by entering the following commend:
If you want to turn off all debugging, you can use the em_debug wildcard feature, as follows:
| Sun Microsystems, Inc. Copyright information. All rights reserved. | Contents | Previous | Next | Index |