IBM Enterprise Console manual MAP Statement, MAPDEFAULT Statement, Example, nexpression

Models: Enterprise Console

1 194
Download 194 pages 8.78 Kb
Page 171
Image 171

There can be one or more clauses within a FETCH statement. Each clause has the following format:

n:expression;

where n is the identification number of a clause within a FETCH statement and expression is an expression specifying the value to assign the pseudo-variable $Fn. Pseudo-variables are the output from a clause of a FETCH statement. This expression can make reference to any pseudo-variable defined by the adapter, which could have been created from the SELECT statement or from a previous clause within the FETCH statement for the class.

An example of a FETCH statement is the following:

FETCH

1:SUBSTR ($V2, 1, 5 );

MAP Statement

The MAP statement of a class definition statement assigns values to the attributes of the event class instance.

There can be one or more clauses in a MAP statement. Each clause has one of the following two formats:

attribute_name=variable;

attribute_name=PRINTF(format_string,var1,...);

An example of a MAP statement is the following:

MAP origin=$AGENT-ADDRESS; msg=PRINTF("Link %s is DOWN",$V3);

The output from a MAP statement is a list of attribute name=value pairs that is used to generate the outgoing event for the event server.

MAP_DEFAULT Statement

Some attributes, like source and sub_source, could have a constant value for all the events generated by an adapter type. To not repeat identical clauses for MAP statements in all class definition statements for an adapter, the CDS file can contain a MAP_DEFAULT statement. The MAP_DEFAULT statement specifies default values for the mandatory attribute name=value pairs. The following example illustrates a MAP_DEFAULT statement:

MAP_DEFAULT source = SNMP; sub_source = NET;

# forwarding_agent = $SOURCE_ADDR; origin = $AGENT_ADDR; adapter_host = $ADAPTER_HOST;

END

Example

The following example shows a CDS file:

#

#Default attribute values

MAP_DEFAULT

Appendix C. Class Definition Statement File Reference 159

Page 171
Image 171
IBM Enterprise Console manual MAP Statement, MAPDEFAULT Statement, Example, nexpression