Designing and Managing Behavior Models
-
Using Trap Masks - Writing a Trigger Function -
If a mask cannot completely describe the type of trap it is looking for by specifying the contents of the trap's Generic trap, Enterprise, and Specific trap fields, it must contain a trigger function. This function, which you write using Perl, can include additional conditions that the trap must meet, and it can fire different triggers as appropriate.
Most trigger functions are very similar in structure. They follow this pattern:
if (condition1) {
FireTrigger(arguments);
}
elsif (condition2) {
FireTrigger(arguments);
}
else {
FireTrigger(arguments);
}
The conditions, which can be arbitrarily complex, generally test the contents of a trap's variable bindings. However, they can test other information as well; for example, a condition can determine whether a trap came from a particular node. The FireTrigger() function fires a trigger, whose name, subobject, and node you can control.
To assist you in writing trigger functions, NerveCenter provides:
For further information about these predefined functions and variables and the pop-up help menu, see the following sections:
Also, see the section Examples of Trigger Functions. This section presents several sample trigger functions that show a number of the functions and variables being used in context.
Previous: Defining a Trap Mask | Next: Functions for Use in Trigger Functions |
Please send comments or corrections to Information Development | This file was last updated on 10 October 2000 |