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


Chapter 4 Rulebase Management : Creating a Test in the Rule

Creating a Test in the Rule
In the Hawk Console, you can define test condition for the rules. The alerts are generated based on a predefined test condition. The test condition can be designed by using the rulebase and microagent variables.
Procedure
1.
2.
In the Agent’s page, select the Rulebases tab.
All the rulebases for the Hawk agent are displayed. For details, see Rulebases Tab.
3.
On the Rulebases tab, click the rulebase name which you want to edit.
All the rules in the rulebase are listed. For details, see Rule Details Page.
4.
All the test conditions in the rule are listed. For details, see Test Details Page.
5.
6.
For details about the test condition builder elements, see Test Condition Builder Reference.
7.
(Optional) Click Advance Options to add extra conditions to the test.
For the list of Advance Options fields, see Table 7, Test Condition Advance Options Fields.
8.
(Optional) Click Create and Add Action.
The New Action window opens to add an appropriate action for the rule if the test condition is true. For details, see Creating an Action for a Test Condition.
9.
Click Create Test.
On successful creation of the test condition, the New Test window closes.
Result
The new test condition is now listed on the Rule details page.
What to do Next
Create a new action for the test condition. For details, see Creating an Action for a Test Condition.
Test Condition Builder Reference
You can define a simple test condition by using just a test variable, a test operator, and a test value. If needed, you can also define a compound test condition by using multiple test expressions at multiple levels joined by logical operators.
Test Condition Builder Core Elements
The following figure shows a sample compound test condition and has numbers to mark different test elements. The following table lists the test elements marked in the figure that you can use to define the test condition.
Figure 16 Sample Test Condition with Element Markers
 
Click the Add Expression icon to add one more expression to the test condition at the same level. The expressions are joined by using the logical operator specified (AND or OR)
((Total days > 1) AND (Total hours < 35))
Select the logical operator to join two expressions. The values are: AND and OR. You can use the Add Expression icon to add one more expression to the test condition.
((Total days > 1) AND (Total hours < 35))
Select this NOT operator for the expression if you want to negate the result of that single expression.
((Total days > 1) AND (NOT (Total hours < 35)))
Select this NOT operator for the set of expressions if you want to negate the result of that set of expressions.
(NOT ((Total days > 1) AND (Total hours < 35)))
((Total days > 1) AND (Uptime Equals 3) AND ((Total hours < 35) AND (Total millisec >= 48631625)))
Note: You must have at least one test expression to create a test condition.
Advance Options Fields
The following table lists the Advance Options fields displayed for the new test.
 
The drop-down also lists the negative of the schedules as well, which when selected means that the conditions are checked at times other than the schedule. For example, if the Weekend schedule defines the time interval for every Saturday and Sunday then the !Weekend schedule means the time interval other than every Saturday and Sunday.
(Default)CLEAR_ON_FIRST_FALSE - After the test becomes true, the test is cleared when the first time the test changes from true to false. This is the default behavior for a test with a synchronous data source.
CLEAR_TIMER - Specify a wait interval in seconds. After the test becomes true it remains true until this interval has passed without an additional true test. This is the default behavior for a test with an asynchronous data source, and the default wait interval is 900 seconds (15 minutes).
CLEAR_TEST - Specify an extra test expression for clearing the test. After the test becomes true, it becomes false only when the clear test expression becomes true. The clear test uses the microagent method result fields of the data source as input.
For example, a test monitors each line in a log file for the string Feed Line Down. If this string is found, an alert is generated. A clear test for the original test checks for a log file line that signals the condition is resolved, such as Feed Line Up. When the clear test evaluates to true, the original alert message is cleared.
Test Operators Reference
The following tables describe the test operators you can apply to numeric, text and Boolean test variables while building test expressions.
 

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