ASL syntax lists available ASL syntax.

Table 1. ASL syntax

Syntax

Description

!=

Indicates not equal to.

+

Indicates an addition operator.

-

Indicates a subtraction operator.

*

Indicates a multiplication operator.

/

Indicates a division operator.

%

Indicates a modulus operator. Calculates by using integer or floating-point numbers.

&&

Indicates a logical AND.

.

(Period) pattern matching. Indicates that the next pattern must be matched immediately.

.

(Period)action block. Concatenates two strings.

..

(Double period) Used to indicate an undefined string of characters up to the next pattern match.

||

Indicates a logical OR.

+=

Adds an object to a relationship.

?

Pattern matching. Matches one or zero times.

?

Action block. Exception handling operator.

<

Indicates less than.

<=

Indicates less than or equal to.

-=

Removes an object from relationship.

==

Indicates equal to.

>

Indicates greater than.

->

Used to reference properties of an object.

->*

Used to reference properties of an object by using a variable for the property name.

>=

Indicates greater than or equal to.

any(<string>)

Represents any character in its argument string.

boolean(<value>)

Converts the argument to a TRUE or FALSE. All nonzero numbers are TRUE. Any other type is converted to an uppercase string and compared to TRUE or FALSE. If it does not match either, it returns an error.

break

Used to break out of a loop.

case = [exact]|[ignore]

A variable that determines whether string matches are case-sensitive (default is exact) or not.

char

Represents a character, not an eol or fs.

consistencyUpdate()

Causes the Domain Manager to recompute the correlation rules.

continue

Used to move to start of loop and start with the next element.

correlate()

Causes the Domain Manager to correlate events.

create(<classname>,<objectname>)

Creates an object.

create(<objhandle>)

Creates an object handle which represents an instance.

default

Defines the value to use for a variable if the variable is not assigned a value.

defined(<variable>)

Determines whether a variable is defined.

delete()

Deletes an object on the Domain Manager.

delim

Defines delimiters.

do

Marks the beginning of an action block.

else {<statements>}

Alternative actions when an if statement fails.

eol

Represents the end of a line of data.

exact

Used in conjunction with “case” to make all string matches case-sensitive.

FAIL

Keyword for exception handling. Causes a rule to fail when an exception occurs.

FALSE

A Boolean false.

feError()

Returns a Boolean value. TRUE if the front end has reported a failure to read data.

feErrorMsg()

If the feError() function is true, the feErrorMsg() function returns a string that describes the error.

feErrorReset()

Resets the error state so that there is no error.

filter

Marks the beginning of a filter block.

float

Represents a floating number, including an optional minus sign.

foreach <variable> (<list_or_table>) {<statements>}

Iterates over the values of a list or the index of a table. Variable is assigned successive values of the list of table.

fs

Represents a field-separator.

getCauses(<classname>,<objectname>, <eventname>[,<oneHop>])

Returns a list of problems that can cause that event. Each element of the list is a list that contains classname, objectname, and eventname of the root cause that causes that event.

getChildren(<classname>[,recursive])

Retrieves the list of classes derived from the specified class.

The recursive parameter is optional.

  • If omitted or false, only the immediate child classes are retrieved.

  • If true, all children, including those of derived classes are retrieved.

getClosure(<classname>,<objectname>,<eventname>[,<oneHop>])

Given a root cause or aggregation (compound), returns a list of symptoms for that root cause. Returned list is similar to the getCauses() function.

getEventClassName(<classname>, <eventname>)

Returns a string with the name of the ancestor class associated with a class and an event.

getEventDescription(<classname>, <eventname> )

Returns a description for an event. The description string is defined in MODEL.

getEventType(<classname>, <eventname>)

Returns a string that indicates the type of the event (PROBLEM, EVENT, AGGREGATE).

getExplainedBy(<classname>, <instancename>,<eventname>[,<oneHop>])

Returns those problems which the MODEL developer has listed as explaining this problem.

getExplains(<classname>, <objectname>,<eventname>[,<oneHop>])

Given a root cause, returns the alternate closure as defined in MODEL.

getInstances(<classname>)

Returns a list of strings (not object handles) that are the names of the instances of that class.

getRuleFileName([<fullname>])

Returns the filename of the currently executing rule file.

getServerName()

Returns the name of the Domain Manager.

getExternalString(<table>, <key>, <locale>)

Extracts a string given a table name, key, and locale, and renders the string given a list of substitutions (up to six).

glob(<pattern>,<string>)

Enables glob style pattern matching. Standard glob syntax. Returns a Boolean.

global

Defines the scope of a variable as global. If more than one adapter for a repository, global values can be shared.

hex

Represents a hexidecimal number. There is no minus sign.

hexToString(<hexadecimal>)

Converts a hexidecimal number (the argument) to a string.

if (<conditional expression>) {<statements>}

Represents a conditional statement.

ignore

Used in conjunction with “case” to make all string matches NOT case-sensitive.

IGNORE

Exception handling, ignores exception and continue.

input=string

Defines the input for parsing.

integer

Represents an integer, including an optional minus sign.

is(<objecthandle>-><Relate>,<object2handle>)

Tests whether an object is a member of a relationship.

isNull()

Tests whether an object handle points a valid object. If TRUE, object does not exist.

len(<number>)

Moves the current starting position of an input string a number of characters.

list(<listitem1>,<listitem2>,<listitem3>, etc.)

Creates a list variable. Can either be used with arguments or without.

local

Variable scoping keyword.

LOG

Keyword for exception handling. Writes to the system log when an exception occurs.

LOG(<loglevel>)

Keyword for exception handling. Writes to the system log when an exception occurs and allows the classification of the exception’s severity.

NEXT

Keyword for exception handling. Skips remaining actions in do block and goes to next rule.

NO_LOCK

Argument passed to the transaction() function.

not(<pattern>)

Does not match if pattern matches. Matches if the pattern does not.

notany(<string>)

Matches any character not included its argument <string>.

numeric()

Attempts to convert the argument to a number. If it is a Boolean, it returns 1 if TRUE and 0 is FALSE. If it is a string, it tries to interpret it as a number. If it cannot, an error occurs.

object([<classname>,]<objectname>)

Converts a name to an object handle.

object(<objhandle>)

Returns an object handle.

peek(<pattern>)

Prescan input for a pattern and match or fail it. The search position does not change by using peek.

print(<string>)

Prints the argument string to the screen.

quit()

Shuts down the VMware Smart Assurance process the adapter is talking to. This can be the adapter or a Domain Manager.

Tells the back end to shut down.If you launch sm_adapter and do not specify a back end, the adapter becomes its own back end. In such cases, quit() does the same thing as self->quit().

READ_LOCK

Argument passed to the transaction() function.

rep(<pattern>[,<Number>])

Repeat pattern or rule a defined number of times or until it fails.

return <string>

Returns a value from a do block.

self

Same as self->

self->

Directs functions that interact with the repository to use the adapters repository and not the Domain Manager's. Used in conjunction with adding objects to the adapter's repository.

setLocale(<locale>)

The <locale> is the RFC-1766/3066 compliant specification for language and country. The return value is a string representation of the previous setting of the locale, or a default value if setLocale() has not yet been called.

sizeOf(<string>)

Counts the number of characters in a string.

sizeof(<string>)

Counts the number of characters in a string.

sleep(<number>)

Causes the adapter to sleep for a certain number of seconds.

STOP

Exception handling. Stops the ASL script.

stop()

Stops the current thread. If you call stop() in an ASL thread, and that thread is in a process that has other threads, the effect is to simply stop that thread. But if that thread is the only thread, which is the typical case when using sm_adapter, stopping that thread effectively stops the adapter (because the adapter shuts down when there are no more active threads).

string(<value>)

Converts the argument to a string.

substring(<string>,<start_pos>,<num_chars_to_remove>)

Returns a new string that is a piece of the string passed to it.

tab(<integer>)

Moves the starting position in an input string to the position passed to the function. This cannot be used to go backwards. If no argument is specified, this function returns the starting position for pattern matching in an input string.

table()

Creates a table variable.

thread()

Returns the thread ID of the thread that is running the adapter.

time()

Returns the system time.

toLower(<string>)

Converts string to lowercase letters.

toUpper(<string>)

Converts string to uppercase letters.

trace(<string>,BOOLEAN)

Makes tracing available from with ASL

transaction([<WRITE_LOCK|READ_LOCK|NO_LOCK>] )

Starts a repository transaction. Allows updates to a Domain Manager to be entered and then committed all at once. Needs to be committed before changes in the Domain Manager are accepted. Use the abort() function instead of the commit() function to remove changes. If a START rule begins before things are committed, they are automatically stopped. NO_LOCK is the default.

TRUE

Boolean true.

undef()

Undefines a variable. Appears as if the variable was never assigned.

while

Conditional statement causes loop while condition is true.

word

Represents a series of characters ending with, but not including, a delimiter.

WRITE_LOCK

Argument passed to the transaction() function.