Designing and Managing Behavior Models - Using Trap Masks - Writing a Trigger Function - Functions for Use in Trigger Functions -
Previous: Writing a Trigger Function     Next: Variables for Use in Trigger Functions

Functions for Use in Trigger Functions

NerveCenter provides a number of functions (actually Perl subroutines) that facilitate the writing of trigger functions. The list below indicates what types of functions are available and where you can find detailed information about each function:

Variable-Binding Functions

Before looking at the variable-binding functions, let's make sure that we're using the same terminology.

When a trap arrives, NerveCenter looks at the trap's variable bindings and, for each variable binding, it sees an object and a value.

Variable Binding

trapMasks5a.gif

In this case, the object is the OID encoding of the object type (sysDescr) plus an instance, and the value is a string that describes the system.

When NerveCenter sees this variable binding, it stores the following information. The portion of the OID that corresponds to the system group is stored as the binding's base object, and the instance (0) is stored as the binding's instance. When concatenated, the base object and the instance form what NerveCenter calls a subobject.

Base Objects, Instances, and Subobjects

trapMasks9a.gif

The variable sysDescr is stored as the binding's attribute.

Attributes

trapMasks10a.gif

Finally, the value "Windows NT Workstation" is stored as the binding's value.

The variable-binding functions give you access to a binding's subobject, attribute, and value. There's also a function that returns the number of variable bindings in a trap or trigger.

Each of the variable-binding functions is explained below:

VbAttribute()

Syntax: VbAttribute(index)

Description: Returns the attribute from the variable binding with an index of index. The first variable binding has an index of 0.

VbNum()

Syntax: VbNum()

Description: Returns the number of variable bindings in the trap's variable-binding list.

VbObject()

Syntax: VbObject(index)

Description: Returns the subobject from the variable binding with an index of index. The first variable binding has an index of 0.

VbValue()

Syntax: VbValue(index)

Description: Returns the value from the variable binding with an index of index. The first variable binding has an index of 0.


Previous: Writing a Trigger Function Next: Variables for Use in Trigger Functions
Please send comments or corrections to Information Development
This file was last updated on 10 October 2000