Variables allow administrators to make a single change that can be picked up by multiple rules. For example, variable are useful in the following cases:
- if you have actions that send an email: rather than typing the email address into each action, you can create a variable that contains the email address. If the email address changes, you can simply update the variable, and all the actions that use the variable will also be updated.
- to control when particular actions are enabled: using the example of an action that sends an email, you could add a test against a variable, so that an email would only be generated when the variable contains the value true.
To create a new variable:
- Click the Main Menu and then Administration.
- On the Administration page, click Event Administration.
- On the Event Administration page, click the Variables tab, and then click Add.
- This will open the New Variable window. Enter a Name and Description for the new variable in those fields.
- Enter the value of the variable in the Value field. This value must be entered in a format suitable for Groovy syntax:
- numbers are entered verbatim, e.g. 1.
- strings are enclosed within quotes, e.g. "an.employee@entuity.com".
- Click Choose to open the Choose Variable or Function window.
- In the Value Kind dropdown field, select either Function Call or Variable Reference, depending on what you want the variable to do.
- Function Call allows you to select from the following functions in the Function dropdown field:
- lookupDevice - looks up inventory for a device by its name or IP address.
- lookup Port - looks up inventory for a port by its name or IP address and ifIndex.
- once you have selected your function, select a parameter from the Parameters field and click Set.
- Variable Reference allows you to select from a previously saved variable that you have created.
- Function Call allows you to select from the following functions in the Function dropdown field:
- In the Value Kind dropdown field, select either Function Call or Variable Reference, depending on what you want the variable to do.
- Click OK to save the variable, otherwise click Cancel.
Comments
0 comments
Please sign in to leave a comment.