Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Working with Rulebases : Creating Actions

Creating Actions
Each test has one or more related actions. An action can be of two types:
Consequence Action
This action is the consequence of a rule, such as an alert message or a custom script. The details are described below.
Creating an Alert Message with Variable Substitution
The following example shows how to create an alert message with variable substitution as a representative action.
To define an action:
1.
Go to Action screen.
Figure 15 Action Editing Screen
 
 
2.
In the Message field, type the alert text that you want to appear in the TIBCO Hawk WebConsole Alerts portlet.
In the Execute field, type the entire command line to send to the operating system of the agent machine.
In the Notification field, type the notification text that you want to appear in the TIBCO Hawk WebConsole Alerts portlet.
Specify a message recipient as recipient@domain.com. Specify a subject string, an SMTP mail server for sending the message, and message text.
3.
In the Alert Message field, type the following:
 
   Process ${Process Name} is using ${Mem Usage} KBytes
4.
To insert an internal variable, click Insert Variable and select Internal Variable from drop-down menu.
 
Internal variables available are:
 
To insert an external variable, click Insert Variable and select External Variable from the menu. ${External.<var name>} is inserted in the active string field. Replace <var name> in the syntax string with the name of the external variable defined in the properties file.
External variables are obtained from the variable file specified in the -variable option for the rulebase engine (suboption of -M RuleBaseEngine) when the agent is started.
To insert a local variable in a string argument, select a variable name from the menu.
Variable syntax is added to the string field at the cursor location. The syntax does not require modification. You can also manually type the syntax ${<return-field-name>} in the string field for an action, where return-field-name is the label for a value returned by the method. The microagent method that returns this field must be the data source for the current rule.
5.
Select the name of an existing schedule from the Schedule dropdown list to apply to this test. This is an optional field. By default, the test is always active. For more information, see Working with Schedules and Period Groups.
6.
Save But do not Deploy : To save until user logs out.
Save and Deploy: To save it and deploy it to the agent.
Using Advanced Action Features
Advanced action options add flexibility in timing when an action is performed. For example, using advanced options you can automate problem escalation procedures.
To use advanced action features:
1.
Click Show Advanced Options in the Action screen. The Advanced Action options are displayed:
2.
To specify how actions are performed, click the Maximum, Once until the alert message changes, Once Only, or Always radio buttons.
For Maximum, specify the maximum number of times the action can be performed, no matter how long the associated test continues to remain true. If the test becomes false, the counter is reset. Specify the number of seconds to wait between actions as long as the test is true. The related action can only be triggered at a test evaluation, so the actual interval between actions may be longer than the specified interval.
This option is useful when the action executes a paging script. A single page might be lost, but paging at each test evaluation (such as once per minute) is too often. With this option you can send the page every five minutes until it is likely to be received.
With Once until the alert message changes, the first time this action is triggered by a test, the action is performed. On subsequent true evaluations the action is performed only until there is a change in the alert message.
This option is applicable only if the associated action creates an alert message with some string variables. The action is performed each time the value of the string variable changes resulting in change in the alert message.
Substituting variables in alert messages overrules this feature. For more information, see How Variable Substitution Affects Actions.
With Once Only, the first time this action is triggered by a test, the action is performed. On subsequent true evaluations the action is not performed. The action is not performed again until the test becomes false and then true again. This is the default behavior for all actions.
Substitution of variables in alert messages will have no impact on this feature.
With Always, the action is performed each time the associated test is evaluated as true, even if the test was true in the last evaluation.
3.
The action is not performed the first time the associated test is true, but instead starts an internal timer. When the action is triggered on a test transition from false to true, the timer is started. If the associated test remains true for another evaluation after the specified interval, then the action is performed. You can use an escalation period to respond to continuing or deteriorating conditions.
4.
a.
To create a new property, click the Create New Property button in the Properties area. A new table row appears.
Normally, when an action is executed, internal properties (such as Rule, DataSource, Test, and so on) are assigned to the action. You can define additional properties for an action here. If an action causes an alert to be generated, these properties (internal and user-defined) are passed to the PostAlertEvent. For user-defined properties in the action, the properties are pre-appended with "Action" in the key. These properties can also be viewed in the alert details in the Alerts portlet.
To add properties to rulebase actions, type in the key and value. The key and value must be strings. You can modify, copy and delete keys and values that you have added.
b.
To load a previously-defined template, click Template and select Load, then select the file to be loaded.
c.
If you want to save your new action properties as a template, click Template and select Save, then specify where the file should be created and enter a file name. The template is saved as an XML file, and the extension .xml is added to the filename if not specified. The template can be loaded later.
d.
You can also configure a saved template as the default template by clicking Set Default from the Template menu and selecting the appropriate template.
When a default template is set, the properties from the default template are saved in the local database and loaded to the Advanced Options Editor when an action is being edited. If a property from the default template exists in the current action, the property from the default template is ignored. The default template is on a per-user basis.
5.
Save But Do Not Deploy : To save in the browser until user logs out.
Save and Deploy: To save it and deploy it to the agent or repository.
Clear Action
A clear action is an action that takes place only when a test makes the transition from true to false. After the test becomes true, whenever it becomes false again one or more actions are performed. Clear actions behave like regular actions but do not support advanced options except schedules, and cannot generate alerts. They are useful for sending notifications or all-clear messages.
A clear action can reference the same data source variables as the associated test. For more information, see Referencing Data Source Variables. For instructions on using this screen, see Creating Actions.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved